Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: First time using Args

by Not_a_Number (Prior)
on May 03, 2012 at 19:03 UTC ( [id://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 );

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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2024-03-28 12:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found