Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: date::manip question

by Kenosis (Priest)
on Feb 02, 2013 at 21:14 UTC ( #1016757=note: print w/replies, xml ) Need Help??


in reply to Re^2: date::manip question
in thread date::manip question

On a side note, perhaps the following may be helpful:

my $date1 = UnixDate( ParseDate($raw_date1) || 'today', "%Y-%m-%d" );

This, instead of checking for an empty string, will either send a successful ParseDate or 'today' to UnixDate. I'd suggest a more comprehensive sanity check on the date data, but this will catch more than just an empty string.

Replies are listed 'Best First'.
Re^4: date::manip question
by e5z8652 (Novice) on Feb 03, 2013 at 21:04 UTC

    As you can tell from my posts, most of my Perl scripts are quick "get 'er done" type things. I am not a developer or programmer, but a jack-of-all-trades network guy.

    That being said I appreciate any advice. I'll probably clean them up now that they've broken and I'm looking at them anyway.

    I think in this case I got caught in the reversal of comparison operators between Bash and Perl. Per the ABSG chapter 7, the == operator is for strings and -eq is for integers. Exactly the opposite for Perl. So I probably had the Bash operators in mind when I wrote the original...

    :/

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016757]
help
Chatterbox?
[marioroy]: `bash -c "clang --version 2>/dev/null"`
[choroba]: Sane people don't use csh
[marioroy]: the 1>&2 will work, not shown
[marioroy]: sorry, did not know which if cmd.exe or unix (bash)
[choroba]: csh considered harmful
[erix]: no, I'm using bash :)
[marioroy]: :)
[marioroy]: I use the default and happens to be bash
[erix]: heh, I like the "Resolved" (Christiansen is really funny)
Discipulus is makita a reincarnation of grinder?

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2017-03-23 08:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (285 votes). Check out past polls.