Re: Perl Syntax -- SOLVED

From: Drew Tomlinson (drew_at_mykitchentable.net)
Date: 06/30/04

  • Next message: iscan_at_email.sjsu.edu: "Virus Alert"
    Date: Wed, 30 Jun 2004 10:51:04 -0700
    To: Matthew Seaman <m.seaman@infracaninophile.co.uk>
    
    

    On 6/30/2004 10:34 AM Matthew Seaman wrote:

    >On Wed, Jun 30, 2004 at 10:17:45AM -0700, Drew Tomlinson wrote:
    >
    >
    >>On 6/30/2004 10:04 AM Steve Bertrand wrote:
    >>
    >>
    >
    >
    >
    >>>I know this works:
    >>>
    >>>if ($ARGV[0] eq '') {
    >>> print "Debug Mode\n";
    >>>}
    >>>
    >>>
    >
    >
    >
    >>Thanks for your reply. I tried your suggestion and it seems to work but
    >>I get this output:
    >>
    >>Use of uninitialized value in string eq at ./test.pl line 16.
    >>You must include the file name.
    >>
    >>
    >
    >Unless you supply at least one argument to the script, $ARGV[0] won't
    >exist. There's a difference in perl between 'not defined' and an
    >empty string (or zero for numerical values). Try:
    >
    > if ( @ARGV < 1 ) {
    > usage();
    > exit 1;
    > }
    >
    >or
    >
    > unless ( defined $ARGV[0] ) {
    > usage();
    > exit 1;
    > }
    >
    >
    Thank you very much for the explanation. Now I understand why I was
    getting the error message. I didn't quite understand how to use
    "usage();" but replaced it with a print statement. It works perfectly!

    Thanks,

    Drew

    -- 
    Visit The Alchemist's Warehouse
    Magic Tricks, DVDs, Videos, Books, & More!
    http://www.alchemistswarehouse.com
    _______________________________________________
    freebsd-questions@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
    

  • Next message: iscan_at_email.sjsu.edu: "Virus Alert"

    Relevant Pages

    • Slightly OT: Brodsky continues to make friends wherever he goes
      ... No wonder he and Drew get along so well. ... Nasty e-mail exchange over radio gimmick ... A suggestion by Drew Peterson and his lawyer that the ex-Bolingbrook ... But an e-mail response by Peterson's lawyer, Joel Brodsky, really ...
      (alt.true-crime)
    • Re: Perl Syntax
      ... I tried your suggestion and it seems to work but ... Josh Paetzel ... To unsubscribe, ...
      (freebsd-questions)
    • Re: Need help with Saslauthd and Sendmail
      ... At 14:43 08.10.2004, Matthew Seaman wrote: ... >> Would your suggestion be better? ... Youuhooo!!! ... When you do a ps -aux | grep saslauthd after rebooting you should see this ...
      (freebsd-questions)
    • Re: Need help with Saslauthd and Sendmail
      ... At 13:01 08.10.2004, Matthew Seaman wrote: ... Excellent problem report. ... Would your suggestion be better? ... To unsubscribe, ...
      (freebsd-questions)