Even simpler: use the special regex delimiter ' (single quote) to suppress interpolation:
#! perl use strict; use warnings; my $string = 'i am us$ing moni$ka expressi$on'; $string =~ s'\$'\$'g; print $string, "\n";
Output:
23:12 >perl 1483_SoPW.pl i am us\$ing moni\$ka expressi\$on 23:14 >
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re^3: How to replace '$' in strings
by Athanasius
in thread How to replace '$' in strings
by ravi45722
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |