in reply to Perl command line switches
... I inherited a scile file ...
I don't know what a "scile" file is.
... a command that you can use on the Perl script to get help on how to run that file or which arguments to pass to the script while running ...
There is no such general utility of which I am aware (update: but see perldoc as noted by haukex). However, any well-designed, non-trivial script will | should IMHO have a "usage" or "help" message of some kind that might look something like
(where $0 is (more or less) the script name; see perlvar). If you can't find such code, then after examining the script to try to determine that it will do nothing irreversible, maybe try invoking the script with no command line arguments; this may trigger a usage/help message. There may also be a command line flag or switch like -h --help -? /h /? or similar supported by the script. Maybe also look for the presence of modules Getopt::Std or Getopt::Long used to manage command line options and arguments and see what they're doing in the script.use constant USAGE => <<"EOT"; usage: perl $0 -yz input_file_name output_file_name where: -y optional: command line switch to enable Y -z optional: command line switch to enable Z input_file_name required: input file name output_file_name required: output file name etc... EOT ... die USAGE unless @ARGV >= 2; ...
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl command line switches
by soonix (Chancellor) on Mar 27, 2020 at 08:19 UTC | |
by AnomalousMonk (Archbishop) on Mar 27, 2020 at 08:40 UTC | |
|
Re^2: Perl command line switches
by Irakro1997 (Novice) on Mar 27, 2020 at 15:30 UTC | |
by Corion (Patriarch) on Mar 27, 2020 at 16:43 UTC | |
by Irakro1997 (Novice) on Mar 27, 2020 at 17:01 UTC | |
by Corion (Patriarch) on Mar 27, 2020 at 17:19 UTC | |
by Irakro1997 (Novice) on Mar 27, 2020 at 17:35 UTC | |
| |
by bliako (Abbot) on Mar 27, 2020 at 18:12 UTC | |
by hippo (Archbishop) on Mar 27, 2020 at 19:33 UTC | |
by Irakro1997 (Novice) on Mar 27, 2020 at 17:04 UTC |