Daniel Falkenberg wrote:
> ...
> which creates the hash...
> 
> %hash_ref (
>                 'Comment' => 'username',
>                 'Comment1' => 'username1',
>                 'Comment2' => 'username2'
>              );
> 
> 
> But the problem I am having is how would I go about telling my perl
> script to go and place replace the username of username to *username.
> 
What about:

while (my ($key, $value) = each %hash_ref) {
        $value = "*username" if $value eq "username";
}

Or (TMTWTDI):

%new_hash = map {$_ => ($hash_ref{$_} eq 'username' ? '*username' :
$hash_ref{$_})} %hash_ref;


Best Wishes,
Andrea

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

Reply via email to