Re: hash reference question

2010-01-21 Thread Uri Guttman
> "JG" == Jim Green writes: JG> i have a question for the following perl code, by changing the value JG> in %h3, the script also changes the value for %h4, I vaguely JG> understand it is because %h3's key is reference to %h2, %h2's key is JG> reference to %h1, JG> so by changing v

Re: hash reference question

2010-01-21 Thread Shawn H Corey
Jim Green wrote: > i have a question for the following perl code, by changing the value > in %h3, the script also changes the value for %h4, I vaguely > understand it is because %h3's key is reference to %h2, %h2's key is > reference to %h1, > > so by changing value in %h3, the script also change

hash reference question

2010-01-21 Thread Jim Green
i have a question for the following perl code, by changing the value in %h3, the script also changes the value for %h4, I vaguely understand it is because %h3's key is reference to %h2, %h2's key is reference to %h1, so by changing value in %h3, the script also changes the value for %h4, I was wo

Re: reference question

2008-09-30 Thread John W. Krahn
Subject: RE: reference question V.Ramkumar wrote: Hi List, How to find out the existence of duplicate values in perl array. What does that have to do with "reference question"? John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts

RE: reference question

2008-09-30 Thread V.Ramkumar
Hi List, How to find out the existence of duplicate values in perl array. Regards, Ramkumar -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: reference question

2008-09-29 Thread Richard Lee
Rob Dixon wrote: Richard Lee wrote: one more question on reference, if say you have sub as below Your code is badly wrong. Please let me correct it first. my @arrayref; sub do_something { my $something = @_; That will set $something to the number of parameters pas

Re: reference question

2008-09-29 Thread Chris Charley
From: ""Chris Charley"" From: "Richard Lee" one more question on reference, if say you have sub as below my @arrayref; sub do_something { my $something = @_; open FILE, "$something", or die; while () { my @array = map (split /,/)[1,2,3,5]; push @a

Re: reference question

2008-09-29 Thread Chris Charley
From: "Richard Lee" one more question on reference, if say you have sub as below my @arrayref; sub do_something { my $something = @_; open FILE, "$something", or die; while () { my @array = map (split /,/)[1,2,3,5]; push @arrayref, [EMAIL PROTECTED

Re: reference question

2008-09-29 Thread Rob Dixon
Richard Lee wrote: > > one more question on reference, > > if say you have sub as below Your code is badly wrong. Please let me correct it first. > my @arrayref; > > sub do_something { > my $something = @_; That will set $something to the number of parameters passed in @_ To retrieve

reference question

2008-09-29 Thread Richard Lee
one more question on reference, if say you have sub as below my @arrayref; sub do_something { my $something = @_; open FILE, "$something", or die; while () { my @array = map (split /,/)[1,2,3,5]; push @arrayref, [EMAIL PROTECTED]; } clos

Re: Anonymous Reference Question

2005-09-28 Thread Jeff 'japhy' Pinyan
On Sep 28, Dave Adams said: #!/usr/bin/perl -w use strict; use Data::Dumper; my $grades = {"tom"=> 50, "sally"=> 60, "harry" => 70}; print Dumper($grades) ; And perl gives me this: $VAR1 = { 'harry' => 70, 'sally' => 60, 'tom' => 50 }; QUESTION: Does this mea

Anonymous Reference Question

2005-09-28 Thread Dave Adams
When I do this: #!/usr/bin/perl -w use strict; use Data::Dumper; my $grades = {"tom"=> 50, "sally"=> 60, "harry" => 70}; print Dumper($grades) ; And perl gives me this: $VAR1 = { 'harry' => 70, 'sally' => 60, 'tom' => 50 }; QUESTION: Does this mean that $

Re: Another reference question (hash of hash references)

2003-08-14 Thread Tim Musson
Thanks Rob, My MUA believes you used Internet Mail Service (5.5.2653.19) to write the following on Friday, August 8, 2003 at 8:43:43 AM. HR> # store access the internal hash by following the reference "->" $hash{four}->>{uid} = "uid4"; $hash{four}->>{cn} = "cn4"; $hash{four}->>{group} = "Group4";

RE: Another reference question (hash of hash references)

2003-08-14 Thread Bob Showalter
Tim Musson wrote: > beginners, > > I am trying to build a hash of hash references. My problem is that I > need to be able to add a key/value pair to the internal hashes... > > ,- [ Here is my test code (yes, I am working with LDAP) ] #!perl > use strict; > use warnings; > > my %hash = (

RE: Another reference question (hash of hash references)

2003-08-14 Thread Bob Showalter
Hanson, Rob wrote: > > Any suggestions on how I can do this? > > Yes. > > # init the hash key > $hash{four} = {} unless exists $hash{four}; Due to autovivication, this is not necessary. > > # store access the internal hash by following the reference "->" > $hash{four}->{uid} = "uid4"; $hash{fo

Another reference question (hash of hash references)

2003-08-10 Thread Tim Musson
beginners, I am trying to build a hash of hash references. My problem is that I need to be able to add a key/value pair to the internal hashes... ,- [ Here is my test code (yes, I am working with LDAP) ] #!perl use strict; use warnings; my %hash = ( one => { uid => "uid1", cn => "c

RE: Another reference question (hash of hash references)

2003-08-10 Thread Hanson, Rob
up} = "Group4"; Rob -Original Message- From: Tim Musson [mailto:[EMAIL PROTECTED] Sent: Friday, August 08, 2003 8:31 AM To: [EMAIL PROTECTED] Subject: Another reference question (hash of hash references) beginners, I am trying to build a hash of hash references. My problem

Re: Reference question

2003-08-03 Thread K. Parker
I have the Camel book, and while it doesn't go very far into detail concerning XML, CGI or similar technologies, it does give a general idea. I do hold to the fact that is the best reference book for the Perl language itself. If you want to go into the specifics I'd recommend one of the books that

Re: Newbie reference question

2002-03-25 Thread Jenda Krynicky
From: "FORGHANI,BEHDAD (A-Spokane,ex1)" <[EMAIL PROTECTED]> > I am trying to make a two dimentional array. I have a function that > returns an array. The following code works: > > @x = f(); > push(@y, \@x); > > and then I can reference it @{@y[$i]}[$j}; You should write the code above like this

RE: Newbie reference question

2002-03-25 Thread David Gray
> I am trying to make a two dimentional array. I have a > function that returns an array. The following code works: > > @x = f(); > push(@y, \@x); > > and then I can reference it @{@y[$i]}[$j}; > > Is this the best way to make two dimentional arrays; I.e., > using push and reference to arrays

RE: Newbie reference question

2002-03-25 Thread Hanson, Robert
rom: FORGHANI,BEHDAD (A-Spokane,ex1) [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 4:13 PM To: [EMAIL PROTECTED] Subject: Newbie reference question Hello, I am trying to make a two dimentional array. I have a function that returns an array. The following code works: @x = f(); push(@y,

Newbie reference question

2002-03-25 Thread FORGHANI,BEHDAD (A-Spokane,ex1)
Hello, I am trying to make a two dimentional array. I have a function that returns an array. The following code works: @x = f(); push(@y, \@x); and then I can reference it @{@y[$i]}[$j}; Is this the best way to make two dimentional arrays; I.e., using push and reference to arrays? Also, I was

Re: Reference question

2001-04-23 Thread Paul Johnson
On Mon, Apr 23, 2001 at 07:32:32PM -, Stout, Joel R wrote: > Speaking of aging camels, is the Camel book still the best reference to > have? I am new to Perl and have the Llama book. It's been a good starting > place but one day I see myself moving past it. I would like something that > co

Reference question

2001-04-23 Thread Stout, Joel R
Speaking of aging camels, is the Camel book still the best reference to have? I am new to Perl and have the Llama book. It's been a good starting place but one day I see myself moving past it. I would like something that covers the language in more detail and deals with Data Munging, XML, CGI,