in reply to Re: How to print the dollor sign.
in thread How to print the dollar sign.
As an explanation of why it works:
1. A string enclosed in '' will not be interpolated (ie. any variable names inside will stay what they are instead of being replaced by the value of the variable).
2. You can use backslashes to "escape" characters, ie. make them lose their special function.
Example:
my $var = "Testing 1 2 3"; my $no_interpolation = 'Var = $var'; # result: Var = $var my $interpolate = "Var = $var" # result: Var = Testing 1 2 3 my $escape = "Get lots of \$\$\$ by pressing Shift+4 many times \%-)"; # result: Get lots of $$$ by pressing Shift+4 many times %-) # (note: this money-making technique is designed for German keyboards +:) )
|
|---|