While looking at some Perl code, I came across the assignment of the output of chr directly to a hash:
local %str = chr(shift);
Confused that the code worked fine, this made me realise the following:
perl -le 'my $jurso = 23; print $jurso;'
23
perl -le 'my %jurso = 23; print %jurso;'
23
perl -le 'my @jurso = 23; print @jurso;'
23
I expected that assigning a scalar directly to a hash or an array to result in an error. Can someone explain why the jurso variable behaves like a scalar regardless of the sigil used?
Thanks.