Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: split giving me a splitting headache

by Your Mother (Canon)
on Apr 24, 2013 at 18:45 UTC ( #1030483=note: print w/ replies, xml ) Need Help??


in reply to split giving me a splitting headache

Or do, :P

sub split_it_this_a_way { my $string = shift || die "die, die, kill you all!"; my ( $second, $first ) = split '\.', reverse($string), 2; ( ~~reverse($first), $second ); } my $str = "x.z.y"; print $str, " -> ", join(" + ", split_it_this_a_way($str)), $/;

...because that's, uh, easier... uh, to, uh...


Comment on Re: split giving me a splitting headache
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2014-08-21 05:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (127 votes), past polls