Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^21: Addional "year" matching functionality in word matching script

by Corion (Patriarch)
on Jul 12, 2016 at 16:59 UTC ( #1167632=note: print w/replies, xml ) Need Help??


in reply to Re^20: Addional "year" matching functionality in word matching script
in thread Addional "year" matching functionality in word matching script

The keys of %csv2hash are the lines:

for (@csv2) { # for data in @csv2 array my ($title) = $_ =~ /^.+?,\s*([^,]+?),/; $csv2hash{$_} = $title; }

Here, $_ (the current line) is used as a key into %csv2hash.

Replies are listed 'Best First'.
Re^22: Addional "year" matching functionality in word matching script
by bms9nmh (Novice) on Aug 03, 2016 at 15:40 UTC
    What does this bit of the script do?  my @matches   = ( $value=~/\b$word\b/ig ); specifically the  \b  \b/ig bits?
      See perlre for explanation.

      \b matches "word boundaries", but in a special meaning of "word". /i makes the matching case insensitive, and /g makes it global, i.e. it matches as many times as it can, and returns all the matching substrings.

      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
        Ok, i'm near the end of the script now. In this bit, I can see why the script prints out the line from $csv2, but I can't understand how it prints out the line from csv1. I can't see where it gets this information.
        if ($count >= $desired) { print "$csv2\n"; ++$matched; } } print "$_\n\n" if $matched;
        I can see the:
        print "$_\n\n" if $matched;
        bit somehow contains the information from csv1, but I can't see anything in the script which suggests why this would be?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2022-05-23 20:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (82 votes). Check out past polls.

    Notices?