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

Re: what is the purpose of Tie::File

by Khen1950fx (Canon)
on Nov 11, 2012 at 05:29 UTC ( [id://1003301]=note: print w/replies, xml ) Need Help??


in reply to what is the purpose of Tie::File

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^2: what is the purpose of Tie::File
by Lotus1 (Vicar) on Nov 11, 2012 at 23:02 UTC
    • Using perl -l gives you autochomp which Tie::File has built in. From your other nodes I see you use this frequently to add a newline when you print.
    • $^W = 1; and then use Warnings; a few lines later?
    • Using autodie means the script stops after the unlink line even if there is a file to delete. Why not just die if -e $file; ?
    • Does $| = 1; have any effect on Tie::File? With the option memory => 0 it is already not cacheing anything.

    I don't understand the point of this code. Tying to a file that doesn't exist, adding a line, then deleting the newly created file doesn't seem useful.

        What doesn't make sense to me is how a node that has so many obvious code problems can muster up a positive node reputation.


        Dave

Re^2: what is the purpose of Tie::File
by Anonymous Monk on Nov 11, 2012 at 09:11 UTC

    Having a glitch of some kind---code is coming:). Here:

    How delightfully refreshing, here's mine

    P.S.

    It now runs great!

    The output is twice as much

    Uncaught exception: Can't unlink('file.txt'): No such file or director +y at realdelight.pl line 14. main::__ANON__('file.txt') called at (eval 49) line 28 main::__ANON__('file.txt') called at realdelight.pl line 31 at realdelight.pl line 22. main::__ANON__('Can\'t unlink(\'file.txt\'): No such file or direc +tory at rea...') called at C:/perl/site/5.14.1/lib/Carp.pm line 101 Carp::confess('Can\'t unlink(\'file.txt\'): No such file or direct +ory') called at realdelight.pl line 14 main::__ANON__('file.txt') called at (eval 49) line 28 main::__ANON__('file.txt') called at realdelight.pl line 31 Can't unlink('file.txt'): No such file or directory at realdelight.pl +line 14. main::__ANON__('file.txt') called at (eval 49) line 28 main::__ANON__('file.txt') called at realdelight.pl line 42 main::END() called at C:/perl/site/5.14.1/lib/Carp.pm line 101 eval {...} called at realdelight.pl line 14. main::__ANON__('file.txt') called at (eval 49) line 28 main::__ANON__('file.txt') called at realdelight.pl line 42 main::END() called at C:/perl/site/5.14.1/lib/Carp.pm line 101 eval {...} called at C:/perl/site/5.14.1/lib/Carp.pm line 101 END failed--call queue aborted at realdelight.pl line 101.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-24 21:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found