- or download this
for my $line (@l){
chomp $line; # Remove the newline from the end
print $line . " - processed by 'trenchwar'\n"; # Add a little co
+ntent to each line
}
- or download this
for (@l){
chomp;
print "$_ - processed by 'trenchwar'\n";
}
- or download this
chomp @l; # Remove the newline from all elements
print map { "$_ - processed by 'trenchwar'\n" } @l;
- or download this
open (FH3, ">lessons.txt");
### You should *always* check the return from any calls to the system.
...
### *And* check the return of the call. And don't pre-assume the reaso
+n for failure:
### find out what it is with the '$!' (actual error) variable.
open FH3, "lessons.txt" or die "lessons.txt: $!\n";