This also works:
#!/usr/bin/perl use strict; use warnings; my $data = "duck"; while(<DATA>) { chomp; my( $find, $replace ) = split ' ', $_, 2; if( $data =~ s[\Q$find][$replace]e ) { print "$data\n"; } } __DATA__ duck luck
In reply to Re^3: Store regular expressions in a file.
by BrowserUk
in thread Store regular expressions in a file.
by yoda54
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |