http://www.perlmonks.org?node_id=1035710

rtteal has asked for the wisdom of the Perl Monks concerning the following question:

I apologize if this question has already been asked before... I'm new to perl and am trying to wrap my head around everything that can be done with the different variable types. So I wrote this and can't figure out what's going on. I made comments in the code where I'm confused.

#!/usr/bin/perl use strict; use warnings; my @arry = (); my ($one, $two, $three); $one = 1; $two = 2; $three = 3; @arry = ( $one, $two, $three ); print "two is $two \n"; $arry[1]++; print "two is $two \n"; #I'm expecting this to be 3, but it's 2 print join("\n", @arry), "\n"; #Output: >two is 2 >two is 2 >1 >3 #arry[1] = 3. Why doesn't print "$two" = 3? >3