Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Store regular expressions in a file.

by BrowserUk (Patriarch)
on Nov 11, 2010 at 12:13 UTC ( [id://870840]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Store regular expressions in a file.
in thread Store regular expressions in a file.

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

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://870840]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-26 01:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found