in reply to I need to read data from an array and write into a text file
See open for info on opening a file.
my @array = qw(some data you want to print to a file); open(my $fh, '>', '/path/to/a/text/file.txt') || die "could not open o +utput file : $!\n"; print $fh @array; close($fh);
That will wirte the array to the file. If you'd like to append data to the end of the file rather than over writing it:
open(my $fh, '>>', '/path/to/a/text/file.txt') || die "could not open +output file : $!\n";
Hope that helps
A truely compassionate attitude towards other does not change, even if they behave negatively or hurt you
His Holiness, The Dalai Lama
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: I need to read data from an array and write into a text file
by Anonymous Monk on Mar 11, 2005 at 20:12 UTC | |
by JediWizard (Deacon) on Mar 11, 2005 at 20:20 UTC | |
by Anonymous Monk on Mar 11, 2005 at 21:25 UTC |