Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^2: Store regular expressions in a file.

by yoda54 (Monk)
on Nov 11, 2010 at 11:22 UTC ( #870823=note: print w/replies, xml ) Need Help??

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

So something like this? I don't get any output.


#!/usr/bin/perl use strict; use warnings; my $data = "duck"; my $r; while(<DATA>) { chomp; my ($x, $y) = split(/\s/, $_); $r->{$x} = qr/$y/; if ($data =~ $r->{"duck"}) { print "$data\n"; } } __DATA__ duck s/duck/luck/

Replies are listed 'Best First'.
Re^3: Store regular expressions in a file.
by cdarke (Prior) on Nov 12, 2010 at 08:29 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://870823]
[pryrt]: Is there a way to search for/list "nodes I've voted on"? (I thought there was, but cannot find it now)
[choroba]: Your votes in your profile?
[ambrus]: pryrt: yes, there is. link "Your votes" from your profile page.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2017-03-29 13:36 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (351 votes). Check out past polls.