Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Out of memory error!!!

by sathya83aa (Acolyte)
on Mar 27, 2013 at 19:11 UTC ( #1025792=note: print w/replies, xml ) Need Help??


in reply to Re: Out of memory error!!!
in thread Out of memory error!!!

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.

Replies are listed 'Best First'.
Re^3: Out of memory error!!!
by marto (Bishop) on Mar 27, 2013 at 19:26 UTC

      Better change it to:

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

      McA

Re^3: Out of memory error!!!
by Anonymous Monk on Mar 28, 2013 at 04:03 UTC
    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://1025792]
help
Chatterbox?
LanX God shaves the Queen!
[marto]: plastering
LanX citing Sean Connery
[LanX]: met a guy from Aberdeen durin holidays, liked Scotsish accent a lot ... very phonetic

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2018-02-19 10:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (261 votes). Check out past polls.

    Notices?