in reply to Overwriting a Constant
Interesting to note is that Getopt::constant does prefix such constants too and this serves to distinguish them by providing a label before the constant name, you can pass empty-string to the ':prefix' label too.
#SYNOPSIS from Getopt::constant document... # Assuming @ARGV is: ('-foo=9,8,7', '-bar', 'wakawaka.txt') use Getopt::constant ( ':prefix' => 'C_', #Can be null too 'foo' => [3,5], 'bar' => 0, ':usage' => "Usage: thingamabob -foo=one,two,three : fooey on these items -bar : enable barriness ", ); # @ARGV is now 'wakawaka.txt', and you've now got # a constant C_foo with value (9,8,7) # and a constant C_bar with value 1
N.B: Nefarious purposes can backfire in a hairy way so 'plot' with caution...
|
|---|