Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Out of memory error!!!

by Anonymous Monk
on Mar 27, 2013 at 18:17 UTC ( #1025780=note: print w/ replies, xml ) Need Help??


in reply to Out of memory error!!!

Davido's got your memory fault, but that's pretty inconsistent code formatting, and poor error reporting on the opens. (Remember, $! is your friend, and it never hurts to print the name of the file that failed to open in your error message)


Comment on Re: Out of memory error!!!
Select or Download Code
Re^2: Out of memory error!!!
by sathya83aa (Acolyte) on Mar 27, 2013 at 19:11 UTC

    Didnt get what you were referring to regarding the code and open statement. Can you please explain me in detail as I'm new to Perl programming.

        Better change it to:

        my $filename = 'LOG_file'; open(my $LOG, '>>', $filename) or die("ERROR: Cannot open file '$filen +ame' for appending: $!");

        McA

      use autodie; try a demo
      $ perl -e " use autodie; open my($fh), qw[< noexist ]; " Can't open 'noexist' for reading: 'No such file or directory' at -e li +ne 1
      the reason it can't open comes from $!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2014-07-30 23:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (241 votes), past polls