Re: [Perl-unix-users] validating (restricting) hash values and keys

2006-03-02 Thread Anthony Ettinger
On 3/1/06, $Bill Luebkert <[EMAIL PROTECTED]> wrote: > listmail wrote: > > #!/usr/bin/perl -w > > use strict; > > use warnings; > > > > my %hash = ( "acc12", 1, > > "acc2", 0, > > "acc3", '', > > "una1", 1 ); > > > > $hash{acc3} = (); > > > > my $valid="acc

Re: [Perl-unix-users] validating (restricting) hash values and keys

2006-03-01 Thread $Bill Luebkert
listmail wrote: > #!/usr/bin/perl -w > use strict; > use warnings; > > my %hash = ( "acc12", 1, > "acc2", 0, > "acc3", '', > "una1", 1 ); > > $hash{acc3} = (); > > my $valid="acc1|acc2|acc3"; > > > > while (my ($key, $value) = each (%hash)) { >

[Perl-unix-users] validating (restricting) hash values and keys

2006-03-01 Thread listmail
#!/usr/bin/perl -w use strict; use warnings; my %hash = ( "acc12", 1, "acc2", 0, "acc3", '', "una1", 1 ); $hash{acc3} = (); my $valid="acc1|acc2|acc3"; while (my ($key, $value) = each (%hash)) { if ($key !~ $valid) { print