if( not eval { $mech->get( $imgsrc ); 1 } ){ ... }