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 jimsgib...@gmail.com wrote: On Jul 9, 2014, at 2:58 PM, Natxo Asenjo wrote: On Wed, Jul 9, 2014 at 10:35 PM, Jim Gibson jimsgib...@gmail.com wrote: On Jul 9, 2014, at 1:20 PM, Natxo Asenjo wrote: In order to use the hash method of determining

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 jimsgib...@gmail.com wrote: On Jul 9, 2014, at 2:58 PM, Natxo Asenjo wrote: On Wed, Jul 9, 2014 at 10:35 PM, Jim Gibson jimsgib...@gmail.com wrote: On Jul 9, 2014, at 1:20 PM, Natxo Asenjo

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-{'value1'}, $i

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::MoreUtils

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 jimsgib...@gmail.com 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 subarrays contain equal NUMBERS

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 jimsgib...@gmail.com 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

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 testing

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 statement: print grep { $_-[0][0] = 0 } @coords; Any

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 . . . Below is the grep statement: print

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, $COORDS line 1281. Press any key to continue . . . Below

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 memory adress: ARRAY(0x29d459c)ARRAY(0x29d462c)ARRAY(0x29d46cc

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. John -- print grep { $_-[0] = 0 } @coords; Just prints

Re: grep array of arrays

2012-08-23 Thread Shawn H Corey
On Thu, 23 Aug 2012 15:58:43 -0500 Chris Stinemetz chrisstinem...@gmail.com 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

Re: grep array of arrays

2012-08-23 Thread Shawn H Corey
On Thu, 23 Aug 2012 14:17:26 -0700 Jim Gibson jimsgib...@gmail.com 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

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 = $arrayRef;

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-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'){ Arunafor my $item1(@$item){ Arunaprint $item1 unless ref($item1) eq 'ARRAY'; Aruna { Aruna

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 contents (Randal

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 {

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: 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, 2, 3,

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 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: Sorting an Array of Arrays

2007-03-14 Thread Randal L. Schwartz
Mumia == Mumia W mumia.w.18.spam 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 member

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: 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',

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

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.+-]+$/ ) { Because

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: 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, etc,

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.869 20:40 9 1157.7 19.094 16.889

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

2006-04-18 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, Internal, CM, DocAdmin) If you're not particularly

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

2006-04-18 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 for an array of array

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

2006-04-18 Thread M. Kristall
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 push (@lineArray, [EMAIL

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] ); instead. No he shouldn't have. @_ is a global variable so

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. References to arrays are scalars

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 Aidan /ADD net localgroup

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: 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 want

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 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: 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

Re: Array or arrays

2005-10-04 Thread Philipp Traeder
On Tuesday 04 October 2005 07:48, Jabir Ahmed wrote: [..] my @details=split('\t',$line); [EMAIL PROTECTED]; $reccnt+=1; [..] How do i read the values of @details trought the $record array; i want something like this print $record[1][1] == this would refer to the

Re: Array or arrays

2005-10-04 Thread John Doe
Jabir Ahmed am Dienstag, 4. Oktober 2005 07.48: ... use strict; # forces declaration of variables use warnings; # big help :-) ... $file=$ARGV[0] || die File not found $!; my %uni=(); # %uni never used below my @record; open (FH,sort $file|);

Array or arrays

2005-10-03 Thread Jabir Ahmed
$file=$ARGV[0] || die File not found $!; my %uni=(); open (FH,sort $file|); $reccnt=0; while (FH) { $line=$_; my @details=split('\t',$line); [EMAIL PROTECTED]; $reccnt+=1; } $file=$ARGV[0] || die File not found $!; my %uni=(); open (FH,sort $file|); $reccnt=0;

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),

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,

RE: generating a wordlist from an array of arrays

2005-09-29 Thread Hall, Scott
: 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: @wordlayout = ((a, b

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 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

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, /path/to/filename/filename.txt) or die (no can do) ; while (fh1

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, /path

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, /path/to/filename/filename.txt) or die (no can do

Build multidimensional array from arrays

2004-01-29 Thread Kevin Old
Hello everyone, I have: @one = qw(A B C D); @two = qw(E F G H); I want to build a multidimensional array from the above arrays. I want to put @one in the first column of the array. I want to put @two in the second column of the array. I want the resulting MDA to look like: @mda = (

Re: Build multidimensional array from arrays

2004-01-29 Thread Jeff 'japhy' Pinyan
On Jan 29, Kevin Old said: @one = qw(A B C D); @two = qw(E F G H); @mda = ( [A][E], Do you mean [A, E]? [B][F], [C][G], [D][H] ); If so, this is how I'd do it: @mda = map [ $one[$_], $two[$_] ], 0 .. $#one; If you need an explanation, feel free to ask.

Re: Build multidimensional array from arrays

2004-01-29 Thread Jeff 'japhy' Pinyan
On Jan 29, Kevin Old said: On Thu, 2004-01-29 at 12:34, Jeff 'japhy' Pinyan wrote: On Jan 29, Kevin Old said: @one = qw(A B C D); @two = qw(E F G H); Well, no that wasn't what I was looking for, but it's a nice piece of code to add to my arsenal. That basically puts the contents of @one in

Re: Build multidimensional array from arrays

2004-01-29 Thread Kevin Old
On Thu, 2004-01-29 at 12:34, Jeff 'japhy' Pinyan wrote: On Jan 29, Kevin Old said: @one = qw(A B C D); @two = qw(E F G H); @mda = ( [A][E], Do you mean [A, E]? [B][F], [C][G], [D][H] ); If so, this is how I'd do it: @mda = map [

Re: Build multidimensional array from arrays

2004-01-29 Thread Rob Dixon
Kevin Old wrote: I have: @one = qw(A B C D); @two = qw(E F G H); I want to build a multidimensional array from the above arrays. I want to put @one in the first column of the array. I want to put @two in the second column of the array. I want the resulting MDA to look like: @mda = (

Re: Build multidimensional array from arrays

2004-01-29 Thread Kevin Old
On Thu, 2004-01-29 at 14:17, Rob Dixon wrote: but /please/ go back a few steps and explain what you want you're trying to do. I doubt that putting characters 'A' .. 'H' into an array is your goal. What you're starting with and what end you have in mind is fundamental. Abstract as little as you

accessing array of arrays in a hash

2003-10-23 Thread Chad A Gard
'), ('#', 'View the Job Log', 'Job Log'), ('#', 'View the Client Assets', 'Client Assets'), ('#', 'View Press Releases', 'Press Releases') ], ); # data simplified and other keys removed... I want to be able to first get the array of arrays that matches a key, keeping

Re: accessing array of arrays in a hash

2003-10-23 Thread Wiggins d Anconia
references like you did in the outer structure. So you end up with: %hash = ( 'key1' = [ [ '#1', 'View1', 'Title1', '#2', 'View2', 'Title2' ], I want to be able to first get the array of arrays that matches a key, keeping it as an array of arrays., then do

Re: accessing array of arrays in a hash

2003-10-23 Thread Wiggins d Anconia
reference with 3 elements. Use [] instead of () to derive an array reference. I want to be able to first get the array of arrays that matches a key, keeping it as an array of arrays., then do a for each loop, keeping access to the array of that array item (OK, bad description, I know...): (here's

Re: accessing array of arrays in a hash

2003-10-23 Thread Wiggins d Anconia
Disregard this first message my web based mail client was acting up, the other message is much more informative, sorry, http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

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: 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-positions of the second

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

Antwort: RE: array of arrays

2003-10-20 Thread Manfred . Beilfuss
: elabs.com Thema: RE: array of arrays 20.10.2003 12:37

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 entirely within

RE: array of arrays

2003-10-20 Thread Stephen Hardisty
-prepare('SOME SQL HERE'); $sth-execute; # run the sql my @db_list; while($sth-fetchrow_arrayref) { # assuming you only select 2 rows in your sql push(@db_list, $_); } So now we have 2 arrays of array references we need to compare them. Ofcourse, it would be much more

Re: Hash to array of arrays

2003-07-14 Thread Rob Dixon
}; 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', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12

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 ) { : for $i

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

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: 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 );

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 what I really

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 ]; Or:

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: 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

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

2002-08-28 Thread Angerstein
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: How to unshift to an array in an array of arrays? Something

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); and it will

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 -d -e 1 DB1 @aoa = ([qw(foo

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: unshift (@{myarray[1]}, $time

array of arrays

2002-07-05 Thread alex
Hi, I have a simple question: how do I access an array in an array? @array = (@array1, array2); ### unless this is wrong... the idea behind it is, that I have a long list, and want to put all 25 entries in a seperate array in that big array. later on I want to be able to read one

RE: array of arrays

2002-07-05 Thread Nikola Janceski
: Friday, July 05, 2002 8:32 AM To: [EMAIL PROTECTED] Subject: array of arrays Hi, I have a simple question: how do I access an array in an array? @array = (@array1, array2); ### unless this is wrong... the idea behind it is, that I have a long list, and want to put all 25

array of arrays :: part2

2002-07-05 Thread Alex B.
Hi, I've read http://webmaster.indiana.edu/perl56/pod/perllol.html and this cleared some points. :) still I do have some problems... the assignment of values to arrays in arrays works, but I gave the arrays in the array names: @array = \(@names, @school, @othercrap); so $array[2][3

Re: array of arrays :: part2

2002-07-05 Thread drieux
On Friday, July 5, 2002, at 08:31 , Connie Chan wrote: [..] If you want to know what 'fields' inside %Data : @DataKeys = keys(%Data); print @DataKeys; # So you get Code, Birth, Name... # However, the elements order in @DataKeys is not base #on how's the order you create your key field in

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 a pre-beginners list

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 @{$fComments[0]}\n; John -- use Perl; program fulfillment

RE: referring to an array in an array of arrays

2002-05-28 Thread Timothy Johnson
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? (I really think we need a pre

RE: referring to an array in an array of arrays

2002-05-28 Thread Bryan R Harris
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; but this prints ARRAY(0x107671f0

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 know a better way too explain

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. Here

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 a better way too

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

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]

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 ;) -- brian d

FW: associative array of arrays

2001-09-23 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: 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

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

2001-08-24 Thread Kelvin Teh
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 keep re-using @match or @splice

  1   2   >