in reply to print "$var\n" or print $var, "\n"

The difference is in the magic that makes Perl, well, Perl.

Scalars can be numeric or "strings". When you store an integer in a scalar it's stored as an IV. When you use that scalar in string context it gets stringified. The scalar is modified behind the scenes to be a PVIV with pointers to an IV and PV.

#!/usr/bin/perl use strict; use warnings; use Devel::Peek; my @a = (1) x 1024; my @b = (1) x 1024; open my $fh, "> /dev/null" or die; print $fh $_, "\n" for @a; print $fh "$_\n" for @b; close $fh; Dump $a[0]; Dump $b[0];

Update: Fixed wording of fourth sentence.