When testing a large Web application written in Perl, you should probably not have instances of Foo::Bar=HASH(0x8100664) in the Web source. If those are not visible (e.g., in hidden form elements or in option values), they can be tough bugs to track down. The following snippet will warn if they are detected. You may need to strengthen the regular expression, depending on your needs.
package WWW::Mechanize::NoRefs; use base 'WWW::Mechanize'; use Carp; sub content { my $self = shift; my $content = $self->SUPER::content; if ($content =~ /([\w=:]+\(0x[a-fA-F0-9]+\))/) { carp "Possible stringified reference ($1) found in content"; } return $content; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Detecting stringified references with WWW::Mechanize
by liz (Monsignor) on Jan 08, 2004 at 22:33 UTC | |
by borisz (Canon) on Jan 09, 2004 at 00:25 UTC | |
|
Re: Detecting stringified references with WWW::Mechanize
by Aristotle (Chancellor) on Jan 10, 2004 at 21:10 UTC |