cat p.pl; echo ; perl -Dr p.pl printf "matched: %s\n" , ( 'x' =~ undef() ? 'yes' : 'no' ) ; Omitting $` $& $' support. EXECUTING... Compiling REx "" Final program: 1: NOTHING (2) 2: END (0) minlen 0 Matching REx "" against "x" 0 <> | 1:NOTHING(2) 0 <> | 2:END(0) Match successful! matched: yes Freeing REx: ""