Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Split fake, an emulation of split

by ikegami (Pope)
on Jul 31, 2020 at 14:29 UTC ( #11120144=note: print w/replies, xml ) Need Help??


in reply to Split fake, an emulation of split

I found an error in the documentation of split

No you didn't. As documented, trailing empty fields are only removed when the third operand is zero (the default).

Replies are listed 'Best First'.
Re^2: Split fake, an emulation of split
by bojinlund (Prior) on Jul 31, 2020 at 14:59 UTC
    use strict; use warnings; use 5.010; # From https://perldoc.perl.org/5.30.1/functions/split.html: # and each of these: print join(':', split(//, 'abc', 3)), "\n"; print join(':', split(//, 'abc', 4)), "\n"; # produces the output a:b:c __DATA__ Output: a:b:c a:b:c:

      ah yes. You weren't very clear, so I misunderstood what you meant. That is indeed a documentation bug. Did you report it?

        You weren't very clear I didnt read the thred
Re^2: Split fake, an emulation of split
by jo37 (Friar) on Jul 31, 2020 at 16:50 UTC

    If something behaves differently from its documentation, then it is either an implementation or a documentation error. The discrepancy between actual behaviour and documentation is a fact, as the example is taken straight from split.

    Greetings,
    -jo

    $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2020-10-20 17:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (210 votes). Check out past polls.

    Notices?