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

Re: Diamond errors

by LanX (Saint)
on Jan 21, 2023 at 22:18 UTC ( [id://11149753]=note: print w/replies, xml ) Need Help??


in reply to Diamond errors

> perl -e'while(<>){1;}continue{print "$ARGV\n" if eof;}; print $!' file1 file2 file3

> I could push $ARGV onto an array using eof and compare the result to @ARGV after the loop

please note that the continue will not be executed for empty files, although they exist.

LanX@MDXN MINGW64 / $ ls -l file* -rw-r--r-- 1 LanX 1049089 0 Jan 21 23:12 file1 -rw-r--r-- 1 LanX 1049089 2 Jan 21 23:13 file3 LanX@MDXN MINGW64 / $ perl -e'while(<>){1;}continue{print "---$ARGV\n" if eof;}; print $!' + file1 file2 file3 Can't open file2: No such file or directory at -e line 1. ---file3

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery

Log In?
Username:
Password:

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

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

    No recent polls found