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

Re: Open a file

by Corion (Patriarch)
on Aug 12, 2019 at 18:08 UTC ( [id://11104340]=note: print w/replies, xml ) Need Help??


in reply to Open a file

Let Perl tell you the reason why it failed:

my $filename = "C/Perl64/Perl Scripts/Names.txt"; open(my $fh,'<:encoding(UTF-8)', $filename) || die "Could not open file '$filename': $!";

Replies are listed 'Best First'.
Re^2: Open a file
by liljohn (Initiate) on Aug 12, 2019 at 21:29 UTC

    Thank you so much, Once I used your suggested code and saw the message "no such file" I realized I had omitted part of the file path.</pP

      Don't you love it when a plan comes together so easily? :)

      By the way, welcome to the Monastery, liljohn! I've just got a small suggestion here... you've done an excellent job of following this site's posting syntax, but it appears as though you've missed a couple of closing tags. The </p> closing tag in this post, and the </code> tag in your Original Post (OP) don't have the > in place. Any chance you could go back and edit them in? If not, our Editors will get notified and will have to do that for you.

      Keep up the good work here. A newcomer responding back to a helpful post goes a long way.

Log In?
Username:
Password:

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

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

    No recent polls found