$" = "\n";
@arr = (1, 2, 3, 4, 5);
open OUT, "> a.txt";
print OUT "@arr";
数组内插时,分隔符默认$"的值,可以通过修改$"的值来修改如何分割
$" = "\n";
@arr = (1, 2, 3, 4, 5);
open OUT, "> a.txt";
print OUT "@arr";
open my $fh, '>' ‘test.txt’ or die $!;
for my $data (@array)
{
print $fh, $data;
}
1. use storable;
2. Date::Dumper
3. for my $each1 (@array) {
print OUT $each1
}