Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Diamond errors

by hippo (Bishop)
on Jan 21, 2023 at 17:48 UTC ( #11149749=note: print w/replies, xml ) Need Help??


in reply to Diamond errors

However, after the loop, there doesn't seem to be a way for the program to detect that a file wasn't processed. In real life, that could be awkward.

Simple solution: use strictures.

perl -Mstrictures -e'while(<>){1;}continue{print "$ARGV\n" if eof;}; p +rint $!' file1 file2 file3 file1 Can't open file2: No such file or directory at -e line 1, <> line 1.

That should make it pretty obvious even to the most obtuse of users that something has gone badly wrong.

If you are after a less abrupt, more hand-holding approach then yes, I think it probably best to roll your own.


🦛

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2023-03-28 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (67 votes). Check out past polls.

    Notices?