Permalink
Browse files

clarify a ternary

  • Loading branch information...
1 parent ebbf1cf commit 5a5d353dad8ef6d937d7e005eff60776015c954b @petdance committed Apr 13, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 Mechanize.pm
View
@@ -1522,7 +1522,10 @@ sub scrape_text_by_attr {
while ( my $token = $parser->get_tag() ) {
if ( ref $token->[1] eq 'HASH' ) {
if ( exists $token->[1]->{$attr} ) {
- my $matched = (ref $value eq 'Regexp') ? $token->[1]->{$attr} =~ $value : $token->[1]->{$attr} eq $value;
+ my $matched =
+ (ref $value eq 'Regexp')
+ ? $token->[1]->{$attr} =~ $value
+ : $token->[1]->{$attr} eq $value;
if ( $matched ) {
my $tag = $token->[ 0 ];
push @results, $parser->get_trimmed_text( "/$tag" );

0 comments on commit 5a5d353

Please sign in to comment.