Side-effect of Perl's print function <p>I'm wondering why/how <code>print</code> in Perl can have a side-effect.</p> <pre><code>use Scalar::Util qw/looks_like_number/; my @A = (5, '2', 'aaa', 1, 'aab'); my @a = map { looks_like_number($_) } @A; print "1) @a\n"; # prints "4352 1 0 4352 0" print "A print with a side-effect: @A\n"; @a = map { looks_like_number($_) } @A; print "2) @a\n"; # prints "1 1 0 1 0" </code></pre> <p>In this example, <code>looks_like_number</code> returns <code>4352 1 0 4352 0</code> before the print, and <code>1 1 0 1 0</code> after the print.</p> <p>What does <code>print</code> do to these values to affect how they're interpreted by <code>looks_like_number</code>?</p>