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

Re: First time using Args

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

in reply to First time using Args


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 );

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://968802]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2018-04-25 05:38 GMT
Find Nodes?
    Voting Booth?