- or download this
while (defined(my $line = <$in>)) {
chomp $line; # Zap trailing "\n" efficiently
print $out $line,"\r";
}
- or download this
#!/usr/bin/perl
...
print "read: $line\n";
}
close $in;
- or download this
>perl foo.pl
read: a line
read: a second line
read: 0
>
- or download this
>perl -E '"0\n" and say "true"'
true
...
>perl -E 'undef or say "false"'
false
>