in reply to If 6 Was 9

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.