In-code verification of perl switches

Is there any way to check if perl command line keys are running? For example, if I run my program, for example perl -C foo.pl , I would like to check if the -C switch is activated or not. Any help would be greatly appreciated.

+7
source share
1 answer

From the perlrun manpage:

The -C flag controls some Unicode Perl functions ... The read-only magic variable ${^UNICODE} reflects the numerical value of this parameter. This variable is set at the start of Perl and is then read-only.

There are other magic variables for some other command line switches. Either perlrun or perlvar should have the information you are looking for.

+9
source

All Articles