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

Re^2: Create a hash by spliting string

by sundialsvc4 (Abbot)
on Feb 10, 2011 at 01:36 UTC ( [id://887323]=note: print w/replies, xml ) Need Help??


in reply to Re: Create a hash by spliting string
in thread Create a hash by spliting string

Whereas I, being forever distrustful of data, would split the string on semicolons, and then, in a loop, split each piece separately.   And, my code would verify that each of these splits generated exactly two pieces, and it would croak if ever it did not.   So, this would not only accomplish the task of splitting the string, but also confirm that it is well-formed.

Yup... guess I’m a Perl Dork.

Replies are listed 'Best First'.
Re^3: Create a hash by spliting string
by Utilitarian (Vicar) on Feb 10, 2011 at 08:34 UTC
    Hardly a dork, after all verifying your data is valid before throwing it into a structure is the correct thing to do. However I suspect our Anonymous friend isn't writing production code here

    print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-23 23:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found