perlimports

Detective Work with perlimports

published on
Today I was working on a test which uses Test::WWW::Mechanize. I was looking at the source of the text_contains method, which currently looks like: sub text_contains { my $self = shift; my $str = shift; my $desc = shift || qq{Text contains "$str"}; local $Test::Builder::Level = $Test::Builder::Level + 1; if ( ref($str) ) { return $TB->ok( 0, 'Test::WWW::Mechanize->text_contains called incorrectly. It requires a scalar, not a reference.' ); } return contains_string( $self->text, $str, $desc ); } I was interested in the return value, so I grepped the file for sub contains_string. Read More...