Adriano Allora <[EMAIL PROTECTED]> wrote:    hi to all,

(and a very good new year's eve). someone can tell me why this script 
doesn't accept the -h flag?:

#!/usr/bin/perl -w

use strict;
use warnings;
use Getopt::Std;

getopt('h');
my $opt_h;
if($opt_h)
{
[code...]
}

You need to declare a hash then pass the hash to the getopt() function.
  This code is an example of something you can do with getopt(). 
   
  my %options;
   
  getopt( 'a:b:c:d:e', \%options );
   
  if ( $option{'a'} ) {
      do_something();
  }
   
  Hopefully this will at least point you in the right direction.
   
  - Travis.

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to