Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Can read one txt file and not another?

by Anonymous Monk
on Jul 29, 2021 at 04:41 UTC ( [id://11135460]=note: print w/replies, xml ) Need Help??


in reply to Re: Can read one txt file and not another?
in thread Can read one txt file and not another?

Well, I feel silly now. Removing $in appears to have fixed the problem unless it was something seemingly unrelated I did later in the code that did it (but I doubt that). I started with an old code I wrote years ago (took a course that included some Perl and then forgot it) and changed a lot but just hadn't taken $in out.

Thanks for the help! I was expecting something more complicated and missed a very simple solution.

Replies are listed 'Best First'.
Re^3: Can read one txt file and not another?
by dsheroh (Monsignor) on Jul 29, 2021 at 07:16 UTC
    Removing $in appears to have fixed the problem unless it was something seemingly unrelated I did later in the code that did it (but I doubt that).
    If I'm understanding your post correctly, it's completely relevant.

    The file that didn't work had all the newlines removed, making the entire file a single line. Since there was only one line in the file, reading the first line into $in and throwing it away... threw away the entire file, leaving nothing for the loop to read.

Re^3: Can read one txt file and not another?
by perlfan (Vicar) on Jul 29, 2021 at 22:28 UTC
    This isn't stack overflow, if you find a solution on your own it's appreciated if you provide it with the different data that would be needed to explain it. Real people spend real time on others' problems. Although it's voluntary and a labor of love for some, it is nonetheless appropriate to "wrap up" things. Not only that, PM has the largest collection of the most complicated and interesting Perl questions and solutions in the world. Adding a wrap up will make this post potentially assist another in the future. Right now it's lacking: data requests (from others) and the solution.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-25 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found