Re: Google Sheets API Data Structure

2019-08-16 Thread Илья Рассадин
Hi! Have you looked on https://metacpan.org/pod/Net::Google::Spreadsheets::V4? It's newer, so probably It can give you a bit more data from modern Google API On 16/08/2019 14:18, James Kerwin wrote: Thanks Dave and Mike, I am using Net::Google::Spreadsheets and all the associated modules a

Re: Google Sheets API Data Structure

2019-08-16 Thread James Kerwin
Thanks Dave and Mike, I am using Net::Google::Spreadsheets and all the associated modules and yeah there I slept on this and then managed to see what could be seen this morning: print Dumper($ws[0]{atom}); print Dumper($ws[0]{container}); I should have been a bit clearer on what I was hoping to

Re: Google Sheets API Data Structure

2019-08-16 Thread David Precious
On Thu, 15 Aug 2019 16:18:57 +0100 James Kerwin wrote: > I'm currently investigating a data structure that it gives me to see > what values I can get from it. Through random experimentation I've > managed to find that it had "title" and "id". > > I wr

Re: Google Sheets API Data Structure

2019-08-16 Thread Mike
Please state the exact module name. Is it this one: https://metacpan.org/pod/Net::Google::Spreadsheets::V4 My guess is no. Mike On 8/15/2019 10:18 AM, James Kerwin wrote: Hi All, I managed to get the Google Sheets API Perl module working. I'm currently investigating a data structure

Google Sheets API Data Structure

2019-08-15 Thread James Kerwin
Hi All, I managed to get the Google Sheets API Perl module working. I'm currently investigating a data structure that it gives me to see what values I can get from it. Through random experimentation I've managed to find that it had "title" and "id". I wrote

Re: data structure for Template Toolkit

2018-10-31 Thread Rick T
Linux > On Oct 31, 2018, at 6:21 AM, Mike Flannigan wrote: > > > Are you on Linux or using Strawberry Perl? > I used Activestate for 15+ years and I was surprised > by how easy it was to move to Strawberry Perl about > 3 years ago. It's pretty darn easy to install modules > with Strawberry

Re: data structure for Template Toolkit

2018-10-31 Thread Mike Flannigan
Are you on Linux or using Strawberry Perl? I used Activestate for 15+ years and I was surprised by how easy it was to move to Strawberry Perl about 3 years ago.  It's pretty darn easy to install modules with Strawberry Perl and seems to work every time. Mike Uri, thanks for the boatload of us

Re: data structure for Template Toolkit

2018-10-30 Thread perl
Thanks, Brandon! I’m hosted at FutureQuest.net , which has Linux servers. So, nothing oddball or demanding about the environment. But my familiarty with Unix/Linux programming is almost nil, so I sweat over stuff that would seem clear to most programmers. — Rick > On O

Re: data structure for Template Toolkit

2018-10-30 Thread Brandon McCaig
Sorry for the noise. This reply was intended for on-list, but apparently I'm a bit rusty and hit the wrong key. On Tue, Oct 30, 2018 at 02:41:46PM -0400, Brandon McCaig wrote: > On Tue, Oct 30, 2018 at 07:34:11AM -0500, Rick T wrote: > > Still, if anyone can point me to a “beginners guide” to usin

Re: data structure for Template Toolkit

2018-10-30 Thread perl
Looks like a good place to start. When I get the courage, I’ll plunge in! — Rick > On Oct 30, 2018, at 12:40 PM, Shlomi Fish wrote: > > Hi Rick, > > On Tue, 30 Oct 2018 07:34:11 -0500 > Rick T mailto:p...@reason.net>> wrote: > >> Uri, thanks for the boatload of useful suggestions! I will am b

Re: data structure for Template Toolkit

2018-10-30 Thread Rick T
Uri, thanks for the boatload of useful suggestions! I will am busying myself with understanding and applying them. Regarding Template::Simple, this module isn’t among the many that my host has installed, and I have not had success trying to learn how to install stuff from CPAN. Fortunately I’m

Re: data structure for Template Toolkit

2018-10-29 Thread Uri Guttman
On 10/28/18 4:45 PM, Rick T wrote: As a novice in perl I realize that it’s a bit presumptuous for me to attempt references and complex data structures. But I had a need and gave it a shot — a failing shot. I’ve been fiddling with my failure, almost mindlessly, all weekend; now I need some help.

Re: data structure for Template Toolkit

2018-10-29 Thread perl
Many thanks to Andrew and Mike — your suggestions worked and gave me a lot to think about as well! That’s what love about this mailing list: I always learn a lot! Rick Triplett > I hope somebody has replied already. > If not, in general you are reading data from DATA, > creating an array and

Re: data structure for Template Toolkit

2018-10-29 Thread Mike Flannigan
I hope somebody has replied already. If not, in general you are reading data from DATA, creating an array and a hash, and then creating an html file using the Template Toolkit. I think much of it looks good, but I see no use Template::Toolkit or anything similar. Do you have that?  I suspect you

Re: data structure for Template Toolkit

2018-10-28 Thread Andrew Solomon
Hi Rick, The bug is that you're calling my %list = (list => \@courses); when you should be calling my %list = (courses => \@courses); If only there were 'strict' and 'warnings' for Template! :-) Andrew On Sun, Oct 28, 2018 at 8:52 PM Rick T wrote: > As a novice in perl I realize that it’s

data structure for Template Toolkit

2018-10-28 Thread Rick T
As a novice in perl I realize that it’s a bit presumptuous for me to attempt references and complex data structures. But I had a need and gave it a shot — a failing shot. I’ve been fiddling with my failure, almost mindlessly, all weekend; now I need some help. Below is the template segment I am

Re: Passing hash ref [ was Re: finding head and tail in data structure

2013-01-11 Thread budi pearl
Hi Jim, On Fri, Jan 11, 2013 at 1:54 PM, Jim Gibson wrote: > OR > > print_path( $id, $routes->{$id} ); > ... > sub print_path > { > ... > while( my ($start, $end) = each %$edges ) { > > This is what i want, thank you! Apparently passing "$routes->{$id}" is my earlier issue. --budi

Re: Passing hash ref [ was Re: finding head and tail in data structure

2013-01-10 Thread Jim Gibson
On Jan 10, 2013, at 7:33 PM, budi pearl wrote: > Hi All, > > I would like to pass hash: %{$routes{"ROUTE-252"}} instead of %routes but > got this error: > > [budi@dev bin]$ ./print_path.pl > Type of arg 1 to each must be hash (not hash element) at > ./print_path.plline 38, near "}) " > Executio

Re: Passing hash ref [ was Re: finding head and tail in data structure

2013-01-10 Thread budi pearl
On Fri, Jan 11, 2013 at 11:05 AM, budi pearl wrote: > Hi Shawn, > > When trying to accessed inside subroutine , i got: > > Type of arg 1 to each must be hash (not hash element) at ./print_path.plline > 41, near "}) " > > Execution of ./print_path.pl aborted due to compilation errors. > > > this

Re: Passing hash ref [ was Re: finding head and tail in data structure

2013-01-10 Thread budi pearl
Hi Shawn, When trying to accessed inside subroutine , i got: Type of arg 1 to each must be hash (not hash element) at ./print_path.plline 41, near "}) " Execution of ./print_path.pl aborted due to compilation errors. this is work: while (my ($start, $end) = each %{$routes{$label}}) { but thi

Re: Passing hash ref [ was Re: finding head and tail in data structure

2013-01-10 Thread Shawn H Corey
On Fri, 11 Jan 2013 10:33:02 +0700 budi pearl wrote: > my $id = "ROUTE-252"; > print Dumper $routes{$id}; > > print_path($id, \%{$routes{$id}}); I think you want: print_path( $id, $routes{$id} ); -- Don't stop where the ink does. Shawn -- To unsubscribe, e-mail: beginners-unsubs

Passing hash ref [ was Re: finding head and tail in data structure

2013-01-10 Thread budi pearl
Hi All, I would like to pass hash: %{$routes{"ROUTE-252"}} instead of %routes but got this error: [budi@dev bin]$ ./print_path.pl Type of arg 1 to each must be hash (not hash element) at ./print_path.plline 38, near "}) " Execution of ./print_path.pl aborted due to compilation errors. #use

Re: finding head and tail in data structure

2013-01-10 Thread budi pearl
Hi Rob, This works and looks much more simpler. Thanks, i love it. --budhi On Fri, Jan 11, 2013 at 1:00 AM, Rob Dixon wrote: > On 10/01/2013 10:01, budi perl wrote: > >> Hi, >> >> I have this following hash: >> >> #!/usr/bin/perl >> # >> use strict; >> use Data::Dumper; >> >> my %MYROUTES = (

Re: finding head and tail in data structure

2013-01-10 Thread Rob Dixon
On 10/01/2013 10:01, budi perl wrote: Hi, I have this following hash: #!/usr/bin/perl # use strict; use Data::Dumper; my %MYROUTES = ( "ROUTE-252" => { # src => dest 427 => "ABEP", "ABEP" => 441, 441 => 427, 427 => 444, 444 => "MGWQ",

Re: finding head and tail in data structure

2013-01-10 Thread budi pearl
On Thu, Jan 10, 2013 at 5:19 PM, David Precious wrote: > On Thu, 10 Jan 2013 17:01:43 +0700 > budi perl wrote: > You can't have the same hash key twice; you've duplicated 427 there. > > Also, you don't need to quote the left side of a fat comma, so you can > just as easily say e.g. ABEP => 441. >

Re: finding head and tail in data structure

2013-01-10 Thread David Precious
On Thu, 10 Jan 2013 17:01:43 +0700 budi perl wrote: > Hi, > > I have this following hash: > > #!/usr/bin/perl > # > use strict; > use Data::Dumper; > > my %MYROUTES = ( > "ROUTE-252" => { > # src => dest >427 => "ABEP", >"ABEP" => 441, >441 => 427, >427

finding head and tail in data structure

2013-01-10 Thread budi perl
Hi, I have this following hash: #!/usr/bin/perl # use strict; use Data::Dumper; my %MYROUTES = ( "ROUTE-252" => { # src => dest 427 => "ABEP", "ABEP" => 441, 441 => 427, 427 => 444, 444 => "MGWQ", "MGWQ" => "CDEF" }, "ROUTE-432" => {

combining data structure

2012-12-13 Thread shawn wilson
I'm having some issues getting this to work correctly and hoped y'all might let me know where i'm going wrong here (and maybe some code review as some of this looks ugly to me): #!/usr/bin/env perl use strict; use warnings; use Config::Any; use Data::Dumper; my $config = Config::Any->load_file

Re: Inserting a new data structure in a bless reference

2012-01-15 Thread David Christensen
On 01/13/2012 07:25 PM, Parag Kalra wrote: my $obj = FooBar->new; $obj->{'new_key'} = 'some_value' Now I am not sure if that is the correct way of inserting a new data structure into an already bless reference 1. FooBar may or may not be implemented as a hashref.

Re: Inserting a new data structure in a bless reference

2012-01-14 Thread Shawn H Corey
w I am not sure if that is the correct way of inserting a new data structure into an already bless reference My aim to use this data structure across the script and FooBar through the object -$obj once added. This could cause problems if a new version of FooBar starts using new_key. Instead, creat

Re: Inserting a new data structure in a bless reference

2012-01-13 Thread Jeff Peng
于 2012-1-14 11:25, Parag Kalra 写道: use FooBar; my $obj = FooBar->new; Do something ... $obj->{'new_key'} = 'some_value' Now I am not sure if that is the correct way of inserting a new data structure into an already bless reference I don't thin

Inserting a new data structure in a bless reference

2012-01-13 Thread Parag Kalra
ay of inserting a new data structure into an already bless reference My aim to use this data structure across the script and FooBar through the object -$obj once added.

Re: complex data structure

2011-11-14 Thread Shlomi Fish
On Mon, 14 Nov 2011 23:06:15 -0600 Chris Stinemetz wrote: > Thank you Shlomi. > > For some reason my final value for the keys is being repeated 24 times so I > am guessing I have an issue with how I am iterating over the hashes. > > I can't seem to find the correct way to fix it so the value di

Re: complex data structure

2011-11-14 Thread Chris Stinemetz
Thank you Shlomi. For some reason my final value for the keys is being repeated 24 times so I am guessing I have an issue with how I am iterating over the hashes. I can't seem to find the correct way to fix it so the value displays once. Any help is greatly appreciated. An example of the output

Re: complex data structure

2011-11-13 Thread Shlomi Fish
Hi Chris, On Mon, 14 Nov 2011 00:31:19 -0600 Chris Stinemetz wrote: [SNIP] > # header > print "HOUR\tCELL\tHEH_TYPE\tHEH_COUNT\n"; > # body > foreach my $hour (sort {$a <=> $b} keys %CELL){ > foreach my $cellNo (sort {$a <=> $b} keys %{$CELL{$hour}}) { > print "$hour\t $cellNo\t"; > f

Re: complex data structure

2011-11-13 Thread Chris Stinemetz
How can I iterate over this three level hash printing the results as Hour\tCell\tHEH_Type\HEH_Count $VAR1 = { '00' => { '875' => { 'CDM 1, CCU 1, CE 5' => '1' }, '13' => {

Re: complex data structure

2011-11-06 Thread Jim Gibson
At 7:37 AM -0600 11/6/11, Chris Stinemetz wrote: I would like to join the key from %cell hash to %cbr hash the dump from %cell hash looks like: '65' => { 'CDM 1, 2, CBR 3, 15MHz' => 2 }, %cell is a two-level hash with two keys needed to get to

Re: complex data structure

2011-11-06 Thread Shlomi Fish
Hi Chris, On Sun, 6 Nov 2011 07:37:26 -0600 Chris Stinemetz wrote: > I would like to join the key from %cell hash to %cbr hash > > the dump from %cell hash looks like: > > '65' => { > 'CDM 1, 2, CBR 3, 15MHz' => 2 > }, > and the dump from %cbr lo

complex data structure

2011-11-06 Thread Chris Stinemetz
I would like to join the key from %cell hash to %cbr hash the dump from %cell hash looks like: '65' => { 'CDM 1, 2, CBR 3, 15MHz' => 2 }, and the dump from %cbr looks like: $VAR1 = { '1' => 223, }; So that %cbr becomes: '65'=>{

Re: parsing data structure

2009-06-05 Thread William
WowThank you thank you very much, Chas. Owens, that's great...appreciate that :-) William - Original Message > From: Chas. Owens > To: William > Cc: beginner perl mailling list > Sent: Friday, June 5, 2009 22:01:41 > Subject: Re: parsing data structur

Re: parsing data structure

2009-06-05 Thread Chas. Owens
On Fri, Jun 5, 2009 at 09:19, William wrote: > > I have been trying for hours, to make this data structure into hash, I need > help. Thanks. > > $str = > " >    (dr1 >        foo >        <1>(dr2 bar) >        <2>a >    ) > ";

parsing data structure

2009-06-05 Thread William
I have been trying for hours, to make this data structure into hash, I need help. Thanks. $str = " (dr1 foo <1>(dr2 bar) <2>a ) "; $hash = { "dr1" => { "<1>" => {"dr2" => {"

Re: HoH problem representing a data structure.

2008-06-08 Thread Rob Dixon
Rodrick Brown wrote: > On Sun, Jun 8, 2008 at 10:37 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> > wrote: > >> Rodrick Brown wrote: >> >>> #!/usr/bin/perl -w >>> >> The -w switch is redundant, since you have "use warnings;". >> >> use strict; >>> use warnings; >>> use Data::Dumper; >>> my $file = '

Re: HoH problem representing a data structure.

2008-06-08 Thread Gunnar Hjalmarsson
Rodrick Brown wrote: On Sun, Jun 8, 2008 at 10:37 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: push @{ $hash->{$homeDir} }, $user; Yes please explain how exactly that line works? I know @{} dereferences an array so it looks like your pushing each user into an anonymous array. Yes, t

Re: HoH problem representing a data structure.

2008-06-08 Thread Rodrick Brown
On Sun, Jun 8, 2008 at 10:37 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > Rodrick Brown wrote: > >> >> #!/usr/bin/perl -w >> > > The -w switch is redundant, since you have "use warnings;". > > use strict; >> use warnings; >> use Data::Dumper; >> my $file = '/etc/passwd'; >> my $hash; >> my

Re: HoH problem representing a data structure.

2008-06-08 Thread Gunnar Hjalmarsson
Rodrick Brown wrote: #!/usr/bin/perl -w The -w switch is redundant, since you have "use warnings;". use strict; use warnings; use Data::Dumper; my $file = '/etc/passwd'; my $hash; my ($user, $homeDir); my $count=0; Why did you declare that variable? open(my $fh, "<", $file) or die("Fatal

Re: HoH problem representing a data structure.

2008-06-08 Thread Rodrick Brown
' => { '_www', 'apache' }, } On Sun, Jun 8, 2008 at 5:22 AM, John W. Krahn <[EMAIL PROTECTED]> wrote: > Rodrick Brown wrote: > >> I'm trying

Re: HoH problem representing a data structure.

2008-06-08 Thread Aruna Goke
Rodrick Brown wrote: I'm trying to fully understand references so I created a data structure to stores the output of users on my system who share home dirs. I use a HoH to represent this data set but its not working as expected. Conceptually I can visualize how the data should look but I

Re: HoH problem representing a data structure.

2008-06-08 Thread Aruna Goke
Rodrick Brown wrote: I'm trying to fully understand references so I created a data structure to stores the output of users on my system who share home dirs. I use a HoH to represent this data set but its not working as expected. Conceptually I can visualize how the data should look but I

Re: HoH problem representing a data structure.

2008-06-08 Thread John W. Krahn
Rodrick Brown wrote: I'm trying to fully understand references so I created a data structure to stores the output of users on my system who share home dirs. I use a HoH to represent this data set but its not working as expected. Conceptually I can visualize how the data should look Perha

HoH problem representing a data structure.

2008-06-08 Thread Rodrick Brown
I'm trying to fully understand references so I created a data structure to stores the output of users on my system who share home dirs. I use a HoH to represent this data set but its not working as expected. Conceptually I can visualize how the data should look but I cant get the outpu

Re: Tree data structure

2007-11-20 Thread Vijay Kumar Adhikari
> Perhaps if you told us what you need > a tree for (because you almost never need a tree for itself) we could > suggest a good high level module. I am trying to analyze BGP routing table available at RouteViews routing archive. The data looks something like 1.0.0.0/8 1 2 3 4 5 6

Re: Tree data structure

2007-11-20 Thread Chas. Owens
On Nov 20, 2007 12:30 PM, Vijay Kumar Adhikari <[EMAIL PROTECTED]> wrote: > > Perhaps if you told us what you need > > a tree for (because you almost never need a tree for itself) we could > > suggest a good high level module. > > I am trying to analyze BGP routing table available at RouteViews > r

Re: Tree data structure

2007-11-20 Thread Chas. Owens
g called Tree::Nary which is not very useful > to me. Thank you. snip If you search CPAN* for tree you will find many implementations, but it is not common to use data structures directly. Unless you are doing something no one else has ever done, you are likely to find a module on CPAN that does wha

Re: Tree data structure

2007-11-20 Thread vijay
Thanks for the help. I have another question. How do I compute the depth of those trees. Do I need to first find the root of the tree and then try of find the depth of the tree? Is there a more efficient algorithm to find the depth? Is there a "Tree" module that I can use. I could only find somethi

Re: Tree data structure

2007-11-14 Thread Chas. Owens
G. > > However, I could not find a way to test if it is a tree. > snip > > If my understanding of the graph data structure is correct you should > be ably to test for whether a graph is a tree or not like this snip I am an idiot, the grep in the previous code was wasteful. p

Re: Tree data structure

2007-11-14 Thread Chas. Owens
ng of the graph data structure is correct you should be ably to test for whether a graph is a tree or not like this #!/usr/bin/perl use warnings; use strict; use Graph; my $tree = Graph->new; $tree->add_edge("d", "b"); $tree->add_edge("b", "a&quo

Tree data structure

2007-11-14 Thread vijay
I am trying to use Graph::Directed to test if a structure is a DAG or a tree. There is a simple method to test whether the graph is a DAG. However, I could not find a way to test if it is a tree. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http

Fw: Help needed created this data structure

2007-07-10 Thread Chris Charley
- Original Message - From: "Chris Charley" <[EMAIL PROTECTED]> To: "klute" <[EMAIL PROTECTED]> Sent: Tuesday, July 10, 2007 7:17 PM Subject: Re: Help needed created this data structure - Original Message - From: "klute" <[EMA

Re: Help needed created this data structure

2007-07-10 Thread klute
t; > From: "klute" <[EMAIL PROTECTED]> > > > > Newsgroups: perl.beginners > > > > To: > > > > Sent: Monday, July 09, 2007 4:20 PM > > > > Subject: Help needed created this data > structure > > > > > > > &

Re: Help needed created this data structure

2007-07-10 Thread klute
roups: perl.beginners > > > To: > > > Sent: Monday, July 09, 2007 4:20 PM > > > Subject: Help needed created this data structure > > > > > > > Hi All, > > > > > > > > I am new to Perl and was hoping to get advice > on > &g

Re: Help needed created this data structure

2007-07-09 Thread usenet
On Jul 9, 2:04 pm, [EMAIL PROTECTED] (Klute) wrote: > Here is the sample data: That helps us provide a meaningful reply. Something like this will work, though you may want to make the regexp's a little more generalized: #!/usr/bin/perl use strict; my (%affiliate, $parent, $group); whi

Re: Help needed created this data structure

2007-07-09 Thread D. Bolliger
klute am Montag, 9. Juli 2007 23:04: > --- Chris Charley <[EMAIL PROTECTED]> wrote: > > - Original Message - > > From: "klute" <[EMAIL PROTECTED]> > > Newsgroups: perl.beginners > > To: > > Sent: Monday, July 09, 2007 4:20

Re: Help needed created this data structure

2007-07-09 Thread klute
D]> wrote: > > - Original Message - > From: "klute" <[EMAIL PROTECTED]> > Newsgroups: perl.beginners > To: > Sent: Monday, July 09, 2007 4:20 PM > Subject: Help needed created this data structure > > > > Hi All, > > > > I am ne

Re: Help needed created this data structure

2007-07-09 Thread Chris Charley
- Original Message - From: "klute" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: Sent: Monday, July 09, 2007 4:20 PM Subject: Help needed created this data structure Hi All, I am new to Perl and was hoping to get advice on creating the following data struc

Help needed created this data structure

2007-07-09 Thread klute
Hi All, I am new to Perl and was hoping to get advice on creating the following data structure: I have an Affiliate Parent Groups, Affiliate Groups, and Affiliates. Each affiliate has affiliateId, affiliateName. I guess what I'd like to have is an array of hashes where the array would co

Re: Data structure key as a literal string

2006-04-06 Thread Chas Owens
On 4/6/06, Jeff Pang <[EMAIL PROTECTED]> wrote: > > > >You should consider RTFM'ing. > > > Hello,what's RTFM then? snip Read The Furnished Materials Read The Fine Manual Read The F'ing Manual etc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Data structure key as a literal string

2006-04-06 Thread Jeff Pang
> >You should consider RTFM'ing. > Hello,what's RTFM then? -- Jeff Pang NetEase AntiSpam Team http://corp.netease.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Data structure key as a literal string

2006-04-06 Thread Chas Owens
On 4/6/06, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > On Thu, 2006-06-04 at 19:48 -0700, Randal L. Schwartz wrote: > > Perl interpreter: me reading the answer to them from the Fine Manual. > > OK, I'll bite. What's a 'Fine Manual?" (You're not going to charge me > money for this, are you?) sni

Re: Data structure key as a literal string

2006-04-06 Thread Mr. Shawn H. Corey
On Thu, 2006-06-04 at 19:48 -0700, Randal L. Schwartz wrote: > Perl interpreter: me reading the answer to them from the Fine Manual. OK, I'll bite. What's a 'Fine Manual?" (You're not going to charge me money for this, are you?) -- __END__ Just my 0.0002 million dollars worth, --- Shawn

Re: Data structure key as a literal string

2006-04-06 Thread Randal L. Schwartz
> "Ryan" == Ryan Gies <[EMAIL PROTECTED]> writes: Ryan> Now I'm confused, what's the difference between a Perl interrupter and a Ryan> Perl interpreter? Or, what perldoc is that info in? Perl interrupter: someone who IM's me with a Perl question. Perl interpreter: me reading the answer to th

Re: Data structure key as a literal string

2006-04-06 Thread Mr. Shawn H. Corey
On Thu, 2006-06-04 at 16:06 -0500, JupiterHost.Net wrote: > my $fruit = $hash->{'food'}{'fruit'}[0]; > print "Name: $fruit->{'name'}\n", "Color: $fruit->{'color'}\n"; That should be: my $fruit = $hash{'food'}{'fruit'}[0]; 'hash' is a real hash, not a reference. -- __END__ Just my 0.000

Re: Data structure key as a literal string

2006-04-06 Thread Mr. Shawn H. Corey
On Thu, 2006-06-04 at 14:38 -0700, Ryan Gies wrote: > Now I'm confused, what's the difference between a Perl interrupter and a > Perl interpreter? Or, what perldoc is that info in? Oops. You are correct. That should have been 'interpreter'. -- __END__ Just my 0.0002 million dollars worth

Re: Data structure key as a literal string

2006-04-06 Thread Ryan Gies
ing *eval* in the below snippet at line 19: my $value = eval $key; Please say this is a late April Fool's joke. Your suggested use of eval is not optimal. This is the fastest, and easiest to understand, method of extracting data from a data structure: my $value = $hash{food}{fruit}[0

Re: Data structure key as a literal string

2006-04-06 Thread JupiterHost.Net
Ryan Gies wrote: With the intention of optimization, I am looking for a way around using *eval* in the below snippet at line 19: my $value = eval $key; The objective is to get from $key to $value, knowing that $key is a literal string. Thank you for an insights! #!/usr/bin/perl -w

Re: Data structure key as a literal string

2006-04-06 Thread Mr. Shawn H. Corey
not optimal. This is the fastest, and easiest to understand, method of extracting data from a data structure: my $value = $hash{food}{fruit}[0]; The way use you eval is a string eval, which is very costly in terms of processing time. The Perl interrupter must be restarted every time this stateme

Data structure key as a literal string

2006-04-06 Thread Ryan Gies
With the intention of optimization, I am looking for a way around using *eval* in the below snippet at line 19: my $value = eval $key; The objective is to get from $key to $value, knowing that $key is a literal string. Thank you for an insights! #!/usr/bin/perl -w use strict; use Data:

Re: What is the best way to release memory from data structure?

2005-04-19 Thread Offer Kaye
On 4/19/05, Ley, Chung wrote: > Hi, > > I have a complex data structure using hash of hash of hash that I need to > hold one unit of > data that I need to process. After finishing processing this unit, I need to > go to the 2nd > unit; each unit will be approx. 10Meg

What is the best way to release memory from data structure?

2005-04-19 Thread Ley, Chung
Hi, I have a complex data structure using hash of hash of hash that I need to hold one unit of data that I need to process. After finishing processing this unit, I need to go to the 2nd unit; each unit will be approx. 10Meg of data. What is the "quick" and "efficient" w

Re: complex data structure

2005-01-11 Thread Ing. Branislav Gerzo
[EMAIL PROTECTED] [m], on Monday, January 10, 2005 at 13:23 (-0500) made these points: mon> I can try, I personaly perfer RoHoH..., looks like you have RoHoAoH thanks, maybe I will change that to RoHoH, I'd like to insert those values to database, where keys will be name of columns. -- ...m8s

Re: complex data structure

2005-01-10 Thread John W. Krahn
Ing. Branislav Gerzo wrote: Hi pals, Hello, How can I add values to hash, when key is the same ? Example: my %ha = ( 'test1' => [ { 'test1_a' => 'a', 'test1_b' => 'b', }, {

Re: complex data structure

2005-01-10 Thread Chris Charley
- Original Message - From: <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Chris Charley" <[EMAIL PROTECTED]> Cc: Sent: Monday, January 10, 2005 1:23 PM Subject: Re: complex data structure - Original Message - From: Chris Charley <[EMAIL PROTECTE

Re: complex data structure

2005-01-10 Thread mgoland
- Original Message - From: Chris Charley <[EMAIL PROTECTED]> Date: Monday, January 10, 2005 12:59 pm Subject: Re: complex data structure > I hope someone can explain this related question. When I run the > code below I can try, I personaly perfer RoHoH..., looks like you

Re: complex data structure

2005-01-10 Thread Chris Charley
I hope someone can explain this related question. When I run the code below on Brano's data structure, 'each' gives me false results but 'keys' gives me correct results. I'm kind of stumped! #!/usr/bin/perl use strict; use warnings

Re: complex data structure

2005-01-10 Thread Ing. Branislav Gerzo
Moon, John [MJ], on Monday, January 10, 2005 at 07:31 (-0500) made these points: MJ> Hope this helps .. thanks a lot for your time, I appreciate that! -- ...m8s, cu l8r, Brano. [Rifles don't pick up the phone in the middle of a down load] -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: complex data structure

2005-01-10 Thread Ing. Branislav Gerzo
Ing. Branislav Gerzo [IBG], on Monday, January 10, 2005 at 13:03 (+0100) thinks about: IBG> How can I add values to hash, when key is the same ? Example: I am answering to myself: writing own code should be complex, why not to use module for that? try a look at: http://search.cpan.org/~mneylon/H

RE: complex data structure

2005-01-10 Thread Moon, John
Subject: complex data structure Hi pals, How can I add values to hash, when key is the same ? Example: my %ha = ( 'test1' => [ { 'test1_a' => 'a',

complex data structure

2005-01-10 Thread Ing. Branislav Gerzo
Hi pals, How can I add values to hash, when key is the same ? Example: my %ha = ( 'test1' => [ { 'test1_a' => 'a', 'test1_b' => 'b', }, { 'test1_a

Re: how big is my data structure

2004-03-08 Thread R. Joseph Newton
"Michael C. Davis" wrote: > Hi, is there a good way to tell how much memory a given data structure is > consuming? I realize that there are issues in using this number to > determine runtime memory requirements (like the fact that, in some > circumstances, a running Perl

Re: how big is my data structure

2004-03-08 Thread R. Joseph Newton
WC -Sx- Jones wrote: > Michael C. Davis wrote: > > Hi, is there a good way to tell how much memory a given data structure is > > consuming? I realize that there are issues in using this number to > > determine runtime memory requirements (like the fact that, in some > &g

Re: how big is my data structure

2004-03-08 Thread WC -Sx- Jones
John W. Krahn wrote: length() evaluates its argument in scalar context and an array in scalar context returns the number of elements in the array so you are getting the length of the number of elements. John I love you ma :) (With apologises to Animal House.) @array = 1 .. 99; do {

Re: how big is my data structure

2004-03-08 Thread John W. Krahn
Wc -Sx- Jones wrote: > > Michael C. Davis wrote: > > Hi, is there a good way to tell how much memory a given data structure is > > consuming? I realize that there are issues in using this number to > > determine runtime memory requirements (like the fact that, in s

Re: how big is my data structure

2004-03-08 Thread Michael C. Davis
At 08:57 PM 3/8/04 +0100, Paul Johnson wrote: >On Mon, Mar 08, 2004 at 01:20:26PM -0600, Michael C. Davis wrote: > >> Hi, is there a good way to tell how much memory a given data structure is >> consuming? I realize that there are issues in using this number to >>

Re: how big is my data structure

2004-03-08 Thread Paul Johnson
On Mon, Mar 08, 2004 at 01:20:26PM -0600, Michael C. Davis wrote: > Hi, is there a good way to tell how much memory a given data structure is > consuming? I realize that there are issues in using this number to > determine runtime memory requirements (like the fact that, in some > c

Re: how big is my data structure

2004-03-08 Thread WC -Sx- Jones
Michael C. Davis wrote: Hi, is there a good way to tell how much memory a given data structure is consuming? I realize that there are issues in using this number to determine runtime memory requirements (like the fact that, in some circumstances, a running Perl process does not give back

how big is my data structure

2004-03-08 Thread Michael C. Davis
Hi, is there a good way to tell how much memory a given data structure is consuming? I realize that there are issues in using this number to determine runtime memory requirements (like the fact that, in some circumstances, a running Perl process does not give back allocated memory to the

Re: what is this data structure?

2004-02-05 Thread R. Joseph Newton
Dan Anderson wrote: > However a hash is just an even valued list, so %hash1 is the same as > %hash2: > So that instead of accessing elements by $hash1{foo} you'd access them > by $hash1->{foo}. > > I think I've successfully improved, right? Yes. You're closer, but still a little off.: > However

Re: what is this data structure?

2004-01-17 Thread Dan Anderson
> You're terminology is a little confusing, but I think you have the > right idea. For the benefit of the original poster: The => symbol is usually used to signify a hash and automatically quote the key to the left of it. I.e.: my %hash1 = ( foo => 'bar', bar => 'baz'

Re: what is this data structure?

2004-01-17 Thread James Edward Gray II
On Jan 17, 2004, at 2:16 PM, Dan Anderson wrote: On Sat, 2004-01-17 at 15:12, James Edward Gray II wrote: On Jan 17, 2004, at 2:02 PM, Dan Anderson wrote: On Fri, 2004-01-16 at 11:03, Jack Chen wrote: Hi, I don't know how to work with this data structure: my @array = ((a =>

Re: what is this data structure?

2004-01-17 Thread Randy W. Sims
On 1/17/2004 3:16 PM, Dan Anderson wrote: On Sat, 2004-01-17 at 15:12, James Edward Gray II wrote: On Jan 17, 2004, at 2:02 PM, Dan Anderson wrote: On Fri, 2004-01-16 at 11:03, Jack Chen wrote: Hi, I don't know how to work with this data structure: my @array = ((a =>

  1   2   >