September 2013 6:01 PM
Subject: Re: Help on saving and retrieving data structures
On Fri, 13 Sep 2013 19:10:58 +0800 (SGT)
*Shaji Kalidasan* shajiin...@yahoo.com 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
Hi Shaji,
On Sat, 14 Sep 2013 16:19:26 +0800 (SGT)
*Shaji Kalidasan* shajiin...@yahoo.com 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
++Storable
On 14 September 2013 09:39, Shlomi Fish shlo...@shlomifish.org wrote:
Hi Shaji,
On Sat, 14 Sep 2013 16:19:26 +0800 (SGT)
*Shaji Kalidasan* shajiin...@yahoo.com wrote:
Dear David,
Thanks for throwing light on the topic by citing the security
implications of
executing
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*
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
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 means
.
---
From: 'lesleyb' lesl...@herlug.org.uk
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
.
---
From: Dr Jimi-Carlo Bukowski-Wills jbwi...@staffmail.ed.ac.uk
To: *Shaji Kalidasan* shajiin...@yahoo.com
Sent: Friday, 13 September 2013 5:12 PM
Subject: Re: Help on saving and retrieving data structures
Hi
It’s
On Fri, 13 Sep 2013 19:10:58 +0800 (SGT)
*Shaji Kalidasan* shajiin...@yahoo.com 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
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* shajiin...@yahoo.com 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
Parag == Parag Kalra paragka...@gmail.com 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
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
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
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
于 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
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
于 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
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
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
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 this -
http://stackoverflow.com/questions
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
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.
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
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 =
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!
Other
-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 anonymous array of anonymous arrays:
my
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 ;
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
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
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[4]; /* /etc/inittab id */
char ut_line[12]; /* device name
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
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. I came across this example:
struct
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; /* process ID */
short
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 */
char ut_line[12
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 {
char ut_user[8]; /* User login name */
char ut_id[4]; /* /etc/inittab id
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 {
char ut_user[8]; /* User login name */
char
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
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 enum just
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
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:
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 WIJAYA
SINGAPORE
There
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
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.org/first
From: William Martell mailto:[EMAIL PROTECTED] 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
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
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
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
From: William Martell mailto:[EMAIL PROTECTED] 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
@names, $surname, $forename;
}
print map { $_\n } sort @names;Example: reading /etc/passwd
Lets 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,
well assume that the data is coming
From: William Martell mailto:[EMAIL PROTECTED] 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,
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
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,
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 conquered this
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
] = $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 that restriction.
any help would be apreciated
){
$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 array of particular size.
i don't
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
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]+) MSM SCTS\((.+)\)/)
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
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 of text. I want
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]+) MSM SCTS\((.+)\)/)
{
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, Paul Harwood
: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 in Perl
From ur example i assume that:
my @order is an array collecting all
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
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
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
:[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
W2K system and all works well. I
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;
Rob,
Good call!
You can print out the data in @bags and @bag_quantity
using Data::Dumper..
print Dumper [EMAIL PROTECTED];
http://www.coraconnection.com/paul_s/pages/catalog.html
Check this out, 'order' second and third bag in the first row.
and hit the CGI and see the results,
Rob and all the rest reading this,
Here's what fixed the problem.
The check boxes are only sent to CGI.pm if checked,
while all the input fields are sent regardless. So @bag_quantity
was filled with '0's ...
get rid of 'o's
@bag_quantity = grep(/[^0]/, @bag_quantity);
...this now seems
I am trying to build a data structure, and am tripping up here.
any suggestions?
Thx!
Dave
!/usr/bin/perl -w
snip...
@bags = param('handbag'); get all of the bags styles
@bag_quantity = param('quantity'); get all of the bags quantity
foreach my $bag (@bags){
($bag_name,$imgName) =
PROTECTED]
Subject: data structures
I am trying to build a data structure, and am tripping up here.
any suggestions?
Thx!
Dave
!/usr/bin/perl -w
snip...
@bags = param('handbag'); get all of the bags styles
@bag_quantity = param('quantity'); get all of the bags quantity
foreach my
Good afternon,
I am not seeing consistent results from my script below.
It seems that sometimes it works and other times I get '0's in
the quantity field.
As I don't write PERL often enough this is probably poorly written code!
Thanks for any help.
Dave
HTML at:
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 actually comes in a later part of the process, after you
have decided what you want to do with the information in general terms.
If you wish
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
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: 'Perl
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 realizing from previous help
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 Storable for other
solutions
-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 data
structures to a
file. I.e. hashes with several
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
-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 will undefine a variable if used
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 about
:23PM -0400, Bob Showalter
([EMAIL PROTECTED]) said something similar to:
-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
How would I store (and access) a table of
information...assuming there is a unique key
'email'...ie -
These are the column names:
email firstName lastName phone address1
[EMAIL PROTECTED] Joe Blow 415-555- 123
Mayberry
[EMAIL PROTECTED] John Doe 619-555-5551 456 Happy
Ln.
etc...etc...
This is a very broad question, so giving a specific answer is difficult
to say the least, but since no one else has responded I will provide at
least this much
You are going to want to be looking at using a hash of hashes
essentially you create a hash where each key is the email address
ur mail title says data structure but ur problem doe not seem to
be of the nature.
please be a little more clear.
store and retreive, there are as many options as u want.
what do u exactly r lookign for???
regards
vicki
On Wed, 24 Jul 2002 Anthony E. wrote :
How would I store (and access) a
push (@myVar, @$_) for @$stats;
push (@myVar, @$_) for @$totals;
push (@myVar, $_) for @$loads;
-Original Message-
From: Kipp, James [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 10:32 AM
To: [EMAIL PROTECTED]
Subject: combining data structures into one array
I have
: Shishir K. Singh
Sent: Tuesday, June 18, 2002 10:55 AM
To: Kipp, James; [EMAIL PROTECTED]
Subject: RE: combining data structures into one array
push (@myVar, @$_) for @$stats;
push (@myVar, @$_) for @$totals;
push (@myVar, $_) for @$loads;
-Original Message-
From: Kipp, James
this won't work, will just push one array onto another.
thanks
-Original Message-
From: Shishir K. Singh [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 10:55 AM
To: Kipp, James; [EMAIL PROTECTED]
Subject: RE: combining data structures into one array
push (@myVar
-Original Message-
From: Kipp, James [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 10:32 AM
To: [EMAIL PROTECTED]
Subject: combining data structures into one array
I have a subroutine that returns 3 array refs. so i have:
my ($stats, $totals, $loads) = gets_stats
]
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
push (@myVar, @$_) for @$stats;
push (@myVar, @$_) for @$totals;
push (@myVar
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
I am
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]
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 to combine the
-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 totals, such that the
nth entry in stats matches
],
[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]
Subject: RE: combining data structures into one array
Oops
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: RE: combining data structures into one
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
: 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, $totals
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 unsubscribe,
1 - 100 of 125 matches
Mail list logo