Think about Loose Coupling | |
PerlMonks |
Re: Function Split, bug or error in the documentation?by bojinlund (Monsignor) |
on Jul 04, 2020 at 11:15 UTC ( [id://11118906]=note: print w/replies, xml ) | Need Help?? |
I am trying to understand split and its documentation. To do this I have implement split by using m{} and the variables @- and @+. By this I have found some problems This script shows some of them:
QuestionsMagic in splitThis split_e( // ); gives the warning: Use of uninitialized value $_ in pattern match (m//) at pm_1.pl ... but this split( // ); does not. Is there some magic in split indicate by the ‘/’s in “/PATTERN/ in the documentation? Bug in the variables @- and @+I find that the result from split, m{} and when using $-[$ix] $+[$ix] are inconsistent. Split gives (1, "-", undef, 10, undef , ",", 20). m{} gives ("-", undef, undef, ","). Using $-[$ix] $+[$ix] does not include the undefs Is this a bug in the last case?
In Section
Seekers of Perl Wisdom
|
|