3 # 1. Get a search list from farnell and feed HTML source to
4 # this script with no args. Will produce part number list.
5 # 2. Feed one or more outputs from farnell-find describe <item> to
6 # this script with args <mfprefix> <valueprefix>...
7 # where <mfprefix> is the re for the first part of the mfr
8 # code and <valueprefix> is the words of the part name prefix.
10 ($kind,@prefix)= @ARGV;
20 m/^Description\s+\[$kind (\d[0-9MKR]+)(?:\s[0-9.]+\%)?\]\s+RESISTOR/) {
22 } elsif (m/^Description\s+(\S.*)/) {
25 } elsif (m/^Item\s+([-0-9]+)$/) {
26 die unless defined $value;
27 next unless length $value;
29 die if exists $v2i{$value} and $v2i{$value} ne $1;
35 foreach $mkr (qw(m k r)) {
36 $z= ($a =~ m/$mkr/) <=> ($b =~ m/$mkr/);
39 return insdot($a) <=> insdot($b);
42 printf "%s =\t%s\n", join(' ',@prefix,$v), $v2i{$v};
46 if (m/viewproductdetails.*\?prodId\=(\d{3})(\d{3,7})\"/) {
47 print "$1-$2\n" or die $!;