Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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 # 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 (Hermit) 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.



Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2021-09-23 20:16 GMT
Find Nodes?
    Voting Booth?

    No recent polls found