Scalar assignment in scalar context returns its LHS (as an lvalue), as documented here.
It's very very common to take advantage of this.
while (defined( $_ = <> )) { ... }
my $sock = IO::Socket::INET->new(...) or die(...);
( my $copy = $str ) =~ s/\\/\\\\/g;
etc.
In reply to Re: If 6 Was 9
by ikegami
in thread If 6 Was 9
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |