in reply to Detecting stringified references with WWW::Mechanize
package WWW::Mechanize::NoRefs; use base 'WWW::Mechanize'; my $rx = qr/( (?: [A-Za-z]\w* (?: :: [A-Za-z]\w* )* = )? (?: SCALAR | ARRAY | HASH | CODE | REF | GLOB | LVALUE ) \( 0x [a-fA-F0-9]+ \) )/x; sub content { my $self = shift; my $content = $self->SUPER::content; if ($content =~ $rx) { require Carp; Carp::carp("Possible stringified reference ($1) found in conte +nt"); } return $content; } 1;
Makeshifts last the longest.
|
|---|