RE: Wildcard matching of hash keys

2001-06-08 Thread erskine, michael
-Original Message- From: Martin Moss [mailto:[EMAIL PROTECTED]] Sent: 08 June 2001 15:15 To: [EMAIL PROTECTED] Subject: Wildcard matching of hash keys Has anybody done any work with wildcard matching of hash keys? along the lines of my $pattern=*red*; if

RE: Wildcard matching of hash keys

2001-06-08 Thread Martin Moss
First prize for a speedy response goes to Michael:-) The goldfish in a bag is on it's way to you! -Original Message- From: Martin Moss [mailto:[EMAIL PROTECTED]] Sent: 08 June 2001 15:15 To: [EMAIL PROTECTED] Subject: Wildcard matching of hash keys Has anybody done any

RE: Wildcard matching of hash keys

2001-06-08 Thread Rubinow, Larry
erskine, michael wrote: Has anybody done any work with wildcard matching of hash keys? along the lines of my $pattern=*red*; if (exists($hash{$pattern})) #I { print Key exists\n; } Ooh...ooh...let me!!! my @hits = grep /.*red.*/, keys( %hash ); la-la-la! first

RE: Wildcard matching of hash keys

2001-06-08 Thread erskine, michael
-Original Message- From: Rubinow, Larry [mailto:[EMAIL PROTECTED]] Sent: 08 June 2001 16:07 To: 'erskine, michael'; '[EMAIL PROTECTED]' Subject: RE: Wildcard matching of hash keys Well, sure ... but why not my @hits = grep /red/, keys( %hash ); Ouch! I was stumbling my

Re: Wildcard matching of hash keys

2001-06-08 Thread Ron Pero
At times I've thought it would be worthwhile to have a function called regexists, that would look like this: if ( regexists('cart','^302v') ) { print hello\n; } Better yet, like the exists function: if ( regexists $cart{/^302v/} ) { grep works just fine for this if (grep {/^305v/} keys