
kencl
User
Mar 20, 2001, 3:37 PM
Post #1 of 2
(4140 views)
|
I don't use regular expressions much, so I just need someone to verify that this will work. It's supposed to create an array called @Matches which contain all the keys from a hash (%hash) where the lowercase letter "p" is the second last character of the hash key. Here's an example:
$hash{'44x5'} = "no match"; $hash{'3p3'} = "should match"; $hash{'789p'} = "no match"; $hash{'4P1'} = "no match"; $hash{'p1'} = "should match"; @Matches = grep { /p.$/ } keys(%hash);
Thanks. >> If you can't control it, improve it, correlate it or disseminate it with PERL, it doesn't exist!
|