Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: string spliting

by hbm (Hermit)
on Feb 12, 2009 at 17:08 UTC ( [id://743394]=note: print w/replies, xml ) Need Help??


in reply to string spliting

Assuming you want to guarantee 12 letters, I'd use a regular expression:

$_ = 'abcdefghijkl'; my ($a,$b) = (/^([a-z]{6})([a-z]{6})$/i) ? ($1,$2) : (undef)x2; print "$a, $b\n" if defined $a;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-03-28 13:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found