Re: Bareword errors?
- From: Sherm Pendley <spamtrap@xxxxxxxxxxx>
- Date: Tue, 28 Nov 2006 14:48:45 -0500
gcr <reviewyourdemo@xxxxxxxxxxx> writes:
I'll hack around this but curious why first use passes.
The first use passes because it doesn't have the same error.
-----snip -----
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $search;
my %HASH;
my $name;
my $value;
my @pairs;
my $buffer;
my $pair;
getweb();
Why are you reinventing that wheel? Have a look at the CGI module - it's
the standard for a reason. (If you're using a book that told you to do
that, take that book back for a refund, and buy one whose author actually
knows what he or she is talking about.)
Also, why are you using global variables for everything, and giving them
nonsensical names like %HASH? Those are bad habits in *any* language.
if (!$HASH{search1}) {^
$search = "search2 only";
}
if (!HASH{search2}) {
$HASH
$search = "search1 only";^ ^
}
if (!HASH{search1} && !HASH{search2}){
$HASH $HASH
$search = "no search";
}
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
.
- Follow-Ups:
- Re: Bareword errors?
- From: gcr
- Re: Bareword errors?
- References:
- Bareword errors?
- From: gcr
- Bareword errors?
- Prev by Date: Bareword errors?
- Next by Date: FAQ 1.8 Is Perl difficult to learn?
- Previous by thread: Re: Bareword errors?
- Next by thread: Re: Bareword errors?
- Index(es):
Relevant Pages
|