Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Should I worry about "Inappropriate ioctl for device"?

by karlgoethebier (Abbot)
on Aug 10, 2020 at 12:09 UTC ( [id://11120541]=note: print w/replies, xml ) Need Help??


in reply to Re: Should I worry about "Inappropriate ioctl for device"?
in thread Should I worry about "Inappropriate ioctl for device"?

You may read this by brian_d_foy. $ERRNO is not what you want.

One option might be to rewrite you code like this:

sub four_digit_year { my $year = shift; if ( $year !~ /\d{4}/ ) { return; # undef } return $year; }

Then check if the result of your sub call is defined and die with some custom error message if not.

And probably you may find a more robust recipe on PM how to test if some date is valid.

Best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-03-28 10:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found