Professional Documents
Culture Documents
FH
The while loop reads the current line from the file
somefile.txt and print it to the console
Instead of while(<FH>), we could also write
while(defined ($_ = <FH>))
Instead of the whole while loop, we could concisely write:
print $_ while(<FH>);
The construct <> is called the readline or diamond operator.
while(<>)
{
print $_;
}
(1)
(2)
(3)
$var =~ /(\w+)$/
$code !~ /^#/
s/#{2,}/#/g