T
Todd
Hi perl guys,
See the results below, what confused me most is difference between the
"case3" and "case4":
#! /bin/perl -l
@a = (aa, bb, cc);
sub foo {@a}
print "case1: ", \foo;
print "case2: ", \@a;
print "case3: ", \(@a);
print "case4: ", \(@a, 1);
__END__
case1: SCALAR(0x10410e54)SCALAR(0x1042ec3c)SCALAR(0x1042ec48)
case2: ARRAY(0x1042eae0)
case3: SCALAR(0x10410f38)SCALAR(0x1042eab0)SCALAR(0x1042ec0c)
case4: ARRAY(0x1042eae0)SCALAR(0x1042ec3c)
From the results shown above, I get:
\(@a) is not (\@a), since the results are 3 references
\(@a, 1) is (\@a, \1), since the results are 2 references.
What's the reason to causes this differences?
I knew there must be some posts where this topics already has been
thoroughly talked, but i can't google it. So may you give me some
hints about this tricky thing?
Best regards,
Todd
See the results below, what confused me most is difference between the
"case3" and "case4":
#! /bin/perl -l
@a = (aa, bb, cc);
sub foo {@a}
print "case1: ", \foo;
print "case2: ", \@a;
print "case3: ", \(@a);
print "case4: ", \(@a, 1);
__END__
case1: SCALAR(0x10410e54)SCALAR(0x1042ec3c)SCALAR(0x1042ec48)
case2: ARRAY(0x1042eae0)
case3: SCALAR(0x10410f38)SCALAR(0x1042eab0)SCALAR(0x1042ec0c)
case4: ARRAY(0x1042eae0)SCALAR(0x1042ec3c)
From the results shown above, I get:
\(@a) is not (\@a), since the results are 3 references
\(@a, 1) is (\@a, \1), since the results are 2 references.
What's the reason to causes this differences?
I knew there must be some posts where this topics already has been
thoroughly talked, but i can't google it. So may you give me some
hints about this tricky thing?
Best regards,
Todd