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

Re^3: 78/80 chars perl line still a meaningful rule

by Anonymous Monk
on Oct 17, 2012 at 09:32 UTC ( #999505=note: print w/ replies, xml ) Need Help??


in reply to Re^2: 78/80 chars perl line still a meaningful rule
in thread 78/80 chars perl line still a meaningful rule

# Given. confess "Insufficent data in X from {hash lookup} through {hash lookup +} source data file {hash lookup}" unless {condition};

I prefer sprintf when there are more than 1 or 2 simple variables are involved. Using sprintf sans () with post condition check is awkward, so used or. I would use map or hash slice if the 3 instances refer to the same hash (reference). First argument to sprintf would be on single line.

{condition} or confess sprintf "Insufficient data in X from %s through %s source da +ta file %s" , {hash lookup} , {hash lookup} , {hash lookup} ;


Comment on Re^3: 78/80 chars perl line still a meaningful rule
Select or Download Code
Re^4: 78/80 chars perl line still a meaningful rule
by Anonymous Monk on Oct 18, 2012 at 16:12 UTC
    I would have split the long text-string into two more convenient strings, concatenated together, and put the "unless" on a separate line, with each subsequent line neatly-indented from the first. I would particularly want to be sure that the presence of the "unless" line was not missed. I might for that reason say "unless (condition) { ... confess ... }" to make this important point all the more obvious to the reader. Being "obvious" is essential.

Log In?
Username:
Password:

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

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

    The best computer themed movie is:











    Results (253 votes), past polls