Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: split giving me a splitting headache

by Your Mother (Chancellor)
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...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1030483]
help
Chatterbox?
[Lady_Aleena]: Module is currently 104 lines but will shirnk to 63. The script using the module is currently 40 lines but will grow to 82, 180 to 146 lines total. (This is after rewrting the data files.)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2017-05-29 03:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?