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

Re: Open a file

by Corion (Pope)
on Aug 12, 2019 at 18:08 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2020-09-30 19:18 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (166 votes). Check out past polls.