Re: Help on saving and retrieving data structures

2013-09-14 Thread Jimi Wills
Yes, I agree. Top answer! Can also consider YAML if you wanted to do a lot of manual editing of data, but probably JSON is best. Dr Jimi C Wills "David Precious" wrote in message news:20130913133147.0b88fbeb@columbia... On Fri, 13 Sep 2013 19:10:58 +0800 (SGT) *Shaji Kalidasan* wrote:

Re: Help on saving and retrieving data structures

2013-09-14 Thread Dermot
++Storable On 14 September 2013 09:39, Shlomi Fish wrote: > Hi Shaji, > > On Sat, 14 Sep 2013 16:19:26 +0800 (SGT) > *Shaji Kalidasan* wrote: > > > Dear David, > > > > Thanks for throwing light on the topic by citing the security > implications of > > executing eval and also suggesting the ind

Re: Help on saving and retrieving data structures

2013-09-14 Thread Shlomi Fish
Hi Shaji, On Sat, 14 Sep 2013 16:19:26 +0800 (SGT) *Shaji Kalidasan* wrote: > Dear David, > > Thanks for throwing light on the topic by citing the security implications of > executing eval and also suggesting the industry standard 'JSON' for > interoperability.  > One should note that JSON is

Re: Help on saving and retrieving data structures

2013-09-14 Thread *Shaji Kalidasan*
PM Subject: Re: Help on saving and retrieving data structures On Fri, 13 Sep 2013 19:10:58 +0800 (SGT) *Shaji Kalidasan* wrote: > I am saving the data structure to a file and retrieving it back > again, but, when I 'use strict' it is giving the following error > message > >

Re: Help on saving and retrieving data structures

2013-09-13 Thread 'lesleyb'
On Fri, Sep 13, 2013 at 01:31:47PM +0100, David Precious wrote: > On Fri, 13 Sep 2013 19:10:58 +0800 (SGT) > *Shaji Kalidasan* wrote: > > I am saving the data structure to a file and retrieving it back > > again, but, when I 'use strict' it is giving the following error > > message > > > > Global

Re: Help on saving and retrieving data structures

2013-09-13 Thread David Precious
On Fri, 13 Sep 2013 19:10:58 +0800 (SGT) *Shaji Kalidasan* wrote: > I am saving the data structure to a file and retrieving it back > again, but, when I 'use strict' it is giving the following error > message > > Global symbol "%game" requires explicit package name Others have pointed out that t

Re: Help on saving and retrieving data structures

2013-09-13 Thread *Shaji Kalidasan*
o God. --- From: Dr Jimi-Carlo Bukowski-Wills To: *Shaji Kalidasan* Sent: Friday, 13 September 2013 5:12 PM Subject: Re: Help on saving and retrieving data structures Hi   It’s because the output file has no (my) in i

Re: Help on saving and retrieving data structures

2013-09-13 Thread *Shaji Kalidasan*
o God. --- From: 'lesleyb' To: beginners@perl.org Sent: Friday, 13 September 2013 5:26 PM Subject: Re: Help on saving and retrieving data structures On Fri, Sep 13, 2013 at 07:10:58PM +0800, *Shaji Kalidasan

Re: Help on saving and retrieving data structures

2013-09-13 Thread 'lesleyb'
On Fri, Sep 13, 2013 at 07:10:58PM +0800, *Shaji Kalidasan* wrote: > Dear Perlers, > > I am saving the data structure to a file and retrieving it back again, but, > when I 'use strict' it is giving the following error message > > Global symbol "%game" requires explicit package name This message

Help on saving and retrieving data structures

2013-09-13 Thread *Shaji Kalidasan*
Dear Perlers, I am saving the data structure to a file and retrieving it back again, but, when I 'use strict' it is giving the following error message Global symbol "%game" requires explicit package name It is working fine without 'strict'. Please help [code] #Code for saving the data structu

Re: Perl Module to parse any other Perl script/module to fetch stats about data-structures

2012-02-13 Thread Randal L. Schwartz
> "Parag" == Parag Kalra writes: Parag> Do we have any Perl module which can parse any other perl script Parag> (or module) and fetch information like total number of arrays Parag> being used, total number of hashes, total number of scalar Parag> variables etc and size information (like total

Re: Perl Module to parse any other Perl script/module to fetch stats about data-structures

2012-02-09 Thread Shawn H Corey
On 12-02-08 05:20 PM, Parag Kalra wrote: Do we have any Perl module which can parse any other perl script (or module) and fetch information like total number of arrays being used, total number of hashes, total number of scalar variables etc and size information (like total elements, total keys

Re: Perl Module to parse any other Perl script/module to fetch stats about data-structures

2012-02-08 Thread Jeff Peng
于 2012-2-9 15:21, Parag Kalra 写道: By data-structures being used, I mean the data structures that are actually *declared* in the script. And is it possible to find at least the data-structures stats of the current script that is getting executed if no parser is available. For example if I

Re: Perl Module to parse any other Perl script/module to fetch stats about data-structures

2012-02-08 Thread Parag Kalra
By data-structures being used, I mean the data structures that are actually *declared* in the script. And is it possible to find at least the data-structures stats of the current script that is getting executed if no parser is available. For example if I have a big script or module and if I want

Re: Perl Module to parse any other Perl script/module to fetch stats about data-structures

2012-02-08 Thread Jeff Peng
于 2012-2-9 10:15, Steve Bertrand 写道: I would suspect that this would be something that would have to run against the file itself, even prior to compile. Curious task. Might I ask what the purpose of your desire is? I am also not sure what's the special purpuse of the OP. Some modules on CP

Re: Perl Module to parse any other Perl script/module to fetch stats about data-structures

2012-02-08 Thread Steve Bertrand
On 2012.02.08 17:20, Parag Kalra wrote: Do we have any Perl module which can parse any other perl script (or module) and fetch information like total number of arrays being used, total number of hashes, total number of scalar variables etc and size information (like total elements, total keys e

Perl Module to parse any other Perl script/module to fetch stats about data-structures

2012-02-08 Thread Parag Kalra
Do we have any Perl module which can parse any other perl script (or module) and fetch information like total number of arrays being used, total number of hashes, total number of scalar variables etc and size information (like total elements, total keys etc) for each data structure in that perl sc

Re: Efficient way to compare 2 data structures particularly hash

2011-04-30 Thread Paul Johnson
On Sat, Apr 30, 2011 at 11:22:57AM -0700, Parag Kalra wrote: > Hi, > > I am evaluating different approaches to compare data structures in Perl - > i.e whether they are same or not. > > I am planning to start wit: > > 1. Data::Compare > > 2. And then found thi

Re: Efficient way to compare 2 data structures particularly hash

2011-04-30 Thread Rob Dixon
On 30/04/2011 19:22, Parag Kalra wrote: Hi, I am evaluating different approaches to compare data structures in Perl - i.e whether they are same or not. I am planning to start wit: 1. Data::Compare 2. And then found this - http://stackoverflow.com/questions/1273616/how-do-i-compare-two-hashes

Efficient way to compare 2 data structures particularly hash

2011-04-30 Thread Parag Kalra
Hi, I am evaluating different approaches to compare data structures in Perl - i.e whether they are same or not. I am planning to start wit: 1. Data::Compare 2. And then found this - http://stackoverflow.com/questions/1273616/how-do-i-compare-two-hashes-in-perl-without-using-datacompare Any

Re: Rendering data structures using CGI::Application

2009-06-29 Thread Steve Bertrand
Gurunandan R. Bhat wrote: > Sure. I think you would like to have the error messages next to the sub > that threw them, but here is what you want: (NOT TESTED!!) ..woot!!! Thank you ever so much. Although I inserted the data statically into my _render_error() method, the result is positive! Othe

Re: Rendering data structures using CGI::Application

2009-06-29 Thread Gurunandan R. Bhat
Sure. I think you would like to have the error messages next to the sub that threw them, but here is what you want: (NOT TESTED!!) In your module: my $messages = [ {text => 'quantity is undefined, zero or illegal'}, {text => 'amount is undefined or illegal'}, {text => 'pay

Re: Rendering data structures using CGI::Application

2009-06-29 Thread Steve Bertrand
Gurunandan R. Bhat wrote: > How do you want the output to look? If you write in a sample output, I > could help with the template to generate that output I would be extremely delighted to even get the following rendered for now, given the Data::Dumper output below. If I had a decent example, then

Re: Rendering data structures using CGI::Application

2009-06-29 Thread Gurunandan R. Bhat
How do you want the output to look? If you write in a sample output, I could help with the template to generate that output Regards On Mon, 2009-06-29 at 22:56 -0400, Steve Bertrand wrote: > I've been stuck for the last three hours trying to render the following > data structure into my browser

Rendering data structures using CGI::Application

2009-06-29 Thread Steve Bertrand
I've been stuck for the last three hours trying to render the following data structure into my browser. I'm using CGI::Application, and CGI::Application::Plugin::PageBuilder. No matter what I do or try, I can not loop the structure into a template variable. I'm literally at wits end, and am consid

RE: references to complex data structures

2008-01-15 Thread Kevin Viel
> -Original Message- > From: Rob Dixon [mailto:[EMAIL PROTECTED] > Sent: Monday, January 14, 2008 8:59 PM > To: beginners@perl.org > Cc: Kevin Viel > Subject: Re: references to complex data structures > > Kevin Viel wrote: > > Consider the following anony

Re: references to complex data structures

2008-01-14 Thread Rob Dixon
Kevin Viel wrote: Consider the following anonymous array of anonymous arrays: my $a = [ [ 00 , 01 ] , [ 10 , 11 ] ] ; I can print the first element of the first anonymous array: print "$$a[ 0 ][ 0 ]\n" ; or, equivalently, I can explicit use bracers to dereference it: print "$

Re: references to complex data structures

2008-01-14 Thread Gunnar Hjalmarsson
Kevin Viel wrote: Consider the following anonymous array of anonymous arrays: my $a = [ [ 00 , 01 ] , [ 10 , 11 ] ] ; I can print the first element of the first anonymous array: print "$$a[ 0 ][ 0 ]\n" ; or, equivalently, I can explicit use bracers to dereference it: print "$

references to complex data structures

2008-01-14 Thread Kevin Viel
Consider the following anonymous array of anonymous arrays: my $a = [ [ 00 , 01 ] , [ 10 , 11 ] ] ; I can print the first element of the first anonymous array: print "$$a[ 0 ][ 0 ]\n" ; or, equivalently, I can explicit use bracers to dereference it: print "${$a}[ 0 ][ 0 ]\n" ;

Re: [SPAM] Re: Accessing packed data structures

2007-03-14 Thread Vincent Li
On Wed, 14 Mar 2007, Dharshana Eswaran wrote: On 3/13/07, Tom Phoenix <[EMAIL PROTECTED]> wrote: On 3/13/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: > I was going thro the topic "Accessing packed data structures" in the Perl > Complete Reference Book

Re: Accessing packed data structures

2007-03-14 Thread Chas Owens
On 3/14/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: snip > The data which i need to pack and unpack to these elements are in hex > format(0x0B 0x1C 0x34 etc). It is a string of hex bytes. > Can i know about the format in which i need to supply the input? Coz i am unable to accept the hex st

Re: Accessing packed data structures

2007-03-14 Thread Jenda Krynicky
From: "Dharshana Eswaran" <[EMAIL PROTECTED]> > I was going thro the topic "Accessing packed data structures" in the Perl > Complete Reference Book. I came across this example: > > struct utmp { > char ut_user[8]; /* User login name */ > char ut_id

Re: Accessing packed data structures

2007-03-13 Thread Dharshana Eswaran
On 3/14/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 3/14/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: snip > Now how do i come up with the pack template? I dont know how a enum should > be represented in the pack template. :-( > > /I8(enum)I8i8I8/ => pack template > > The above mentioned en

Re: Accessing packed data structures

2007-03-13 Thread Chas Owens
On 3/14/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: snip Now how do i come up with the pack template? I dont know how a enum should be represented in the pack template. :-( /I8(enum)I8i8I8/ => pack template The above mentioned enum just contains two elements. The data which i need to pack

Re: Accessing packed data structures

2007-03-13 Thread Dharshana Eswaran
On 3/13/07, Tom Phoenix <[EMAIL PROTECTED]> wrote: On 3/13/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: > I was going thro the topic "Accessing packed data structures" in the Perl > Complete Reference Book. I came across this example: > > struct utmp { >

Re: Accessing packed data structures

2007-03-13 Thread John W. Krahn
Tom Phoenix wrote: > On 3/13/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: > >> I was going thro the topic "Accessing packed data structures" in the Perl >> Complete Reference Book. I came across this example: >> >> struct utmp { >> ch

Re: Accessing packed data structures

2007-03-13 Thread Tom Phoenix
On 3/13/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: I was going thro the topic "Accessing packed data structures" in the Perl Complete Reference Book. I came across this example: struct utmp { char ut_user[8]; /* User login name */ char ut_id[4]; /* /etc/inittab id */

Accessing packed data structures

2007-03-13 Thread Dharshana Eswaran
Hi all, I was going thro the topic "Accessing packed data structures" in the Perl Complete Reference Book. I came across this example: struct utmp { char ut_user[8]; /* User login name */ char ut_id[4]; /* /etc/inittab id */ char ut_line[12]; /* device name */ short ut_pid; /*

Re: Can anyone guide me for : Data Structures in Perl

2005-07-17 Thread Wiggins d'Anconia
Wijaya Edward wrote: > > >>can anybody help me with a link or a tutorial for >>understanding the Datastructures in perl. >> >>Example, Array of Array, Hash of Array, Hash of Hash, >>Array of Hash. > > > > > You can find everything you need in: > > perldoc perldsc > > -- > Regards, > Edward WIJ

Re: Can anyone guide me for : Data Structures in Perl

2005-07-17 Thread Wijaya Edward
You can find everything you need in: perldoc perldsc -- Regards, Edward WIJAYA SINGAPORE > > can anybody help me with a link or a tutorial for > understanding the Datastructures in perl. > > Example, Array of Array, Hash of Array, Hash of Hash, > Array of Hash. -- To unsubscribe, e-mail:

Can anyone guide me for : Data Structures in Perl

2005-07-17 Thread atul ashpalia
Hi, can anybody help me with a link or a tutorial for understanding the Datastructures in perl. Example, Array of Array, Hash of Array, Hash of Hash, Array of Hash. Along with few scripts to understand their application. thanks in advance, Atul Ashpalia

Module to merge arbitrary multi-level data structures?

2004-08-03 Thread Randy W. Sims
Does anyone know of a module that can take a reference to two arbitrarily organized data structures, and return a merged structure? Thanks, Randy. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.

Re: Module to merge arbitrary multi-level data structures?

2004-08-03 Thread Randy W. Sims
Randy W. Sims wrote: Does anyone know of a module that can take a reference to two arbitrarily organized data structures, and return a merged structure? Scratch that. Hash::Merge seems to do what I want. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

RE: [PBML] Help with Data Structures

2004-06-18 Thread Charles K. Clarkson
From: William Martell wrote: : Hello All, : : I was wondering if someone could tell me how to manipulate : this data structure. I have attached the datafile. My code : and code results are printed below. : : If you take a look at the results, you will see that there

Help with Data Structures

2004-06-17 Thread William Martell
Hello All, I was wondering if someone could tell me how to manipulate this data structure. I have attached the datafile. My code and code results are printed below. If you take a look at the results, you will see that there is a hash created for each interaction in the loop and the results a

Help with Data Structures

2004-06-14 Thread William Martell
Hello All, I hope you all are doing well. I am trying to get this code to work correctly and I have used another Perl Guru's code [Thanks Charles Clarkson] to get this far, but I am still unsure about a few things... I am trying to read a file (attached). and I am trying to make a csv file of

Re: Help with Data Structures

2004-06-04 Thread John W. Krahn
William Martell wrote: > > Hello Group, Hello, > I am trying to get this code to run. I got it from the book > Data Munging with Perl. I cut and pasted the code, then changed > the input from stdin to FILE. I supplied a text file for the > passwords (I am on a Windows 2k box). But I can't get it

RE: Help with Data Structures

2004-06-04 Thread Charles K. Clarkson
From: William Martell wrote: : Here you go. Try this then: my $users = read_passwd(); my @names; foreach (keys %{$users}) { next unless $users->{$_}{fullname}; my ($forename, $surname) = split(/\s+/, $users->{$_}{fullname}, 2); push @names, "$surname, $

RE: Help with Data Structures

2004-06-04 Thread William Martell
;$surname, $forename"; } print map { "$_\n" } sort @names;Example: reading /etc/passwd Let’s start by writing a routine to read the data into internal data structures. This routine can then be used by any of the following examples. As always, for flexibility, we’ll assume that t

RE: Help with Data Structures

2004-06-04 Thread Charles K. Clarkson
From: William Martell wrote: : Hello Group, : : : : I am trying to get this code to run. I got it from the book : Data Munging with Perl. I cut and pasted the code, then : changed the input from stdin to FILE. I supplied a text file : for the passwords (I am on a Wind

Help with Data Structures

2004-06-04 Thread William Martell
Hello Group,   I am trying to get this code to run. I got it from the book Data Munging with Perl. I cut and pasted the code, then changed the input from stdin to FILE. I supplied a text file for the passwords (I am on a Windows 2k box). But I can't get it correct. I think the line @[EMAIL PR

RE: Your recommendations to tie multi-level data structures

2004-03-29 Thread Bob Showalter
Phil Schaechter wrote: > All, > > I would like the ability to tie a database and use it as a > multi-level data structure, like > > $tied{hash}{subhash} > $tied{hash}{array}[0] > > Etc... > > Any recommendations for this? I've heard I should check out the > MLDBM module. How have others conque

Your recommendations to tie multi-level data structures

2004-03-29 Thread Phil Schaechter
All, I would like the ability to tie a database and use it as a multi-level data structure, like $tied{hash}{subhash} $tied{hash}{array}[0] Etc... Any recommendations for this? I've heard I should check out the MLDBM module. How have others conquered this issue? Is it possible? Thanks, P

RE: copying complex data structures

2003-12-12 Thread West, William M
>use Storable; >$arrayref_one = dclone( $arrayref_two ); > aha thanks :) it's those details that make a program so much easier to make.. i noticed another poster asking about reference notations- i think that this and Object Oriented programming have given me the most headaches on a co

RE: copying complex data structures

2003-12-11 Thread NYIMI Jose (BMB)
Try clone method of Storable module from CPAN. There is also Clone module out there. HTH, José. -Original Message- From: West, William M [mailto:[EMAIL PROTECTED] Sent: Thursday, December 11, 2003 4:37 PM To: [EMAIL PROTECTED] Subject: copying complex data structures the following

Re: copying complex data structures

2003-12-11 Thread James Edward Gray II
.$why){ $arrayref_one->[$a]->[$b] = $arrayref_two->[$a]->[$b]; } } it would be nice to have something to copy complex data structures that isn't going to be a code maintenance headache- the above is dependent on the data structure being a "2 dimensional a

copying complex data structures

2003-12-11 Thread West, William M
$a]->[$b] = $arrayref_two->[$a]->[$b]; } } it would be nice to have something to copy complex data structures that isn't going to be a code maintenance headache- the above is dependent on the data structure being a "2 dimensional array" of particular size. i don't want

RE: Creating uniqueness in complex data structures

2003-11-24 Thread Paul Harwood
OK, maybe I am confusing myself. :) -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] Sent: Monday, November 24, 2003 9:27 AM To: Paul Harwood Cc: James Edward Gray II; Beginner Perl Subject: RE: Creating uniqueness in complex data structures On Nov 24, Pa

RE: Creating uniqueness in complex data structures

2003-11-24 Thread Jeff 'japhy' Pinyan
On Nov 24, Paul Harwood said: >The problem is that the value in $thread can be duplicated therefore it >will write over anything else contained there. That's the problem I am >having. > >-Original Message- > >> if ($_ =~ /(T[0-9A-F]+) SCTS\((.+)\)/) >> { >>

RE: Creating uniqueness in complex data structures

2003-11-24 Thread Paul Harwood
Perl Conversation: Creating uniqueness in complex data structures Subject: Re: Creating uniqueness in complex data structures On Nov 23, 2003, at 6:36 PM, Paul Harwood wrote: > The log files I am parsing have threads (a T followed by several > alphanumeric numbers) associated with each line

Re: Creating uniqueness in complex data structures

2003-11-24 Thread James Edward Gray II
On Nov 23, 2003, at 6:36 PM, Paul Harwood wrote: The log files I am parsing have threads (a T followed by several alphanumeric numbers) associated with each line of text. I want to push each value of $2 (which is a server name) into an anonymous array. This works fine in the following code. if ($

Creating uniqueness in complex data structures

2003-11-24 Thread Paul Harwood
The log files I am parsing have threads (a T followed by several alphanumeric numbers) associated with each line of text. I want to push each value of $2 (which is a server name) into an anonymous array. This works fine in the following code. if ($_ =~ /(T[0-9A-F]+) SCTS\((.+)\)/)

Re: how to create/use data structures in perl ?

2003-07-08 Thread Sudarshan Raghavan
Madhu Reddy wrote: Hi, How to create data structures in perl ? I have following data structure in C...and i have to create similar data structure in perl and use... how to create data strutures in perl and how to use ? perldoc -f pack perldoc -f unpack typedef struct { char

how to create/use data structures in perl ?

2003-07-08 Thread Madhu Reddy
Hi, How to create data structures in perl ? I have following data structure in C...and i have to create similar data structure in perl and use... how to create data strutures in perl and how to use ? typedef struct { charPrefix[8]; charPrint

RE: Data Structures in Perl

2003-07-08 Thread Trevor Morrison
r:3280 Order Number:3280 Order Number:3280 Order Number:3280 Order Number:3280 Order Number:3280 C:\maverick> -Original Message- From: Gupta, Sharad [mailto:[EMAIL PROTECTED] Sent: Sunday, July 06, 2003 4:55 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Data Structures i

Re: Data Structures in Perl

2003-07-06 Thread Robin Norwood
"Gupta, Sharad" <[EMAIL PROTECTED]> writes: > >From ur example i assume that: > > my @order is an array collecting all of the objects with each order. > > So, instead of > > my @order = new miva_order; > > we mean to say: > > my @orders; > my $obj = new miva_order; > $obj->order_number(get_o

RE: Data Structures in Perl

2003-07-06 Thread Gupta, Sharad
- From: Trevor Morrison [mailto:[EMAIL PROTECTED] Sent: Sunday, July 06, 2003 10:37 AM To: [EMAIL PROTECTED] Subject: Data Structures in Perl Hi, I am new to using data structures in Perl, but have played with them in C (a long time ago). I have downloaded the Class::Struct::Fields module on my W2

Data Structures in Perl

2003-07-06 Thread Trevor Morrison
Hi, I am new to using data structures in Perl, but have played with them in C (a long time ago). I have downloaded the Class::Struct::Fields module on my W2K system and all works well. I am finding the documentation a little terse though. I am trying to read into my Perl program orders that

Re: STILL NEEW SOME HELP: Using data structures to find similarities and differences

2003-03-04 Thread R. Joseph Newton
I use, I am not finding this easy. CAN ANYONE HELP PLEASE? > All I need is to be pointed in the right direction. > ALL WILL BE APPRECIATED. > > Cheers, aim. Hi Aimal, Can you post any of what you have tried to do to sort out the issues here. Choosing appropriate data structures actual

RE: STILL NEEW SOME HELP: Using data structures to find similarities and differences

2003-03-03 Thread Aimal Pashtoonmal
Hello, I have three files, for two different cites. The first file contains names of men with their faves, in columns. The second file is the same but for their partner. The third file is a list of similar partners (partner selection based on data fed into a perl script): FILE_1 and FILE_2 column

RE: Using data structures to find similarities and differences

2003-03-02 Thread Aimal Pashtoonmal
Hello, I have three files, for two different cites. The first file contains names of men with their faves, in columns. The second file is the same but for their partner. The third file is a list of similar partners (partner selection based on data fed into a perl script): FILE_1 and FILE_2 column

RE: Storing complex Data structures ?

2002-09-11 Thread NYIMI Jose (BMB)
You can also store your complexe data structures in a xml file by using XML::Simple module. http://search.cpan.org/author/GRANTM/XML-Simple-1.08/Simple.pm José. -Original Message- From: Rowan Reid [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 8:39 PM To: '

RE: Storing complex Data structures ?

2002-09-10 Thread Rowan Reid
> No. You access the data through %COMPANY_DB. That's the whole > point of tie(). The object $db is used only if you need to > call additional methods of MLDBM on it. You really don't even > need to save $db, because you can always get it via: > >tied(%COMPANY_DB) This is what I did prev

RE: Storing complex Data structures ?

2002-09-10 Thread Bob Showalter
> -Original Message- > From: Rowan Reid [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 10, 2002 2:18 PM > To: 'Perl beginners' > Subject: Storing complex Data structures ? > > > > > What is the correct way to access and store complex dat

Re: Storing complex Data structures ?

2002-09-10 Thread Paul Johnson
On Tue, Sep 10, 2002 at 11:17:33AM -0700, Rowan Reid wrote: > What is the correct way to access and store complex data structures to a > file. I.e. hashes with several references. This is Perl. There is no "correct" way. But you could take a look at Data::Dumper and St

Storing complex Data structures ?

2002-09-10 Thread Rowan Reid
What is the correct way to access and store complex data structures to a file. I.e. hashes with several references. The method I have been using is as follows tie (%COMPANY_DB,'MLDBM','studio3.db',O_RDWR|O_CREAT,0777,$DB_BTREE) || die $!; Also DB_File. I'm realizin

Re: undef of nested data structures

2002-08-15 Thread Kevin Meltzer
e $foo. This doesn't answer the question in any way, but thought some may be interested in this side-note. Cheers, Kevin On Thu, Aug 15, 2002 at 01:52:23PM -0400, Bob Showalter ([EMAIL PROTECTED]) said something similar to: > > -Original Message- > > From: Niko

Re: undef of nested data structures

2002-08-15 Thread Jenda Krynicky
From: Nikola Janceski <[EMAIL PROTECTED]> > I am wondering how undef works. > > I know that undef will undefine a variable if used like > undef($scalar); I also know that it doesn't actually free up the > memory but tells Perl that it's now available to be recycled for other > data. > > but what

RE: undef of nested data structures

2002-08-15 Thread Bob Showalter
> -Original Message- > From: Nikola Janceski [mailto:[EMAIL PROTECTED]] > Sent: Thursday, August 15, 2002 12:44 PM > To: Beginners (E-mail) > Subject: undef of nested data structures > > > I am wondering how undef works. perldoc -f undef > > I know that

undef of nested data structures

2002-08-15 Thread Nikola Janceski
I am wondering how undef works. I know that undef will undefine a variable if used like undef($scalar); I also know that it doesn't actually free up the memory but tells Perl that it's now available to be recycled for other data. but what about nested data (ie. hashes of hashes, arrays of arrays

getRemLoad is okIsh was Re: combining data structures into one array

2002-06-18 Thread drieux
On Tuesday, June 18, 2002, at 10:55 , Kipp, James wrote: > cool. the 'getRemLoad' sub is going to come in handy during this project > thanks. [..] >> then you can unwarp it with say: >> >> http://www.wetware.com/drieux/pbl/Auslanders/gets_stats.txt >> You might want to get in touch with

Re: combining data structures into one array

2002-06-18 Thread drieux
On Tuesday, June 18, 2002, at 10:52 , Kipp, James wrote: > well done. but as you said the "form is way ugly". I have adjusted the sub > to return array refs that i can easily deal with. >> On Tuesday, June 18, 2002, at 09:40 , Kipp, James wrote: >> >>> $totals = [ >>> [ 15.8, 17.2 ], >>>

RE: combining data structures into one array

2002-06-18 Thread Felix Geerinckx
on Tue, 18 Jun 2002 17:43:24 GMT, James Kipp wrote: > Thanks everyone for your help. I am going to redo the get_stats() > function to be 'smarter', the way it is now is much to messy. No wonder you come to that conclusion after the odd 20, dare I say, messy answers in this thread. Let's go bac

RE: combining data structures into one array

2002-06-18 Thread Kipp, James
cool. the 'getRemLoad' sub is going to come in handy during this project thanks. > > > then you can unwarp it with say: > > http://www.wetware.com/drieux/pbl/Auslanders/gets_stats.txt > > ciao > drieux > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAI

RE: combining data structures into one array

2002-06-18 Thread Kipp, James
well done. but as you said the "form is way ugly". I have adjusted the sub to return array refs that i can easily deal with. > -Original Message- > From: drieux [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 18, 2002 1:35 PM > To: begin begin > Subject: Re:

RE: combining data structures into one array

2002-06-18 Thread Kipp, James
Thanks everyone for your help. I am going to redo the get_stats() function to be 'smarter', the way it is now is much to messy. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: combining data structures into one array

2002-06-18 Thread drieux
On Tuesday, June 18, 2002, at 09:40 , Kipp, James wrote: > $totals = [ > [ 15.8, 17.2 ], > [ 3.7, 3.9 ], > etc > ]; could it be that this form is like way Ugly? note that assume a function of form: # let us Dummy up some data sub gets_Stats { my @load = qw/

RE: combining data structures into one array

2002-06-18 Thread Timothy Johnson
:56 AM To: 'Shishir K. Singh'; Kipp, James; [EMAIL PROTECTED] Subject: RE: combining data structures into one array > > @stats = (user, cpu, mem, tot_cpu, tot_mem, load1, load2); > > > You can do this > > # > my @myV

Re: combining data structures into one array

2002-06-18 Thread Shawn
Shawn - Original Message - From: "Kipp, James" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 18, 2002 11:40 AM Subject: RE: combining data structures into one array > Shishir and Bob, > > still can't get it to work. also decided we can l

RE: combining data structures into one array

2002-06-18 Thread Kipp, James
> > @stats = (user, cpu, mem, tot_cpu, tot_mem, load1, load2); > > > You can do this > > # > my @myVars = (); > push (@myVars, @$stats, @$totals, $loads); > ## tried that, it does not work. I think i have found

RE: combining data structures into one array

2002-06-18 Thread Kipp, James
> > > I have a subroutine that returns 3 array refs. so i have: > > my ($stats, $totals, $loads) = gets_stats(); > > would it be possible to expose this gets_stats() > function - and/or re-think how it deals with > generating data... of course, that is what i am doing now :-). -- To unsu

RE: combining data structures into one array

2002-06-18 Thread Shishir K. Singh
: Tuesday, June 18, 2002 12:40 PM To: [EMAIL PROTECTED] Subject: RE: combining data structures into one array Shishir and Bob, still can't get it to work. also decided we can leave out $loads, so basically i want to combine $stats and $totals. as bob suggested, here is sample data: ($stats, $t

Re: combining data structures into one array

2002-06-18 Thread drieux
On Tuesday, June 18, 2002, at 07:32 , Kipp, James wrote: > I have a subroutine that returns 3 array refs. so i have: > my ($stats, $totals, $loads) = gets_stats(); would it be possible to expose this gets_stats() function - and/or re-think how it deals with generating data... ciao drieux -

Re: combining data structures into one array

2002-06-18 Thread Shawn
Hello Jim, how about something along these lines: for(0..$#{$stats}) { push @stats, $stats->[$_],$totals->[$_]; } Shawn - Original Message - From: "Kipp, James" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 18, 2002 11:40 AM Subject: R

RE: combining data structures into one array

2002-06-18 Thread Kipp, James
["oracle", 6.8, 11.2,15.8, 17.2 ], ["ksh", 1.8, 1.2, 3.7, 3.9 ], etc... ); thanks. > -Original Message- > From: Shishir K. Singh [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 18, 2002 11:04 AM > To: Kipp, James; [EMAIL PROTECTED

RE: combining data structures into one array

2002-06-18 Thread Bob Showalter
> -Original Message- > From: Kipp, James [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 18, 2002 11:46 AM > To: [EMAIL PROTECTED] > Subject: RE: combining data structures into one array > > > > > > > Is there a correspondence between stats and t

RE: combining data structures into one array

2002-06-18 Thread Kipp, James
> > Is there a correspondence between stats and totals, such that the > "nth" entry in stats matches the "nth" entry in totals? If so, > you would want to say something like: > >push @{$stats->[$_]}, @{$totals->[$_]}, @$loads > for 0 .. $#$stats; > > no, there is not. i just want

RE: combining data structures into one array

2002-06-18 Thread Kipp, James
> > push (@$stats, @$totals, $loads); > > didn't work ?? haven't tried yet. get back to you in a bit thanks again > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: combining data structures into one array

2002-06-18 Thread Shishir K. Singh
Do you mean to say push (@$stats, @$totals, $loads); didn't work ?? -Original Message- From: Kipp, James [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 11:23 AM To: Shishir K. Singh; Kipp, James; [EMAIL PROTECTED] Subject: RE: combining data structures into one array &

RE: combining data structures into one array

2002-06-18 Thread Kipp, James
array: $loads = [load1, load2] thanks > > Cheers > Shihir > > > -Original Message- > From: Shishir K. Singh > Sent: Tuesday, June 18, 2002 10:55 AM > To: Kipp, James; [EMAIL PROTECTED] > Subject: RE: combining data structures into one array >

  1   2   >