rduke15 has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
Is the following somehow possible?
echo stuff | perl -ne '$x=shift; print "x=$x\n"' myarg
All I get is "Can't open myarg: No such file or directory.". I understand why, but is there some elegant solution to the problem?
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Differentiating STDIN from arguments when using -n ?
by bart (Canon) on Sep 15, 2007 at 11:06 UTC | |
by johngg (Canon) on Sep 15, 2007 at 11:44 UTC | |
by bart (Canon) on Sep 15, 2007 at 11:53 UTC | |
by rduke15 (Beadle) on Sep 15, 2007 at 12:28 UTC | |
by jwkrahn (Abbot) on Sep 15, 2007 at 19:50 UTC | |
by rduke15 (Beadle) on Sep 16, 2007 at 07:57 UTC | |
|
Re: Differentiating STDIN from arguments when using -n ?
by almut (Canon) on Sep 15, 2007 at 11:40 UTC | |
|
Re: Differentiating STDIN from arguments when using -n ? (-s)
by rhesa (Vicar) on Sep 15, 2007 at 12:14 UTC |