Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2019-09-23 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (276 votes). Check out past polls.

    Notices?