in reply to Using perl's runtime options with -Mstrict
-s is for one-liners (and even then isn't very useful). -Mstrict is not for one-liners. The two are pretty much completely incompatible. However, you could just write:
I see no reason to have a global $switch that Perl creates and then have a different, same-named lexical that you create with my.#!/usr/bin/perl -ws use strict; # My supported command-line switches: use vars qw( $switch $help $debug $foo ); $switch= "hooray" unless $switch;
Note that anyone using your script can accidentally type
and your program will silently act just like they hadn't included any command-line switches (that is, unless your program also defines a global named, for example, $food, and then relies on it to be initially uninitialized).minus-ess -snitch -helf -debung -food
In other words, I don't consider this even close to a good design decision. ):
- tye (but my friends call me "Tye")
|
|---|