Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Counting the Times Two Unknown Values Appear Together

by wind (Priest)
on Jul 15, 2007 at 03:52 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://626688]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (9)
As of 2024-04-18 13:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found