$ perl -wMstrict -le 'sub foo { return @_; } ;; my $ar; print foo(@$ar); print $ar;' ARRAY(0xada8b410) $
The aliasing is bypassing the strict check.
Something like this at least ... ;)
DB<12> use strict;print @$b Can't use an undefined value as an ARRAY reference at (eval 39)[/data/ +data/com.termux/files/usr/lib/perl5/5.28.2/perl5db.pl:738] line 2. DB<13> use strict;print @$b=(1..3) 123 DB<14> p $b ARRAY(0xb0a92180) DB<15>
I wasn't too wrong, strict tolerates it as long as it is an lvalue. And aliasing seems to have this effect.
HTH! :)
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
In reply to Re: Dereference of undefined value OK under strictures?
by LanX
in thread Dereference of undefined value OK under strictures?
by AnomalousMonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |