Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: reg reggular expressions

by kielstirling (Scribe)
on Feb 09, 2012 at 07:12 UTC ( #952668=note: print w/ replies, xml ) Need Help??


in reply to Re^2: reg reggular expressions
in thread reg reggular expressions

Hi,

I would use a hash..

#!/usr/bin/perl -w use strict; my @files = ( "mmu-miR-16-1-3p 8", "mmu-miR-1-1-3p 8", "mmu-miR-500", "mmu-miR-16-1-3p 8" ); my %pattern_count; map $pattern_count{$_}++, @files; print "filename $_ patten count $pattern_count{$_}\n" for keys %pattern_count;


Comment on Re^3: reg reggular expressions
Download Code
Re^4: reg reggular expressions
by Anonymous Monk on Feb 09, 2012 at 07:37 UTC

    ya this seems to be a better option. however i cant give each pattern individually in quotes so i ll make it read from a file. thank you.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2014-12-28 03:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (178 votes), past polls