Re: List::MoreUtils with array of arrays not working

2014-07-10 Thread Jim Gibson
On Jul 10, 2014, at 11:50 AM, Natxo Asenjo wrote: > On Thu, Jul 10, 2014 at 1:00 AM, Jim Gibson wrote: > > On Jul 9, 2014, at 2:58 PM, Natxo Asenjo wrote: > > On Wed, Jul 9, 2014 at 10:35 PM, Jim Gibson wrote: > > On Jul 9, 2014, at 1:20 PM, Natxo Asenjo wrote: > > In order to use the hash m

Re: List::MoreUtils with array of arrays not working

2014-07-10 Thread Natxo Asenjo
On Thu, Jul 10, 2014 at 1:00 AM, Jim Gibson wrote: > > On Jul 9, 2014, at 2:58 PM, Natxo Asenjo wrote: > > On Wed, Jul 9, 2014 at 10:35 PM, Jim Gibson > wrote: > > On Jul 9, 2014, at 1:20 PM, Natxo Asenjo wrote: > > In order to use the hash method of determining uniqueness, you must > convert

Re: List::MoreUtils with array of arrays not working

2014-07-09 Thread Jim Gibson
On Jul 9, 2014, at 2:58 PM, Natxo Asenjo wrote: > > > > On Wed, Jul 9, 2014 at 10:35 PM, Jim Gibson wrote: > > On Jul 9, 2014, at 1:20 PM, Natxo Asenjo wrote: > > > hi, > > > > i have an array of arrays which contains equal elements. I would like to

Re: List::MoreUtils with array of arrays not working

2014-07-09 Thread Natxo Asenjo
On Wed, Jul 9, 2014 at 10:35 PM, Jim Gibson wrote: > > On Jul 9, 2014, at 1:20 PM, Natxo Asenjo wrote: > > > hi, > > > > i have an array of arrays which contains equal elements. I would like to > isolate the unique values. > > Do you mean that the subarra

Re: List::MoreUtils with array of arrays not working

2014-07-09 Thread Jim Gibson
On Jul 9, 2014, at 1:20 PM, Natxo Asenjo wrote: > hi, > > i have an array of arrays which contains equal elements. I would like to > isolate the unique values. Do you mean that the subarrays contain equal NUMBERS of elements? > > I have tried using the uniq method of List

List::MoreUtils with array of arrays not working

2014-07-09 Thread Natxo Asenjo
hi, i have an array of arrays which contains equal elements. I would like to isolate the unique values. I have tried using the uniq method of List::MoreUtils but it apparently does not work with an AoA. This is what I tried: for my $i ( @$data_ref ) { push $seen_ref, [ $i->{'valu

Re: grep array of arrays

2012-08-24 Thread Brandon McCaig
On Thu, Aug 23, 2012 at 05:19:34PM -0400, Shawn H Corey wrote: > You're trying to do too much in one statement. > > for my $coord ( @coords ){ > if( $coords->[0] >= 0 ){ > print join( q{, }, @{ $coords } ), "\n"; > } > } Looks like you're trying to do too much too. ;) You are test

Re: grep array of arrays

2012-08-23 Thread Shawn H Corey
On Thu, 23 Aug 2012 14:17:26 -0700 Jim Gibson wrote: > You could also combine print, grep, and map to accomplish the same > thing. Please don't. If you're having this much trouble getting it right, the person stuck with maintaining it will also have trouble understanding what you coded. Break it

Re: grep array of arrays

2012-08-23 Thread Shawn H Corey
On Thu, 23 Aug 2012 15:58:43 -0500 Chris Stinemetz wrote: > print grep { $_->[0] >= 0 } @coords; You're trying to do too much in one statement. for my $coord ( @coords ){ if( $coords->[0] >= 0 ){ print join( q{, }, @{ $coords } ), "\n"; } } -- Just my 0.0002 million dolla

Re: grep array of arrays

2012-08-23 Thread Jim Gibson
On Aug 23, 2012, at 1:58 PM, Chris Stinemetz wrote: >> >> >> If @coords is just an Array of Arrays then that should be: >> >> print grep { $_->[0] >= 0 } @coords; >> >> >> Your example thinks @coords is an Array of Arrays of Arrays. &g

Re: grep array of arrays

2012-08-23 Thread Chris Stinemetz
> > > If @coords is just an Array of Arrays then that should be: > > print grep { $_->[0] >= 0 } @coords; > > > Your example thinks @coords is an Array of Arrays of Arrays. > > > John > -- > print grep { $_->[0] >= 0 } @coords; Just prints the m

Re: grep array of arrays

2012-08-23 Thread Jim Gibson
On Aug 23, 2012, at 12:57 PM, Chris Stinemetz wrote: > Hello List, > I'm trying to grep an array of arrays, but I am getting the following error: > > Can't use string ("1") as an ARRAY ref while "strict refs" in use at > form.pl line 121, <

Re: grep array of arrays

2012-08-23 Thread John W. Krahn
Chris Stinemetz wrote: Hello List, Hello, I'm trying to grep an array of arrays, but I am getting the following error: Can't use string ("1") as an ARRAY ref while "strict refs" in use at form.pl line 121,<$COORDS> line 1281. Press any key to continue

grep array of arrays

2012-08-23 Thread Chris Stinemetz
Hello List, I'm trying to grep an array of arrays, but I am getting the following error: Can't use string ("1") as an ARRAY ref while "strict refs" in use at form.pl line 121, <$COORDS> line 1281. Press any key to continue . . . Below is the grep stat

XS array of arrays

2008-09-02 Thread Patrick Dupre
Hello, I wanted to return an array of arrays from c to perl. I build up my arrays by unisng av_push, but then ? I cannot av_push a AV*, so should I make a newSV and filled it by casting, or should I make a newRV with the AV* (after casting) and push it ? Thank

Re: Looping through an anonymous array of arrays

2008-06-10 Thread Rob Dixon
Rodrick Brown wrote: > > my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', ["Hello"] ]]; > > I have no problem returning single elements but how would one walk this list > of elements with say a for loop? use strict; use warnings; my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', ["Hello"] ]]; my @flat = $arra

Re: Looping through an anonymous array of arrays

2008-06-08 Thread Randal L. Schwartz
> "(Randal" == (Randal L Schwartz) <[EMAIL PROTECTED]> writes: (Randal> my @items = @$arrayRef; (Randal> while (@items) { (Randal> if (ref $items[0]) { (Randal> if (ref $items[0] eq "ARRAY") { (Randal> unshift @items, @{shift @items}; # replace arrayref with co

Re: Looping through an anonymous array of arrays

2008-06-08 Thread Randal L. Schwartz
> "Aruna" == Aruna Goke <[EMAIL PROTECTED]> writes: Aruna> for my $item (@$arrayRef){ Aruna> print $item unless ref($item) eq 'ARRAY'; Aruna> if(ref($item) eq 'ARRAY'){ Aruna>for my $item1(@$item){ Aruna>print $item1 unless ref($item1) eq 'ARRAY'; Aruna> { Arun

Re: Looping through an anonymous array of arrays

2008-06-08 Thread Dr.Ruud
"Rodrick Brown" schreef: > my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', ["Hello"] ]]; > > I have no problem returning single elements but how would one walk > this list of elements with say a for loop? Start writing it differently, maybe like: my $data = [ 1, 2, 3, [ 'a',

Re: Looping through an anonymous array of arrays

2008-06-07 Thread Aruna Goke
Gunnar Hjalmarsson wrote: Rodrick Brown wrote: my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', ["Hello"] ]]; I have no problem returning single elements but how would one walk this list of elements with say a for loop? One way: my $level = 0; breakdown( $arrayRef ); sub breakdown {

Re: Looping through an anonymous array of arrays

2008-06-06 Thread Gunnar Hjalmarsson
Rodrick Brown wrote: my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', ["Hello"] ]]; I have no problem returning single elements but how would one walk this list of elements with say a for loop? One way: my $level = 0; breakdown( $arrayRef ); sub breakdown { my $ref = shift;

Re: Looping through an anonymous array of arrays

2008-06-06 Thread Chas. Owens
On Fri, Jun 6, 2008 at 9:31 PM, Rodrick Brown <[EMAIL PROTECTED]> wrote: > my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', ["Hello"] ]]; > > I have no problem returning single elements but how would one walk this list > of elements with say a for loop? > You can treat an array reference like an array by

Re: Looping through an anonymous array of arrays

2008-06-06 Thread Jeff Peng
On Sat, Jun 7, 2008 at 9:31 AM, Rodrick Brown <[EMAIL PROTECTED]> wrote: > my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', ["Hello"] ]]; > > I have no problem returning single elements but how would one walk this list > of elements with say a for loop? > Try this code: use strict; my $arrayRef = [ 1,

Looping through an anonymous array of arrays

2008-06-06 Thread Rodrick Brown
my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', ["Hello"] ]]; I have no problem returning single elements but how would one walk this list of elements with say a for loop?

Re: Sorting an Array of Arrays

2007-03-14 Thread Randal L. Schwartz
> ""Mumia" == "Mumia W " writes: "Mumia> On 03/13/2007 07:44 PM, Hardly Armchair wrote: >> Hello List, >> I have a data structure containing a bunch of strings in different groups: >> [...] >> I want these sorted first alphabetically within the group, and then >> according to the number of me

Re: Sorting an Array of Arrays

2007-03-13 Thread Mumia W.
On 03/13/2007 07:44 PM, Hardly Armchair wrote: Hello List, I have a data structure containing a bunch of strings in different groups: [...] I want these sorted first alphabetically within the group, and then according to the number of member in the group. [...] This is slightly more compact

Re: Sorting an Array of Arrays

2007-03-13 Thread John W. Krahn
Hardly Armchair wrote: > Hello List, Hello, > I have a data structure containing a bunch of strings in different groups: > > $groups = [ > [ > 'SSPDQR', > 'SSPSDR', > 'STSSER', > ], > [ > 'CSANLH', >

Sorting an Array of Arrays

2007-03-13 Thread Hardly Armchair
Hello List, I have a data structure containing a bunch of strings in different groups: $groups = [ [ 'SSPDQR', 'SSPSDR', 'STSSER', ], [ 'CSANLH', 'CVANRD', ], [...],

Re: Average from array of arrays

2006-04-22 Thread John W. Krahn
The Other1 wrote: > Hi John, Hello, > Thank you so much for the code you posted, it works great and is pretty > elegant. If you have a second, could you explain this line to me? > > if ( $row->[ $column ] =~ /^[\d.+-]+$/ ) { > > And this one as well: > if ( $column =~ /^[\d.+-]+$/ ) {

Re: Average from array of arrays

2006-04-21 Thread John W. Krahn
The Other1 wrote: > Hi all, Hello, > Sorta newbie here... > > I have parsed log files and have an array of arrays that looks like this: > > [...] > 1 0.0 0.000 31.954 36.169 12.645 20:40 > 16 1048.0 16.196 15.825 52.502 5.150 20:40 > 8 1281.7 12.059 9.634 41.264 4.

Re: Average from array of arrays

2006-04-21 Thread Mr. Shawn H. Corey
On Thu, 2006-20-04 at 20:55 -0600, The Other1 wrote: > My question is how to walk through the array grabbing column 1 of four rows, > pass those values to the Average function (or if there is a beter way, I am > open to it!), store the average to be used by GD later, then do the next > column, e

Average from array of arrays

2006-04-21 Thread The Other1
Hi all, Sorta newbie here... I have parsed log files and have an array of arrays that looks like this: [...] 1 0.0 0.000 31.954 36.169 12.645 20:40 16 1048.0 16.196 15.825 52.502 5.150 20:40 8 1281.7 12.059 9.634 41.264 4.869 20:40 9 1157.7 19.094 16.889 52.218 4.742 20:40 0 0.0 0.000 76.430

Re: sorting an array of arrays by arr_el[$idx][2] (or something like that)

2006-04-18 Thread John W. Krahn
Charles K. Clarkson wrote: > Ed wrote: > > : push( @lineArray, @_ ); <---no it's an array of arrays. > > An array of arrays is a short name for an array of array > references. Array elements can only hold scalar values and arrays > are not scalars. Ref

Re: sorting an array of arrays by arr_el[$idx][2] (or something like that)

2006-04-18 Thread John W. Krahn
Thomas Bätzler wrote: > Ed <[EMAIL PROTECTED]> asked: >> >> push( @lineArray, @_ ); <---no it's an array of arrays. > > This will append all the items in @_ to @lineArray. > > You shoul've said "push( @lineArray, [EMAIL PROTECTED]

Re: sorting an array of arrays by arr_el[$idx][2] (or something like that)

2006-04-18 Thread M. Kristall
e you doing the following? push( @lineArray, @_ ); <---no it's an array of arrays. This is equivalent (although more efficient) to @[EMAIL PROTECTED] .. $#_ + @lineArray] = @_; which is equivalent to splice (@lineArray, @lineArray, 0, @_); As mentioned, that should be p

RE: sorting an array of arrays by arr_el[$idx][2] (or something like that)

2006-04-17 Thread Charles K. Clarkson
/ ) : { : print "FOUND localgroup line:-> $_\n"; : split /\s/; This form of split() is deprecated. You should be receiving an error for this. : push( @lineArray, @_ ); <---no it's an array of arrays. An array of arrays is a short name

RE: sorting an array of arrays by arr_el[$idx][2] (or something like that)

2006-04-17 Thread Thomas Bätzler
Ed <[EMAIL PROTECTED]> asked: [...] > I'm reading from a file and constructing an array of arrays. > Here's an example of what's in the file: > net localgroup Field Aidan /ADD [...] > I want to sort the lines in the file by the 3rd column > (Field, In

sorting an array of arrays by arr_el[$idx][2] (or something like that)

2006-04-17 Thread Ed
I'm still hobbled by my thinking in C problem so I'm looking for a way to do this. I'm reading from a file and constructing an array of arrays. Here's an example of what's in the file: net localgroup Field Aidan /ADD net localgroup Internal Aidan /ADD net localgroup CM

Re: Array of arrays

2006-02-28 Thread Tommy Grav
Disregard my previous email as it was another error further up in the program. Typical beginners mistake I guess :) Cheers Tommy [EMAIL PROTECTED] http://homepage.mac.com/tgrav/ "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a

Re: Array of arrays

2006-02-28 Thread Bob Showalter
Tommy Grav wrote: print $refstars[1][0] ; # <- This is line 38 However this code returns an error I do not understand Missing right curly or square bracket at refstar.pl line 38, at end of line syntax error at refstar.pl line 38, at EOF Execution of refstar.pl aborted due to

RE: Array of arrays

2006-02-28 Thread Timothy Johnson
The code you posted does not return any errors. Check the parts you didn't post. -Original Message- From: Tommy Grav [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 28, 2006 1:48 PM To: beginners@perl.org Cc: Tommy Grav Subject: Array of arrays I have a file of numbers that I

Array of arrays

2006-02-28 Thread Tommy Grav
I have a file of numbers that I want to read in and put the first 12 lines into row one of of a two-dimensional array, the next 12 into row two and so on. my $nref = 12 ; my $n = 0 ; my $im = 0 ; my @refstars ; my @refmag ; while (<>) {

Re: generating a wordlist from an array of arrays

2005-10-06 Thread mark berger
good evening list. thanks for the replies and sorry that i couldn't find the time to reply sooner. sadly i'm still in a rush and haven't tried all of your solutions, hope i will get to it soon. for now i just go with one, so i can get the stuff i wanted to work. still curious about the other thro

Re: generating a wordlist from an array of arrays

2005-10-02 Thread Christer Ekholm
mark berger <[EMAIL PROTECTED]> writes: > hey list. i stuck with gererating a wordlist from a changing > multidimensional array. each entry in the array contains a list with the > possible values. > > fe: > > @wordlayout = ((a, b),# possible values for 1st char >(c),

Re: generating a wordlist from an array of arrays

2005-09-30 Thread John W. Krahn
Adriano Ferreira wrote: > On 9/29/05, mark berger <[EMAIL PROTECTED]> wrote: >>hey list. i stuck with gererating a wordlist from a changing >>multidimensional array. each entry in the array contains a list with the >>possible values. > > I am bit rusty, because it took me a little too long to make

Re: generating a wordlist from an array of arrays

2005-09-30 Thread Adriano Ferreira
On 9/29/05, mark berger <[EMAIL PROTECTED]> wrote: > hey list. i stuck with gererating a wordlist from a changing > multidimensional array. each entry in the array contains a list with the > possible values. I am bit rusty, because it took me a little too long to make it work, but here is a recurs

Re: generating a wordlist from an array of arrays

2005-09-29 Thread Gerard Robin
On Thu, Sep 29, 2005 at 07:26:51PM +0200 mark berger wrote: > hey list. i stuck with gererating a wordlist from a changing > multidimensional array. each entry in the array contains a list with the > possible values. > > fe: > > @wordlayout = ((a, b),# possible values for 1st char

Re: generating a wordlist from an array of arrays

2005-09-29 Thread Jeff 'japhy' Pinyan
On Sep 29, mark berger said: hey list. i stuck with gererating a wordlist from a changing multidimensional array. each entry in the array contains a list with the possible values. You want a "cartesian cross product". And there's a module out there that does just that: Set::CrossProduct.

RE: generating a wordlist from an array of arrays

2005-09-29 Thread Hall, Scott
AIL PROTECTED] Sent: Thursday, September 29, 2005 1:27 PM To: beginners@perl.org Subject: generating a wordlist from an array of arrays hey list. i stuck with gererating a wordlist from a changing multidimensional array. each entry in the array contains a list with the possible values. fe:

generating a wordlist from an array of arrays

2005-09-29 Thread mark berger
hey list. i stuck with gererating a wordlist from a changing multidimensional array. each entry in the array contains a list with the possible values. fe: @wordlayout = ((a, b), # possible values for 1st char (c), # possible values for 2nd char (d, e

Re: generate array of arrays from file

2004-03-16 Thread Wiggins d Anconia
> following the example in the perldsc (data structures cookbook), i wrote this > piece of code to create an array of arrays from a data file : > > > #!/usr/bin/perl -w > use strict ; > > my @AofA ; # array of arrays of file contents > open (fh1, " while (

Re: generate array of arrays from file

2004-03-16 Thread James Edward Gray II
On Mar 16, 2004, at 10:13 AM, Joseph Paish wrote: following the example in the perldsc (data structures cookbook), i wrote this piece of code to create an array of arrays from a data file : #!/usr/bin/perl -w use strict ; my @AofA ; # array of arrays of file contents open (fh1, ") {

generate array of arrays from file

2004-03-16 Thread Joseph Paish
following the example in the perldsc (data structures cookbook), i wrote this piece of code to create an array of arrays from a data file : #!/usr/bin/perl -w use strict ; my @AofA ; # array of arrays of file contents open (fh1, ") { push @AofA, (split /\t/) ; } close (fh1) ;

RE: array of arrays

2003-10-20 Thread Stephen Hardisty
Alright then, first you want to think about how you are going to populate the arrays. For example, if I have a file that contains the following data: 1|10 5|7 I would do this: open(FH, "< bob.txt"); my @file_list; while() { # add a reference of the 2 file columns to @file_list

Re: array of arrays

2003-10-20 Thread Tassilo von Parseval
On Mon, Oct 20, 2003 at 12:33:00PM +0200 Christiane Nerz wrote: > How do I read data out of a table-file in an array-of-arrays? > > Problem: I have to compare two tables with pairs of start-stop-Positions. > I want to find out, which pair of Start-Stop-Position in table_1 is >

Antwort: RE: array of arrays

2003-10-20 Thread Manfred . Beilfuss
<[EMAIL PROTECTED]Kopie: elabs.com> Thema: RE: array of arrays

Re: array of arrays

2003-10-20 Thread Christiane Nerz
... from two text files. Output of a pattern-searching-program and data out of a DB (genebank). No prob to read in those data in a textfile too. Stephen Hardisty wrote: How do I read data out of a table-file in an array-of-arrays? Problem: I have to compare two tables with pairs of start-stop

RE: array of arrays

2003-10-20 Thread Stephen Hardisty
> How do I read data out of a table-file in an array-of-arrays? > > Problem: I have to compare two tables with pairs of start-stop-Positions. > I want to find out, which pair of Start-Stop-Position in table_1 > is > entirely within the range marked by a pair of start-stop-p

array of arrays

2003-10-20 Thread Christiane Nerz
Hi! How do I read data out of a table-file in an array-of-arrays? Problem: I have to compare two tables with pairs of start-stop-Positions. I want to find out, which pair of Start-Stop-Position in table_1 is entirely within the range marked by a pair of start-stop-positions of the second table

RE: Hash to array of arrays

2003-07-14 Thread Charles K. Clarkson
Jerry Preston <[EMAIL PROTECTED]> wrote: : : I have the following hash: This is not a hash. it is a partial algorithm. It contains at least two hashes. Neither of which seem to be a hash of an array of arrays. Can you show us the hash you're referring to? : for $j ( 1..20 )

Re: Hash to array of arrays

2003-07-14 Thread Rob Dixon
ight = $DAT{ height }{ $id }{ $i }{ $j }{ 0 }; if ( $pin > 0 ) { $pin{ order }{ $i }{ $j } = $pin; $pin{ depth }{ $i }{ $j } = $height; } } } And you say you need translated into an array of arrays @data in this format > my @data = ( [ '01',

Hash to array of arrays

2003-07-13 Thread Jerry Preston
Hi!, I have the following hash: for $j ( 1..20 ) { for $i ( 0..$DAT{ good_setups }{ $id } ) { $pin{ order }{ $i }{ $j } = $DAT{ pin}{ $id }{ $i }{ $j }{ 0 } if $DAT{ pin }{ $id }{ $i }{ $j }{ 0 } > 0; $pin{ depth }{ $i }{ $j } = $DAT{ height }{ $id }{ $i }{ $j }{ 0 } if $D

Re: Better explanation - Adding to Mult-dimensional array of arrays

2003-01-15 Thread John W. Krahn
Mike Liss wrote: > > Sorry for the confusing post, here is a little better explanation: > > I am trying to create multi-dimensional arrays > > $MyArray[ 2 ][]; > > So I can do this: > > $MyArray[ 0 ][ 0 ] = 2; > $MyArray[ 0 ][ 1 ] = 3; $MyArray[ 0 ] = [ 2, 3

Re: Better explanation - Adding to Mult-dimensional array of arrays

2003-01-15 Thread Rob Dixon
Mike Liss wrote: > I am trying to create multi-dimensional arrays > > $MyArray[ 2 ][]; > That's meaningless in Perl, but anyway... > > So I can do this: > > $MyArray[ 0 ][ 0 ] = 2; > $MyArray[ 0 ][ 1 ] = 3; > > $MyArray[ 0 ][ 0 ] = 4; > $MyArray[ 1 ][ 1 ] = 5; > $MyArray[ 2 ][ 2 ] = 6; > > > But

RE: Better explanation - Adding to Mult-dimensional array of arrays

2003-01-15 Thread Mark Anderson
> But what I really want to do is this : > > push( @MyArray[0], 2 ); > push( @MyArray[0], 3 ); > > push( @MyArray[1], 4 ); > push( @MyArray[1], 5 ); > push( @MyArray[1], 6 ); I apologize. My first response was incorrect. You need: push( @{$MyArray[0]}, 2 )

Better explanation - Adding to Mult-dimensional array of arrays

2003-01-15 Thread Liss, Mike
Sorry for the confusing post, here is a little better explanation: I am trying to create multi-dimensional arrays $MyArray[ 2 ][]; So I can do this: $MyArray[ 0 ][ 0 ] = 2; $MyArray[ 0 ][ 1 ] = 3; $MyArray[ 0 ][ 0 ] = 4; $MyArray[ 1 ][ 1 ] = 5;

RE: How to unshift to an array in an array of arrays?

2002-08-28 Thread Bob Showalter
> -Original Message- > From: Angerstein [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 28, 2002 8:59 AM > To: Bob Showalter > Subject: AW: How to unshift to an array in an array of arrays? > > > hmm i have a different behavior there > > if i do: >

RE: How to unshift to an array in an array of arrays?

2002-08-28 Thread Bob Showalter
> -Original Message- > From: Angerstein [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 28, 2002 6:12 AM > To: [EMAIL PROTECTED] > Subject: How to unshift to an array in an array of arrays? > > > How to unshift to an array in an array of arrays? $ perl -

Re: AW: How to unshift to an array in an array of arrays?

2002-08-28 Thread Sudarshan Raghavan
On Wed, 28 Aug 2002, Angerstein wrote: > Than its possible: > my $x = 0; > > my @arr1 = (1, 2, 3); > > my @arr2 = (4, 5, 6); > > my @arr3 = (7, 8, 9); > > my @arrofarrs; > > unshift (@arrofarrs, \@arr3); > > unshift (@arrofarrs, \@arr2); > > unshift (@arrofarrs, \@arr1); > unshift (@arr1, $x);

AW: How to unshift to an array in an array of arrays?

2002-08-28 Thread Angerstein
in @arrofarrs. right? > -Ursprüngliche Nachricht- > Von: Sudarshan Raghavan [mailto:[EMAIL PROTECTED]] > Gesendet am: Mittwoch, 28. August 2002 23:23 > An: Perl beginners > Betreff: Re: How to unshift to an array in an array of arrays? > > On Wed, 28 Aug 2002, Angerstein wrote: >

Re: How to unshift to an array in an array of arrays?

2002-08-28 Thread Sudarshan Raghavan
On Wed, 28 Aug 2002, Angerstein wrote: > How to unshift to an array in an array of arrays? Something like this my @arr1 = (1, 2, 3); my @arr2 = (4, 5, 6); my @arr3 = (7, 8, 9); my @arrofarrs; unshift (@arrofarrs, \@arr3); unshift (@arrofarrs, \@arr2); unshift (@arrofarrs, \@arr1); An array

How to unshift to an array in an array of arrays?

2002-08-28 Thread Angerstein
How to unshift to an array in an array of arrays? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: referring to an array in an array of arrays

2002-05-28 Thread Bryan R Harris
28, 2002 2:55 PM To: [EMAIL PROTECTED] Subject: referring to an array in an array of arrays How can I get at an array in an array of arrays? I'm creating the arrays using: $fComments[$i++] = [ @comments ]; Now I want to get back what I put in: print "$fComments[0]\n"

RE: referring to an array in an array of arrays

2002-05-28 Thread Timothy Johnson
n array in an array of arrays How can I get at an array in an array of arrays? I'm creating the arrays using: $fComments[$i++] = [ @comments ]; Now I want to get back what I put in: print "$fComments[0]\n"; but this prints ARRAY(0x107671f0). How do I follow that pointer?

Re: referring to an array in an array of arrays

2002-05-28 Thread John W. Krahn
Bryan R Harris wrote: > > How can I get at an array in an array of arrays? > > I'm creating the arrays using: > > $fComments[$i++] = [ @comments ]; > > Now I want to get back what I put in: > > print "$fComments[0]\n"; print "

referring to an array in an array of arrays

2002-05-28 Thread Bryan R Harris
How can I get at an array in an array of arrays? I'm creating the arrays using: $fComments[$i++] = [ @comments ]; Now I want to get back what I put in: print "$fComments[0]\n"; but this prints ARRAY(0x107671f0). How do I follow that pointer? (I really think we need

Re: Indexing through Array of Arrays

2001-12-25 Thread Jonathan E. Paton
Have you tried: foreach (@$Z) { print join ", ", @$_; print "\n"; } Although this might be more useful: foreach (@$Z) { foreach(@$_) { print "$_, "; } print "\n"; } Looks easy eh? :) The DBI does have other ways of returning data, which sometimes is more effective/easier. De

Re: Indexing through Array of Arrays

2001-12-25 Thread Andrea Holstein
Kurt wrote: > > I'm working with a database interface (DBI) that returns information > by returning a reference ($Z) to an array of arrays. > > ... > > When I write $Z->[2][3] I get the expected -81.3439. > > Now the questions: > > If I want to iter

Indexing through Array of Arrays

2001-12-25 Thread kurt
I'm working with a database interface (DBI) that returns information by returning a reference ($Z) to an array of arrays. When I run the program in the debugger, and ask for $Z, I get: 0 ARRAY(0x20d5e8) 0 ARRAY(0x41acfc) 0 26412 1 'ORLANDO' 2

Re: shift on an array of arrays

2001-10-30 Thread Andrea Holstein
Will Muir wrote: > I have an array of arrays @data that > I would like to take the reference of the 5th element of the first 3 elements and > put them into another array and then shorten @data by 3. > I hope that this makes sense, I am new to this and > don't really k

Re: shift on an array of arrays

2001-10-29 Thread Jeff 'japhy' Pinyan
On Oct 29, Will Muir said: >I have an array of arrays @data that I would like to take the reference >of the 5th element of the first 3 elements and put them into another >array and then shorten @data by 3. I hope that this makes sense, I am >new to this and don't really know

shift on an array of arrays

2001-10-29 Thread Will Muir
Hi all, I have an array of arrays @data that I would like to take the reference of the 5th element of the first 3 elements and put them into another array and then shorten @data by 3. I hope that this makes sense, I am new to this and don't really know a better way too explain it. He

Re: array of arrays

2001-10-18 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Michael Fowler) wrote: > $array[$i][$j][$k][$l][$m] eq $list[$l][$m] > However, this is the first time I've seen someone intentionally using such a > large-dimension array. What is this for? i've used many more dimensions than that ;) -- bri

Re: array of arrays

2001-10-18 Thread Michael Fowler
On Thu, Oct 18, 2001 at 02:28:41PM -0600, Tyler Cruickshank wrote: > $array[$i][$j][$k] = [ @list ]; where, @list is a 2-D array ie. $list[][]. > > How do I access the individual elements of the array @list once Ive put it > into the array @array? $array[$i][$j][$k][$l][$m] eq $list[$l][$m] H

array of arrays

2001-10-18 Thread Tyler Cruickshank
Hi. Im using a multidimensional array in the following way: $array[$i][$j][$k] = [ @list ]; where, @list is a 2-D array ie. $list[][]. How do I access the individual elements of the array @list once Ive put it into the array @array? Thanks. -ty -- To unsubscribe, e-mail: [EMAIL PROTECT

Re: FW: associative array of arrays

2001-09-23 Thread Troy Denkinger
On Sunday 23 September 2001 02:20, Zysman, Roiy wrote: > Can any one show me a way on how to use associative arrays to hold array > pointers,and how to modify the arrays (not the associativeones) Well, I suppose one could give examples here, but you're going to be best off if you read about it y

FW: associative array of arrays

2001-09-22 Thread Zysman, Roiy
Hi all, Can any one show me a way on how to use associative arrays to hold array pointers,and how to modify the arrays (not the associativeones) Thx

Re: hash of ref to array of arrays, lost all but the last element in hash

2001-08-24 Thread Kelvin Teh
d like to construct a hash, whose value holds a reference to an > array of arrays, > however all the keys in my hash have the exact same value, which turns > out to be the value of the last element I put it!! > > I felt that something is wrong in the data structure, that I should not &

RE: hash of ref to array of arrays, lost all but the last element in hash

2001-08-23 Thread Bob Showalter
> -Original Message- > From: Jennifer Pan [mailto:[EMAIL PROTECTED]] > Sent: Thursday, August 23, 2001 1:05 PM > To: [EMAIL PROTECTED] > Cc: Maxim Berlin > Subject: hash of ref to array of arrays, lost all but the last element > in hash > > > Dear all, &g

hash of ref to array of arrays, lost all but the last element in hash

2001-08-23 Thread Jennifer Pan
Dear all, I would like to construct a hash, whose value holds a reference to an array of arrays, however all the keys in my hash have the exact same value, which turns out to be the value of the last element I put it!! I felt that something is wrong in the data structure, that I should not

Re: Splitting a string into a Array of Arrays

2001-07-31 Thread Rachel Coleman
> I know this is simpler then what I am making it but I am stumped. I used LWP::UserAgent to fetch some data from a > web page, What I need to do is to load the data which I believe is just one long string that I got from calling content() > into an array of arrays by splitting on

RE: Splitting a string into a Array of Arrays

2001-07-31 Thread Mooney Christophe-CMOONEY1
You're actually very close. I would just change a couple of things. First of all, you don't need @data as well as @rows. $element is aliased to each element in the array as it loops, so you can re-assign right back into the same array when you split. This will cause the loop to independent of

Splitting a string into a Array of Arrays

2001-07-31 Thread Will Muir
I know this is simpler then what I am making it but I am stumped. I used LWP::UserAgent to fetch some data from a web page, What I need to do is to load the data which I believe is just one long string that I got from calling content() into an array of arrays by splitting on "\n

Re: hash array of arrays?

2001-07-29 Thread Jos I. Boumans
just dereference it: foo( @{ $R{"first"} } ); it's as easy as that =) hth Jos Boumans > > Hi all, > > here's my question :): > > I define a hash array: > our %R=("first" => [ "one", "two" ], "second" => ["third", "fourth"]); > > Now I can get back back array references from this using:

hash array of arrays?

2001-07-29 Thread Pozsar Balazs
Hi all, here's my question :): I define a hash array: our %R=("first" => [ "one", "two" ], "second" => ["third", "fourth"]); Now I can get back back array references from this using: $R{"first"} I also can get back the elements of this array: $R{"first"}->[0]and so on.. but i would need

RE: Sort an array of arrays?

2001-07-24 Thread Wagner-David
Here is a reply to an email on another list regarding sorting of array of arrays. Cut and run(I did it on AS 5.6.0 build 623). From this you should be able to do what you want. Wags

Sort an array of arrays?

2001-07-24 Thread Harry Goldhagen
Anyone know how to sort an array of arrays? To sort on the first column ($j = 0), I tried: $j = 0; for $i (0..$#AddBook) { @col = $AddBook[$i][$j]; @sortcol = sort @col; print "Column $j contains: @col\n"; } for $i (0..$#AddBook) { print "Column $j sorted contains: @sortcol\n