Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^2: what is the purpose of Tie::File

by Lotus1 (Curate)
on Nov 11, 2012 at 23:02 UTC ( #1003352=note: print w/replies, xml ) Need Help??

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

  • 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.

Replies are listed 'Best First'.
Re^3: what is the purpose of Tie::File
by Anonymous Monk on Nov 12, 2012 at 04:03 UTC

      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.


        Ah, the mistake you've made is in thinking that everyone actually reads post content, or tests solutions before voting ;)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003352]
[Eily]: Discipulus try looking at $@
[Eily]: or count the parentheses :)
[Discipulus]: stupid me! I had to stay at home and do not code with the flu..
[holli]: bacause it's a syntax error
[Discipulus]: yes sorry forget and forgive me
[Eily]: for what it's worth I didn't go for the brightest solution either
[Eily]: I tried print eval '2+1/3*(2+2/5))' or print $@
[Eily]: and therefore concluded that the eval did succeed because there was no printed error :P
[Eily]: stupid operator precedence :D

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2017-10-24 10:19 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (287 votes). Check out past polls.