Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: First time using Args

by Not_a_Number (Parson)
on May 03, 2012 at 19:03 UTC ( #968802=note: print w/ replies, xml ) Need Help??


in reply to First time using Args

Hi.

A couple of other remarks:

  • You go to a lot of trouble to validate and then open the input file given on the command line, but then you never actually read from the said file...

  • You increment month by 1 in this line:
    $month = sprintf("%02d", $month+1);

    but, as you have already added 60 days, this will add a further 30 (or 31, or 28, or whatever).

  • In fact, assuming that you don't want to increment month, that whole chunk of code (four lines) could be simplified to:
  • my $deadline = sprintf '%d-%02d-%02d 00:00:00', Add_Delta_Days( Today, 60 );


Comment on Re: First time using Args
Select or Download Code
Re^2: First time using Args
by mmusser (Initiate) on May 03, 2012 at 19:08 UTC

    Ah,thanks for the tip on the date. I'm still making lots of newbish mistakes. Yeah, I don't validate the contents of the file itself...haven't thought about how I'd go about doing that yet. The script itself is far from finished, actually, but I've never validated the content of a file to check its format.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-07-14 08:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (257 votes), past polls