Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by tangent (Parson)
on Dec 05, 2017 at 01:22 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-19 13:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found