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."