in reply to Inappropriate I/O control operation
Update: OIC, you are using $! in your print statement. I missed that. Why? What are you trying to print?
As explained below by dave_the_m, you use $! after an error when it might hold a message about the error (if whatever encountered the error is nice enough to tell you). That's why I used it to check the return value of your file open call, which is where I assumed the error was coming from: it will tell you if you've made a typo in the path and the file does not exist, for example. In your case it is printing something unuseful because you're not using it the right way. What did you want to print there?
Original reply:
Try adding error checking and debugging to your program:
Also note the three argument form of open, which is safer.open(my $in, '<', $fn) or die "Died opening file: $fn error: $!";
Hope this helps!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Inappropriate I/O control operation
by cormanaz (Deacon) on Sep 26, 2017 at 17:02 UTC | |
by dave_the_m (Monsignor) on Sep 26, 2017 at 17:07 UTC |