Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: perl not going to error path

by gupr1980 (Acolyte)
on Jan 23, 2016 at 18:17 UTC ( #1153478=note: print w/replies, xml ) Need Help??


in reply to Re: perl not going to error path
in thread perl not going to error path

Oh my, i thought putting the quote around the file handle works but it does not. even when i send a numeric offset putting a quote around file handle goes to die. I guess i should not put quote around file handle. So i should check to make sure that the value is numeric before passing it to seek.

hopefully there is a way to check and die if it is non numeric with a non zero exit code. I will look around. thanks

Replies are listed 'Best First'.
Re^3: perl not going to error path
by stevieb (Canon) on Jan 23, 2016 at 18:21 UTC
    "So i should check to make sure that the value is numeric before passing it to seek"

    You can, yes. Doing it this way will allow you to handle the error yourself:

    my $offset = 'blah'; if ($offset =~ /^[0-9]+$/){ seek $fh, $offset, 0; } else { die "offset needs to be numeric"; }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2022-01-27 19:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (71 votes). Check out past polls.

    Notices?