sch has asked for the wisdom of the Perl Monks concerning the following question:
If I try and use the following piece of code:
#!/usr/bin/perl -w use strict; use diagnostics; use Tie::RegexpHash; my $rehash = Tie::RegexpHash->new(); $rehash->add( qr/abc/, "abc" ); $rehash->add( qr/def/, "def" );
I get the following warning:
Use of uninitialized value in string ne at /usr/local/lib/perl5/site_perl/5.8.0/Tie/RegexpHash.pm line 58 + (#1) (W uninitialized) An undefined value was used as if it were alread +y defined. It was interpreted as a "" or a 0, but maybe it was a mi +stake. To suppress this warning assign a defined value to your variables. To help you figure out what was undefined, perl tells you what ope +ration you used the undefined value in. Note, however, that perl optimiz +es your program and the operation displayed in the warning may not necessa +rily appear literally in your program. For example, "that $foo" is usually optimized into "that " . $foo, and the warning will refer +to the concatenation (.) operator, even though there is no . in your program.
Can anyone suggest what might be happening?
Thanks
Edit by tye to remove "cpan://" as noted by author
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with Tie::RegexpHash
by jsprat (Curate) on Oct 10, 2002 at 18:14 UTC | |
by robartes (Priest) on Oct 10, 2002 at 18:27 UTC | |
|
Re: Problem with Tie::RegexpHash
by Mr. Muskrat (Canon) on Oct 10, 2002 at 16:58 UTC | |
by sch (Pilgrim) on Oct 10, 2002 at 17:04 UTC | |
|
Re: Problem with Tie::RegexpHash
by Mr. Muskrat (Canon) on Oct 10, 2002 at 17:12 UTC | |
by sch (Pilgrim) on Oct 10, 2002 at 17:20 UTC | |
by Mr. Muskrat (Canon) on Oct 10, 2002 at 17:32 UTC | |
by sch (Pilgrim) on Oct 10, 2002 at 17:36 UTC | |
by sch (Pilgrim) on Oct 10, 2002 at 18:43 UTC | |
|
Re: Problem with Tie::RegexpHash
by jryan (Vicar) on Oct 10, 2002 at 17:23 UTC | |
by Mr. Muskrat (Canon) on Oct 10, 2002 at 17:28 UTC | |
by sch (Pilgrim) on Oct 10, 2002 at 17:33 UTC |