in reply to Writing the contents of an array to a file
it's been suggested that to avoid context problems, use something like this:
my $text = join(' ', @file2);
then print $text to the file.
i had a similar problem yesterday with a textarea in a CGI script i was writing yesterday. the join fixed it.
UPDATE: the scoping is also a problem. i just looked again. @file2 should be declared outside of the block. try a use vars qw/ @file2 / or declare @file2 outside of the while loop.
UPDATE 2: OK - the scoping was the issue, and join is a bit of overkill. :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: Writing the contents of an array to a file
by chromatic (Archbishop) on Sep 28, 2000 at 23:47 UTC | |
by Fastolfe (Vicar) on Sep 28, 2000 at 23:49 UTC | |
by tye (Sage) on Sep 29, 2000 at 00:06 UTC | |
|
RE: RE: Writing the contents of an array to a file
by Fastolfe (Vicar) on Sep 28, 2000 at 23:46 UTC |