dpuu has asked for the wisdom of the Perl Monks concerning the following question:
Is there a way to figure out what command line args were passed to the perl interpreter (i.e. are not part of ARGV). On Linux I can do:
which outputs:perl -le '$/ = "\0"; open my $fh, "/proc/$$/cmdline"; print for <$fh>'
However, this is not portable to systems that don't have the /proc file system. Is there a hook into perl itself to get this information? (specifically, I'm wanting any /-d:.*/ flags)/home/utils/perl-5.10/5.10.0-nothreads-64/bin/perl -le $/ = "\0"; open my $fh, "/proc/$$/cmdline"; print for <$fh>
--Dave
Opinions my own; statements of fact may be in error.
Opinions my own; statements of fact may be in error.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Finding what args were passed to the perl interpretter ?
by oko1 (Deacon) on Nov 19, 2008 at 23:05 UTC | |
by dpuu (Chaplain) on Nov 19, 2008 at 23:24 UTC | |
by JavaFan (Canon) on Nov 20, 2008 at 00:26 UTC | |
Re: Finding what args were passed to the perl interpretter ?
by almut (Canon) on Nov 19, 2008 at 23:43 UTC | |
by dpuu (Chaplain) on Nov 20, 2008 at 00:19 UTC | |
by almut (Canon) on Nov 20, 2008 at 00:28 UTC | |
by dpuu (Chaplain) on Nov 20, 2008 at 00:34 UTC |
Back to
Seekers of Perl Wisdom