- or download this
# test.pl
while (my $line = <>) {
chomp $line;
print qq{$line\n}; # yes I know, pointless use of chomp
}
- or download this
> perl test.pl < test.pl
# test.pl
...
chomp $line;
print qq{$line\n}; # yes I know, pointless use of chomp
}
- or download this
while (my $item = pop @my_array) {
# do stuff with $item
}