Daniel Falkenberg wrote:
> 
> Hi all,
> 
> %allusers = (
>              'users' => {
>                                             'user' => 'Test Account',
>                                             '*Crudles' => 'Hello World',
>                                             'Crud' => 'Another Test',
>                                             '*test' => 'Crud User'
>                                           }
>            );
> 
> Does any one know how I would go about deleing all hash keys with a star
> in them from the following hash?
> 
> Would I go something like the following....
> 
> #!/usr/bin/perl -w
> 
> %allusers = (
>               'users' => {
>                 'user' => 'Test Account',
>                 '*Crudles' => 'Hello World',
>                 'Crud' => 'Another Test',
>                 '*test' => 'Crud User'
>                          }
>             );
> 
> #Delete all hashs values with a * at the beginning of their value...
> 
> delete $allusers{$users}{$all_values} if ($all_values != /^\*/);


my @star_keys = grep /^\*/, keys %{$allusers{'users'}};

delete @{$allusers{'users'}}{@star_keys};



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to