Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: string match using with an N in any position

by jwkrahn (Monsignor)
on Nov 18, 2011 at 02:57 UTC ( #938729=note: print w/replies, xml ) Need Help??

in reply to string match using with an N in any position

You could probably do something like this:

# reading in each query string (file1) into an array my @barcode; while ( my $line1 = <INP1> ) { chomp $line1; my @temp = ( $line1, ( $line1 ) x length $line1 ); substr $temp[ $_ ], $_, 1, 'N' for 0 .. $#temp - 1; local $" = '|'; push @barcode, [ $line1, qr/@temp/ ]; } for my $code ( @barcode ) { my $filename = $code->[ 0 ]; open OUT, '>', $filename or die "Cannot open '$filename' because: +$!"; # I have stored each of the query strings in a hash. # The value of the hash contains the target strings. # The keys are 1,2,3... for my $value ( values %idhash ) { if ( $value =~ /^$code->[1]/ ) { # where the query string matches the target # string print value of the hash print "$value\n"; } } }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://938729]
[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.
[ambrus]: (That link work two ways: from your own profile page, it lists all your votes; from anyone else's profile page, it lists your votes on that user's nodes only.)
[choroba]: Wow, and I can create an interesting statistics from it
[LanX]: I've also added a link "my votes" to the personal nodelet
[pryrt]: Thanks, that was what I was looking for

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.