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

Re: Understanding Split and Join

by chromatic (Archbishop)
on Dec 29, 2006 at 00:52 UTC ( #592154=note: print w/replies, xml ) Need Help??


in reply to Understanding Split and Join

What happens if the delimiter is indicated to be a null string (a string of zero characters)?

perl behaves inconsistently with regard to the "empty" regex:

my $string = 'Monk'; exit unless $string =~ /(o)/; my @matches = $string =~ //; warn join('=', @matches), "\n"; exit unless $string =~ /(o)/; my @letters = split( //, $string ); warn join('-', @letters), "\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://592154]
help
Chatterbox?
[karlgoethebier]: Unne hip unne hop unne schoppe inne kopp...
[1nickt]: kgb not quite as simple as ... and ...; are interchangeable. There are edge cases, shown in perlsyn.
[1nickt]: Hm well actually I guess it's not the trailing semi-colon that's at issue there, it's disambiguation between the ellipsis and the binary flip-flop
[1nickt]: Although the example given does not produce an error as stated, on my perl.

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2017-11-18 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (277 votes). Check out past polls.

    Notices?