in reply to Re: Re: Re: Regular Expression Question
in thread What happens with empty $1 in regular expressions? (was: Regular Expression Question)

Indeed, that's true enough -- I was trying to make a more general statement but failed to sufficiently generalize away from the specific problem of resuing old $1 etc. The more general point being to check the success of an operation before doing things that depend on the operation having succeeded. Thus, even when doing a list assignment of subexpressions from a match, one will generally want to test that the match succeeded prior to using the results:

if(my ($first, $second) = $source =~ /blah(this)blah(that)blah/){ print "$first $second\n"; }