|Perl: the Markov chain saw|
Syntax Perl Version support $c = () = $a =~ /\./gby h2 (Beadle)
|on Jul 17, 2018 at 18:02 UTC||Need Help??|
h2 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Perl Monks, I have what is hopefully a simple question, but one I have been unable to search for due to the odd syntax of the below.
The program I'm working on has a core requirement to work on older systems, and has a cutoff of Perl 5.008 (selected because Redhat mid 2000s release was quite late to support 5.010) or newer, though that could change in the future to either a touch earlier version, or a touch later version (but certainly never newer as max oldest than 5.010). As an aside, so far Perl 5.x has far exceeded my wildest expectations in this regard, the program is in fact working on everything! No matter how weird or arcane.my $a='3.4.4'; my $c = () = $a =~ /\./g; print "$c\n"
However, my question is this: when did Perl begin supporting this type of structure?$c = () = $a =~ /\./g
I've come across this several times, and I'm allured by it, it calls to me, but I have to be careful using structures that could trigger warnings or failures in old systems.
I'd actually like to significantly expand my use of this type of structure, so besides this specific example, can anyone point me to the right search terms that describe it, that's multiple assignments of some value generated on the right side of the items? And also I believe various items that could be in the second position, (), though I'm not positive about that. And has this support been consistent since version 5.xxx? Are there various types of this assignment that have been introduced earlier or later?
I have the big Larry Walls Perl book, but I don't know what this is called to begin learning more about it, and what variants will be safe to use.