Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: formatting question

by starbolin (Hermit)
on Jun 24, 2008 at 17:18 UTC ( [id://693785]=note: print w/replies, xml ) Need Help??


in reply to formatting question

I haven't tested whether this matches your logic, but it should be close, anyway:

sub body { ... your code ...} SWITCH: { body, last SWITCH if $wrongDateFlag and $#ARGV >= 2; body, last SWITCH if not $wrongDateFlag and $#ARGV >=2 and $oneDay +Flag == -1 ; body, last SWITCH if not $wrongDateFlag and $#ARGV >=1 and $oneDay +Flag >= 0; $felloff == 1; }

UPDATE:

I forgot $#ARGV returns one less than scalar @ARGV so I fixed that. Some would probably fault me for using a switch statement where each path calls the same code but I like the resulting look. Cleaner might be.

sub body { ... your code ...} body if $wrongDateFlag and $#ARGV >= 2 or not $wrongDateFlag and $#ARGV >=2 or not $wrongDateFlag and $#ARGV >=1 and $oneDayFlag >= 0;

UPDATE:

removed some vestigial semicolons.


s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (1)
As of 2024-04-19 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found