Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: "close" failing

by arkturuz (Curate)
on May 31, 2006 at 13:14 UTC ( [id://552782]=note: print w/replies, xml ) Need Help??


in reply to Re: "close" failing
in thread "close" failing

You don't have to die always. $! will tell you the error.
Also, in a web app it would be nice to inform the user that something is going wrong, instead of printing 'Internal Server Error' or sth similar.

Replies are listed 'Best First'.
Re^3: "close" failing
by munishdev (Initiate) on May 31, 2006 at 14:20 UTC
    Another strange thing i found is that if i add ">", in front of abc.sh, it works for me. Can you tell what will ">" do to my script? open (SNMP1, ">abc.sh |") or die "Cannot run abc.sh $!"; while (<SNMP1>) { # do some processing } close (SNMP1) or die "ERROR: testing $! $?\n ";

      Please use the <code> tags!

      You will find you have create a file called abc.sh| in your current working directory. If you had warnings on you would also be warned about trying to read from a file handle opened for writing.

      /J\

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-03-28 17:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found