in reply to Re: Syntax Perl Version support $c = () = $a =~ /\./g (updated)
in thread Syntax Perl Version support $c = () = $a =~ /\./g
and I believe 4.x did as well
No, it didn't and doesn't yet without patches ;-)
perl 4 patchlevel 36:
qwurx [shmem] ~> perl4 -e '$s="3.4.5";$r=()=$s=~/\./g;print$r,"\n"' Illegal item (LEXPR) as lvalue in file /tmp/perl-eEdymqE at line 1, ne +xt 2 tokens "/\./g;" Execution of /tmp/perl-eEdymqE aborted due to compilation errors.
However, chaining assignments and evaluating ARRAY in scalar context did:
qwurx [shmem] ~> perl4 -e '$s="3.4.5";$r=@r=$s=~/\./g;print$r,"\n"' 2
Applying semantics of ARRAY to LEXPR (list expression) happened in perl5.
|
---|