$ perl -Mre=debug -e " $_ = 1234; m/.$/ " Compiling REx ".$" Final program: 1: REG_ANY (2) 2: EOL (3) 3: END (0) anchored ""$ at 1 minlen 1 Matching REx ".$" against "1234" 3 <123> <4> | 1:REG_ANY(2) 4 <1234> <> | 2:EOL(3) 4 <1234> <> | 3:END(0) Match successful! Freeing REx: ".$" $ perl -Mre=debug -e " $_ = 1234; m'.$' " Compiling REx ".$" Final program: 1: REG_ANY (2) 2: EOL (3) 3: END (0) anchored ""$ at 1 minlen 1 Matching REx ".$" against "1234" 3 <123> <4> | 1:REG_ANY(2) 4 <1234> <> | 2:EOL(3) 4 <1234> <> | 3:END(0) Match successful! Freeing REx: ".$"