Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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

by tangent (Vicar)
on Dec 05, 2017 at 01:22 UTC ( #1204911=note: print w/replies, xml ) Need Help??

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

In addition to what toolic has advised, you can test if your file is readable and writeable using -r and -w. In its default mode Tie::File tries to open the file in read/write mode so the file needs to be both readable and writeable.

If you only want to read the file you would use tie like this:

use Tie::File; use Fcntl 'O_RDONLY'; #... tie (my @content, 'Tie::File', $file, mode => O_RDONLY) or die "Could +not open $file: $!";

Replies are listed 'Best First'.
Re^2: Tie::File with absolute path of the file
by colox (Sexton) on Dec 05, 2017 at 12:18 UTC
    many thanks!.. this solved my issue.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2022-05-22 01:39 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (78 votes). Check out past polls.