Perl Monk, Perl Meditation | |
PerlMonks |
Re: $` $' in bash??by JavaFan (Canon) |
on Jul 20, 2011 at 20:16 UTC ( [id://915739]=note: print w/replies, xml ) | Need Help?? |
Using a standard trick to include a single quote:
The single quote directly following the $ matches the first single quote. In Perl, this will end a string, but not so in the shell - here single quotes act like \Q/\E in Perl. Directly following the $ and the single quote is "'", which for the shell is just a single quote. Which makes that the Perl program ends in $', as intended.
In Section
Seekers of Perl Wisdom
|
|