[Perl] 'perl -s' with strict

Yossi.Itzkovich at lightscapenet.com Yossi.Itzkovich at lightscapenet.com
Mon Nov 4 19:20:09 PST 2002

                      "Reuven M.                                                                                                 
                      Lerner"                  To:      perl at perl.org.il                                                         
                      <reuven at lerner.c         cc:      Uri Itscowits <iuri at sela.co.il>                                          
                      o.il>                    Subject: [Perl] 'perl -s' with strict                                             
                      Sent by:                                                                                                   
                      perl-admin at perl.                                                                                           
                      11/04/2002 17:12                                                                                           
                      Please respond                                                                                             
                      to perl                                                                                                    


(4) Use Getopt::Long, which is my vote for a winning solution.

    -s is obviously weird and somewhat broken, and I'm not sure how
    good of a method it is for receiving values.  I think that you
    would be wise to switch to Getopt::Long, a standard module that
    handles input options with a huge amount of flexibility, and
    without this sort of breakage.


Using Getopt::Long, you still have to declare the variable you send, like :

GetOptions("q" => \$q);

So, with  "use strict"  you still have to do something like :
my $q;


BTW: I still like and use this solution the most.


More information about the Perl mailing list