Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Syntax Perl Version support $c = () = $a =~ /\./g

by haukex (Archbishop)
on Jul 17, 2018 at 19:13 UTC ( [id://1218685]=note: print w/replies, xml ) Need Help??


in reply to Re: Syntax Perl Version support $c = () = $a =~ /\./g (updated)
in thread Syntax Perl Version support $c = () = $a =~ /\./g

AFAIK, Perl 5.x has always supported this

I'm having some trouble running a bisect at the moment, but as a tentative result, it appears that Perl versions roughly before 5.004 didn't like the test program -e '$a="f.o.o.bar"; $b=()=$a=~/\./g; $b==3 or die $b' because Can't modify stub in list assignment at -e line 1, near "/\./g;". AFAICT it was not possible to assign to an empty list back then (a workaround seems to be $b = @{[]} = $a =~ /\./g;, which works on 5.000).

Replies are listed 'Best First'.
Re^3: Syntax Perl Version support $c = () = $a =~ /\./g
by h2 (Beadle) on Jul 17, 2018 at 19:16 UTC
    haukex, thanks for digging in to find the lower limit, that was a key thing I needed to know. I'll note this in the docs, but I doubt I will ever need to go older than Perl 5.008 but I have learned painfully to never say never in this area.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1218685]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-19 11:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found