Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: simple to describe I/O problem

by Anonymous Monk
on Sep 01, 2014 at 19:25 UTC ( [id://1099189]=note: print w/replies, xml ) Need Help??


in reply to simple to describe I/O problem

In addition to the above, your arguments to open are wrong, see IO::File. Try this instead:

... my $fh=IO::File->new; if ($fh->open("$file","<")) { ...

Replies are listed 'Best First'.
Re^2: simple to describe I/O problem
by AnomalousMonk (Archbishop) on Sep 01, 2014 at 19:46 UTC
    if ($fh->open("$file","<")) { ... }

    Why does the string  $file have to be interpolated into another string  "$file" before being passed to the open method?

      It doesn't, "$file" was just a remnant of (too) quickly editing the OP's code. (Unless maybe $file is an object with overloaded stringification; but then it'd probably be stringified inside open...)
Re^2: simple to describe I/O problem
by dottornomade (Initiate) on Sep 01, 2014 at 20:00 UTC

    Thank you.

    My bad, it was a trivial mistake, it works now :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-16 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found