Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Tie::File with absolute path of the file

by toolic (Bishop)
on Dec 05, 2017 at 01:11 UTC ( #1204909=note: print w/replies, xml ) Need Help??


in reply to Tie::File with absolute path of the file

Tie::File can also write to the file. Maybe you don't have write permissions. Check the $! variable
tie my @content, 'Tie::File', $file or die "$file: $!";

Tip #7 from the Basic debugging checklist. Also, it looks strange to chain file test operators together like that. It might work, but I don't remember seeing it done that way.

Replies are listed 'Best First'.
Re^2: Tie::File with absolute path of the file
by AnomalousMonk (Bishop) on Dec 05, 2017 at 02:42 UTC
    ... chain file test operators ...

    Per -X: "As of Perl 5.10.0, as a form of purely syntactic sugar, you can stack file test operators ... -f -w -x $file ..."


    Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2020-10-23 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (238 votes). Check out past polls.

    Notices?