in reply to More Arguments

Hello joaming,

To get the syntax right, you’ll need to study perlop#I/O Operators:

The null filehandle <> is special: it can be used to emulate the behavior of sed and awk, .... Input from <> comes either from standard input, or from each file listed on the command line. Here's how it works: the first time <> is evaluated, the @ARGV array is checked, and if it is empty, $ARGV[0] is set to "-", which when opened gives you standard input....

By trial and error, I found the following (on Windows), which seems to do what you’re looking for:

14:17 >echo Hello| perl -wE "$x = <>; chomp $x; $y = $ARGV[0]; say qq[ +>$x $y<];" - world >Hello world< 14:17 >

The call to <> finds - as the first argument on the command line and so reads from standard input, which is Hello\n. After this, @ARGV is apparently reset. I haven’t found that behaviour documented (yet).

Anyway, hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: More Arguments
by joaming (Novice) on Sep 05, 2015 at 05:27 UTC
    Thank you. I still have a long road to walk on Perl, lol