I use perl mainly for opening, closing and reading files...
My question is about writing to a file.
In other languages, it is possible to dump a complete array in a file. Translated to perl, it could look like this
@test = qw(a, b, c, d, e, f, g, h, i, j, k, l, m);
open (OUTFILE,">c:/test.txt"
or die "Error $f_file: $!";
dump ( OUTFILE,@test);
I know I could make a loop and print to the file, like:
foreach $line (@test) {
print OUTFILE "$line";
}
but this seems very cumbersom.
Does anyone know if something like the first syntax(blue) exists?
Thierry
My question is about writing to a file.
In other languages, it is possible to dump a complete array in a file. Translated to perl, it could look like this
@test = qw(a, b, c, d, e, f, g, h, i, j, k, l, m);
open (OUTFILE,">c:/test.txt"
dump ( OUTFILE,@test);
I know I could make a loop and print to the file, like:
foreach $line (@test) {
print OUTFILE "$line";
}
but this seems very cumbersom.
Does anyone know if something like the first syntax(blue) exists?
Thierry