Re: Bareword errors?



In article <m264czmjxe.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Sherm Pendley <spamtrap@xxxxxxxxxxx> wrote:

Ouch! My Bad. Sorry, no sleep.

Side point - I've been burned a few times by cgi.pm so I gave up on it -
I didn't reinvent this wheel, though, I got it from someone and have
been using it for a while.

Sorry for the stupid question.


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--
.



Relevant Pages

  • Re: Recursively copying a directory
    ... > Hash: SHA1 ... > I'm looking for a way to copy a directory and all its content with perl; ... Why reinvent the wheel? ...
    (comp.lang.perl.misc)
  • Re: Theory of hash funcs
    ... I want to learn why they're more secure. ... I think you should re-invent the wheel. ... know what makes a hash good, you should have an easy time making a fine hash ... The hash function should be memory-less in the sense that presenting it ...
    (sci.crypt)
  • alter_key function for Hash
    ... Of course i am reinventing the wheel, but may be that would be helpful for ... With this method you can replace a key with a new one in a Hash. ... def alter_key ...
    (comp.lang.ruby)