Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Counting the Times Two Unknown Values Appear Together

by wind (Priest)
on Jul 15, 2007 at 03:52 UTC ( #626688=note: print w/replies, xml ) Need Help??


in reply to Counting the Times Two Unknown Values Appear Together

There's nothing stopping you from using a regular expression. As long as you escape the meta characters, $variables will work just in a regex.
my $count = 0; while (<FILE>){ $count++ if /\Q$src/ && /\Q$sport/; } print "Both found a total of $count times\n";
- Miller

Update: (03:58 UTC) Ahh, misunderstand "beforehand". I second that kyle's reply is the way to go.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2019-02-15 21:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I use postfix dereferencing ...









    Results (95 votes). Check out past polls.

    Notices?