Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!math.lsa.umich.edu!emv From: emv@math.lsa.umich.edu (Edward Vielmetti) Newsgroups: comp.lang.perl Subject: getopt Message-ID: Date: 12 Dec 89 16:40:43 GMT Sender: news@math.lsa.umich.edu Organization: University of Michigan Math Dept., Ann Arbor MI. Lines: 28 how can I use getopt to detect the presence or absence of a switch? I thought I had it down pat: #!/usr/local/bin/perl do 'getopt.pl'; &Getopt('p'); if ($opt_p) { print STDERR "P option selected\n" ; } else { print STDERR "No P option\n"; } picasso /tmp/emv % ./post.pl -q # OK No P option picasso /tmp/emv % ./post.pl -p # huh? No P option picasso /tmp/emv % ./post.pl -p 1 # OK again P option selected How do I recognize '-p' w/o any argument to it ? thanks, --Ed