in reply to Re^2: How to replace '$' in strings
in thread How to replace '$' in strings
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, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to replace '$' in strings
by soonix (Chancellor) on Dec 15, 2015 at 09:33 UTC |