in reply to Re^10: Addional "year" matching functionality in word matching script
in thread Addional "year" matching functionality in word matching script
%csv2hash is a hash.
The programmer is loading the record into the key of the hash, %csv2hash. The value of the hash is the title.
The test program below demonstrates just that small task for one record. The programmer (i.e., the programmer that wrote this program originally) populates %csv2hash with all of the records in the file named csv2.
#!/usr/bin/perl # csv2hash.pl perl csv2hash.pl A test program. # From http://www.perlmonks.org/?node_id=1166649 use strict; use warnings; my %csv2hash = (); + my $record = q[12278788, TV & SATELLITE WEEK 11 MAY 2013 GILLIAN ANDER +SON DOCTOR WHO NOT RADIO TIMES , http://www.example.co.uk, 12]; $_ = $record; my ($title) = $_ =~ /^.+?,\s*([^,]+?),/; #/ match the title + $csv2hash{$_} = $title; use Data::Dumper; print Dumper(%csv2hash); __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^12: Addional "year" matching functionality in word matching script
by bms9nmh (Novice) on Jun 28, 2016 at 16:47 UTC | |
by Cow1337killr (Monk) on Jun 28, 2016 at 20:36 UTC | |
by bms9nmh (Novice) on Jun 30, 2016 at 15:15 UTC | |
by Cow1337killr (Monk) on Jul 01, 2016 at 02:30 UTC | |
by bms9nmh (Novice) on Jul 01, 2016 at 14:20 UTC | |
|