japl has asked for the wisdom of the Perl Monks concerning the following question:
perldoc on exec/system states that one can lie about name of the program being executed via indirect object syntax; but it doesn't appear so:
a simple test,
a simple test,
shouldn't it be "I am bar (1 2 3"?$ cat foo #!/usr/bin/perl -w use strict; print "I am $0 (@{[join ' ', @ARGV]})\n"; $ cat bar #!/usr/bin/perl -w use strict system { './foo' } 'bar', @ARGV; $ ./bar 1 2 3 I am ./foo (1 2 3) $
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: lying about program name
by hippo (Bishop) on Jun 14, 2018 at 10:47 UTC | |
Re: lying about program name
by choroba (Cardinal) on Jun 14, 2018 at 12:49 UTC | |
Re: lying about program name
by taint (Chaplain) on Jun 14, 2018 at 06:25 UTC | |
by japl (Initiate) on Jun 14, 2018 at 07:10 UTC | |
by taint (Chaplain) on Jun 14, 2018 at 13:59 UTC | |
Re: lying about program name
by ikegami (Patriarch) on Jun 14, 2018 at 13:00 UTC | |
Re: lying about program name
by Anonymous Monk on Jun 14, 2018 at 09:50 UTC |
Back to
Seekers of Perl Wisdom