Re: help with Hash of arrays of arrays

2015-07-02 Thread Илья Рассадин
Hi Nathalie. Please, next time create gist with updated code, and send link to it. Now your code is messy and its really hard to tell anything about it. One more comment - you mix variable with computerish names and with names from subject area. It's bad, you must always name your variables with

Re: help with Hash of arrays of arrays

2015-07-02 Thread Nathalie Conte
HI Shlomi, Thanks for your comments about best practise which I have implemented, Any ideas on why my hash of arrays of arrays is misbehaving? Thanks Nat On 1 Jul 2015, at 15:42, Shlomi Fish wrote: > Hi Nat, > > some comments about your code. > > On Wed, 1 Jul 2015 13:00:53 +0100 > nco...@ebi

Re: help with Hash of arrays of arrays

2015-07-01 Thread Shlomi Fish
Hi Nat, some comments about your code. On Wed, 1 Jul 2015 13:00:53 +0100 nco...@ebi.ac.uk wrote: > Hi, > I need some help with a hash of array of array. > this is my input data structure: > gene aal1 data1 data2 data9 > gene bal2 data3 data4 data10 > gene b

help with Hash of arrays of arrays

2015-07-01 Thread nconte
Hi, I need some help with a hash of array of array. this is my input data structure: gene a al1 data1 data2 data9 gene b al2 data3 data4 data10 gene b al3 data5 data6 data12 gene b al4 data7 data8 data12 I take each data variable, see above, from a sql query and

Re: Help with hash of dates

2005-08-08 Thread Kevin Old
On 8/8/05, Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> wrote: > On Aug 8, Kevin Old said: > > > I'm trying to come up with a way to automatically create a hash like > > the following: > > > > It's a hash with the start and end date for each week with the start > > date being Sunday and the end date be

Re: Help with hash of dates

2005-08-08 Thread Jeff 'japhy' Pinyan
On Aug 8, Kevin Old said: I'm trying to come up with a way to automatically create a hash like the following: It's a hash with the start and end date for each week with the start date being Sunday and the end date being the following Saturday. You can use localtime() and the Time::Local modul

Help with hash of dates

2005-08-08 Thread Kevin Old
Hello everyone, I'm trying to come up with a way to automatically create a hash like the following: use Tie::IxHash; tie my %pairs, "Tie::IxHash"; %pairs = ( '1' => { 'start' => '04/24/05', 'end' => '04/30/05' }, '2

RE: Help with hash refs

2004-07-27 Thread Brian Ling
Brian Ling; [EMAIL PROTECTED] Subject: RE: Help with hash refs Brian Ling wrote: > my $test1 = ${refer}->{value}->{fred}; > print Dumper($refer); > # this doesn't change the data as i'd expect > > my $test2 = ${refer}->{value}->{fred}->{value}; > print

RE: Help with hash refs

2004-07-27 Thread Charles K. Clarkson
Brian Ling wrote: > my $test1 = ${refer}->{value}->{fred}; > print Dumper($refer); > # this doesn't change the data as i'd expect > > my $test2 = ${refer}->{value}->{fred}->{value}; > print Dumper($refer); > # this actually creates a key 'fred' pointing > # to a empty hash ref #I > > So my quest

Help with hash refs

2004-07-27 Thread Brian Ling
Hi all, I seem to have completely confused myself with a data structure, as testing for a keys existence seems to create an anonymous hash ref. The following is a very cut down version of my code, to try and explore what's going on. #!/usr/bin/perl use warnings; use strict; use Data::Dumper; my

Re: Help with HASH.

2004-07-05 Thread Rod Za
Hey John, Thank you very much for the hints. --- "John W. Krahn" <[EMAIL PROTECTED]> wrote: [snipped] > sub lst_job { > my $printer = shift; > my $flag; > return name => $printer, jobs => { > map +( $flag = !$flag ) ? sprintf( 'd%05d-001', $_ ) : $_, > map /^\w+-(\d+)

Re: Help with HASH.

2004-07-02 Thread Randy W. Sims
John W. Krahn wrote: On Friday 02 July 2004 15:07, Randy W. Sims wrote: Wiggins d Anconia wrote: You can take the list in a scalar context, or force it into a scalar context, such as, my $num = keys %{ $printers{jobs} }; or the more verbose, my $num = scalar keys %{ $printers{jobs} }; 'values' work

Re: Help with HASH.

2004-07-02 Thread John W . Krahn
On Friday 02 July 2004 15:07, Randy W. Sims wrote: > Wiggins d Anconia wrote: > > > > You can take the list in a scalar context, or force it into a > > scalar context, such as, > > > > my $num = keys %{ $printers{jobs} }; > > > > or the more verbose, > > > > my $num = scalar keys %{ $printers{jobs}

Re: Help with HASH.

2004-07-02 Thread Randy W. Sims
Wiggins d Anconia wrote: Wiggins, just one more thing, how can i get the number of elements from an hash like this one that i'm trying to use? foreach my $keys (keys %{ $printers{jobs} }) { You can take the list in a scalar context, or force it into a scalar context, such as, my $num = keys %{ $p

Re: Help with HASH.

2004-07-02 Thread John W . Krahn
On Friday 02 July 2004 12:05, Rod Za wrote: > > Hello all, Hello, > I want to make a function to list all jobs name from a printer. > The format of the jobs name is like d1-001, d2-001. > To list all the jobs and get the correct job name, i use the lpstat > command, that returns me lines

Re: Help with HASH.

2004-07-02 Thread Wiggins d Anconia
> Wiggins, > > just one more thing, how can i get the number of elements from an hash like this one that i'm > trying to use? > > > > > > foreach my $keys (keys %{ $printers{jobs} }) { You can take the list in a scalar context, or force it into a scalar context, such as, my $num = keys %{ $prin

Re: Help with HASH.

2004-07-02 Thread Rod Za
Wiggins, just one more thing, how can i get the number of elements from an hash like this one that i'm trying to use? --- Wiggins d Anconia <[EMAIL PROTECTED]> wrote: > > > > foreach my $keys (keys %{ $printers{jobs} }) { __ Do you Yahoo!? New

Re: Help with HASH.

2004-07-02 Thread Rod Za
--- Wiggins d Anconia <[EMAIL PROTECTED]> wrote: > > You only have to dereference if you are trying to do something to the > > structure in aggregate, aka you have to supply a hash, such as is the > > case for 'keys', 'values', and 'each'. If you want to access a single > > value from the nested h

Re: Help with HASH.

2004-07-02 Thread Wiggins d Anconia
> > > > --- Wiggins d Anconia <[EMAIL PROTECTED]> wrote: > > [snip] > > [snip] > > > In the above line, as the error suggests 'keys' must take a hash as its > > > argument, $printers{jobs} is a scalar, so essentially you need to > > > dereference its value back into a hash, ending up with, > > >

Re: Help with HASH.

2004-07-02 Thread Wiggins d Anconia
> > --- Wiggins d Anconia <[EMAIL PROTECTED]> wrote: > [snip] > [snip] > > In the above line, as the error suggests 'keys' must take a hash as its > > argument, $printers{jobs} is a scalar, so essentially you need to > > dereference its value back into a hash, ending up with, > > > > foreach my $

Re: Help with HASH.

2004-07-02 Thread Rod Za
--- Wiggins d Anconia <[EMAIL PROTECTED]> wrote: [snip] > > _BEGIN_ > > #!/usr/bin/perl > > use warnings; > > use strict; > > Excellent start... :) thank you [snip] > > for(my $i=0; $i < @lpstat; $i++){ > > $lpstat[$i] =~ /\w+\-(\d+)\s+(\w+)\s+/; > > $job

Re: Help with HASH.

2004-07-02 Thread Wiggins d Anconia
> Hello all, > > I want to make a function to list all jobs name from a printer. > The format of the jobs name is like d1-001, d2-001. > To list all the jobs and get the correct job name, i use the lpstat command, that returns me lines > like this one: > _DATA_ > HP4100V-4 r

Help with HASH.

2004-07-02 Thread Rod Za
Hello all, I want to make a function to list all jobs name from a printer. The format of the jobs name is like d1-001, d2-001. To list all the jobs and get the correct job name, i use the lpstat command, that returns me lines like this one: _DATA_ HP4100V-4 rodza 2

Re: Help with Hash values and variable interpolation

2002-11-08 Thread badchoice
> 112.58.26.32.32770 > 192.35.51.30.53: 64596[|domain] (DF) > 112.58.26.32.32770 > 192.100.59.110.53: 24685 [1au][|domain] (DF) > 112.58.26.4.2506 > 216.148.227.69.80: . ack 3280436924 win 2920 (DF) > 112.58.26.4.2506 > 216.148.227.69.80: . ack 1759 win 1162 (DF) > 112.58.26.4.2498 > 66.207.130.

Re: Help with Hash values and variable interpolation

2002-11-04 Thread John W. Krahn
Joshua Scott wrote: > > Hello all, Hello, > I've got a file which contains ports and hostnames. I'd like to count the > number of instances that each item occurs in my file. I'm having a > difficult time with this. > > This is my script: Basically I'm splitting the first line a few times to

RE: Help with Hash values and variable interpolation

2002-11-04 Thread Scott, Joshua
oshua [mailto:Joshua.Scott@;Jacobs.com] Sent: Monday, November 04, 2002 5:42 PM To: '[EMAIL PROTECTED]' Subject: Help with Hash values and variable interpolation Hello all, I've got a file which contains ports and hostnames. I'd like to count the number of instances that ea

Help with Hash values and variable interpolation

2002-11-04 Thread Scott, Joshua
Hello all, I've got a file which contains ports and hostnames. I'd like to count the number of instances that each item occurs in my file. I'm having a difficult time with this. This is my script: Basically I'm splitting the first line a few times to get the data I need. What am I doing wro

Help with Hash Arrays

2002-10-14 Thread Vincent Lee
Can someone help me with this? I have a query in a database that queries the columns from the SYSCAT.COLUMNS table of either Oracle or DB2. I want to be able to print the columns in a string as follows: Col1, col2, col3...etc. depending on the table. How would I do this? = Regards, Vinc