http://www.perlmonks.org?node_id=874388


in reply to Re: Re: Seeking a good punchline
in thread Seeking a good punchline

If there was no match, $1 will be whatever if was before. Which actually *may* be defined:
$ perl -wE '"foo" =~ /(.)/; "bar" =~ /f(o)o/ or say $1' f