in reply to List or Scalar?
Data::Dumper is your friend. If your print line is really printing that, then $temp should look as follows when you use print Dumper $temp;
$VAR1 = [ 120 ];
If that's the case, then you should be using $temp->[0] instead of @{$temp} as it returns the length of your array (which is 1) in scalar context.
If this is entirely wrong, the reason I think $temp is an arrayref is because using @{$temp} doesn't result in strict going on how 120 isn't an arrayref at line blah. Also, the OP said he was able to print "\$temp = @{$temp}\n"; and it prints out 120 which would be expected behavior for an arrayref.
Hope this helps.
antirice
The first rule of Perl club is - use Perl
The ith rule of Perl club is - follow rule i - 1 for i > 1
|
|---|