Re: Pattern matching to hash

2012-12-28 Thread timothy adigun
Hi, > my $prefix_search_list = '03S,04S'; > my @prefix_array = split /\,/,$prefix_search_list; > my %prefix_hash = map {$_ => 1 } @prefix_array; > > #compare 05S to 03S and 04S > my $input_field = "05S885858"; #should not match > 1. using stricts and warnings pragma, shows clearly that there i

Re: Pattern matching to hash

2012-12-28 Thread Chris Charley
Tim wrote in message news:1356726727.215915...@webmail.reagan.com... I hope this is a simple fix. I want to check the beginning characters of items in a hash, and compare that to a scalar variable. I do not need for the entire value to match; just the first couple of characters. Tim my $p

Re: Pattern matching to hash

2012-12-28 Thread timothy adigun
Hello Chris, Please see my comment below. On Fri, Dec 28, 2012 at 10:24 PM, Chris Charley wrote: > > > Tim wrote in message news:1356726727.215915216@**webmail.reagan.com... > > I hope this is a simple fix. I want to check the beginning characters of >> items in a hash, and compare that to a s

Re: Pattern matching to hash

2012-12-28 Thread Chris Charley
Chris Charley"" wrote in message news Tim wrote in message news:1356726727.215915...@webmail.reagan.com... I hope this is a simple fix. I want to check the beginning characters of items in a hash, and compare that to a scalar variable. I do not need for the entire value to match; just the

RE: Pattern matching to hash

2012-12-28 Thread Tim Lewis
@perl.org Subject: Re: Pattern matching to hash Hi, my $prefix_search_list = '03S,04S'; my @prefix_array = split /\,/,$prefix_search_list; my %prefix_hash = map {$_ => 1 } @prefix_array; #compare 05S to 03S and 04S my $input_field = "05S885858"; #should not match

RE: Pattern matching to hash

2012-12-28 Thread Tim Lewis
matching to hash Chris Charley"" wrote in message news >Tim wrote in message news:1356726727.215915...@webmail.reagan.com... >>I hope this is a simple fix. I want to check the beginning characters >>of items in a hash, and compare that to a scalar variable. >>I do n

Re: Pattern matching to hash

2012-12-28 Thread Chris Charley
"timothy adigun" wrote in message news:CAEWzkh6mZohVJn__LRL60AGoqbHkmTPyn=JM=cewcmmftpj...@mail.gmail.com... Hello Chris, Please see my comment below. On Fri, Dec 28, 2012 at 10:24 PM, Chris Charley wrote: [snip] I only answered the question using a for loop. Am not the one who origi

Re: Pattern matching to hash

2012-12-29 Thread Dr.Ruud
On 2012-12-28 21:32, twle...@reagan.com wrote: I hope this is a simple fix. I want to check the beginning characters of items in a hash, and compare that to a scalar variable. I do not need for the entire value to match; just the first couple of characters. Here is a simple example of what I