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;
In reply to Detecting stringified references with WWW::Mechanize by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |