Re: anonymous hash slices

2010-02-24 Thread Uri Guttman
> "BRH" == Bryan R Harris writes: BRH> Just as an academic exercise, I thought I should be able to do this: BRH> ** BRH> @a=(l=>35,k=>31,r=>7,k=>6); BRH> @r=qw/l r r k/; try to use some white space in your code. even in short examples it helps.

anonymous hash slices

2010-02-24 Thread Bryan R Harris
Just as an academic exercise, I thought I should be able to do this: ** @a=(l=>35,k=>31,r=>7,k=>6); @r=qw/l r r k/; # make an anonymous hash using @a, then grab values from it using @r as keys @a...@a}{@r}; print join(",",@a), "\n"' ***

Re: hash slices

2006-09-28 Thread Rob Dixon
ORDER BY is pointless with selectall_hashref, as hashes are unordered. > So I'm still confused about what I need to do. I want to: > > 1. display the rows with ifFollowedProtocol eq '' or 'yes' in order of > medCategory > 2. display the rows with ifFollowed

Re: hash slices

2006-09-28 Thread John W. Krahn
Gerald Host wrote: > I'm using DBI's selectall_hashref with 5 key columns. I want to display > each row where key col 1 is 'yes' or NULL (undef or '' ?) > > > foreach my $medCategory (keys %{$href->{'yes'}->{qw('' 'yes')}->{qw('' > 'yes')}}) { > foreach my $med (keys %{$href->{qw('yes')}->{

Re: hash slices

2006-09-28 Thread Gerald Host
)); So I'm still confused about what I need to do. I want to: 1. display the rows with ifFollowedProtocol eq '' or 'yes' in order of medCategory 2. display the rows with ifFollowedProtocol eq '' or 'no' in order of medCategory I thought I could do

Re: hash slices

2006-09-28 Thread Rob Dixon
Gerald Host wrote: > > I'm using DBI's selectall_hashref with 5 key columns. I want to display > each row where key col 1 is 'yes' or NULL (undef or '' ?) > > > foreach my $medCategory (keys %{$href->{'yes'}->{qw('' 'yes')}->{qw('' 'yes')}}) { > foreach my $med (keys %{$href->{qw('yes')}->{qw(

hash slices

2006-09-28 Thread Gerald Host
I'm using DBI's selectall_hashref with 5 key columns. I want to display each row where key col 1 is 'yes' or NULL (undef or '' ?) foreach my $medCategory (keys %{$href->{'yes'}->{qw('' 'yes')}->{qw('' 'yes')}}) { foreach my $med (keys %{$href->{

Re: Need help on Hash Slices. !!

2003-09-23 Thread David Storrs
On Tue, Sep 23, 2003 at 08:49:11PM +0530, Pandey Rajeev-A19514 wrote: > Hi, > > I have a list like > > @list = ( "key1: Vlan1 :0989\n" > "key2: Vlan2 :0989\n" > "key3: Vlan3 :0989\n" > "key4: Vlan4 :0989\n"); > > I wanted to make a hash with keys as key1, key2 , key3, key4. >

RE: Need help on Hash Slices. !!

2003-09-23 Thread Bob Showalter
akes all the elements in the list as the key. > > Regards > Rajeev I'm sorry, I don't see what any of this has to do with what you originally posted. Perhaps we need to start over. > > -Original Message- > From: Bob Showalter [mailto:[EMAIL PROTECTED] > Sent: Tuesday, Sep

RE: Need help on Hash Slices. !!

2003-09-23 Thread Dan Muey
> Hi, Howdy > > I have a list like > > @list = ( "key1: Vlan1 :0989\n" > "key2: Vlan2 :0989\n" > "key3: Vlan3 :0989\n" > "key4: Vlan4 :0989\n"); > > I wanted to make a hash with keys as key1, key2 , key3, key4. > Soemthing like this perhaps? ++UNTESTED++ my %hsh; for(@lis

RE: Need help on Hash Slices. !!

2003-09-23 Thread Pandey Rajeev-A19514
s/CAT/ => SERVER_NAME => sunomcr sunomcr => TEST_CASE_OUTPUT_PATH => ../testlogs/ ../testlogs/ => It seems it takes all the elements in the list as the key. Regards Rajeev -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 8:56 PM

RE: Need help on Hash Slices. !!

2003-09-23 Thread Bob Showalter
Pandey Rajeev-A19514 wrote: > Hi, > > I have a list like > > @list = ( "key1: Vlan1 :0989\n" > "key2: Vlan2 :0989\n" > "key3: Vlan3 :0989\n" > "key4: Vlan4 :0989\n"); > > I wanted to make a hash with keys as key1, key2 , key3, key4. > > I want to write something like this : >

Need help on Hash Slices. !!

2003-09-23 Thread Pandey Rajeev-A19514
Hi, I have a list like @list = ( "key1: Vlan1 :0989\n" "key2: Vlan2 :0989\n" "key3: Vlan3 :0989\n" "key4: Vlan4 :0989\n"); I wanted to make a hash with keys as key1, key2 , key3, key4. I want to write something like this : **