Re: hash question

2009-09-29 Thread Shawn H Corey
Johnson, Reginald (GTS) wrote: Thanks to all that assisted in this thread. I think I am now getting where I want to go with using hashes. One comment that I could use clarification on is: JR(> for ( $i=0; $i <= $number_of_elements-1; $i++ ) { don't loop over indices, loop over

RE: hash question

2009-09-29 Thread Johnson, Reginald (GTS)
mber 25, 2009 1:58 PM To: Johnson, Reginald (GTS) Cc: beginners@perl.org Subject: Re: hash question >>>>> "JR(" == Johnson, Reginald (GTS) writes: JR(> Sample input file "test2,MS-Windows-NT,Silver,NPRO30DINCR,Client JR(> JXWGTI7R5CHD1 WINDOWS NT,Schedule test2_f

Re: hash question

2009-09-25 Thread Jim Gibson
On 9/25/09 Fri Sep 25, 2009 12:48 PM, "Johnson, Reginald (GTS)" scribbled: > Uri, > Thank you for the assistance. I have incorporated data dumper and the " > " into the code. What I find odd is that data dumper shows the values of > the hash as I expect them to be. Yet still when I print I get

Re: hash question

2009-09-25 Thread Steve Bertrand
Johnson, Reginald (GTS) wrote: > Uri, > Thank you for the assistance. I have incorporated data dumper and the " > " into the code. What I find odd is that data dumper shows the values of > the hash as I expect them to be. Yet still when I print I get a hex > number. > > My output > > Enter the f

RE: hash question

2009-09-25 Thread Johnson, Reginald (GTS)
} print Dumper( \%policy_Hash); while ( my ($key,$value)= each %policy_Hash ) { print "$key => $value \n"; } } #end while close(INFILE); -Original Message- From: Uri Guttman [mailto

Re: hash question

2009-09-25 Thread Uri Guttman
> "JR(" == Johnson, Reginald (GTS) writes: JR(> Sample input file "test2,MS-Windows-NT,Silver,NPRO30DINCR,Client JR(> JXWGTI7R5CHD1 WINDOWS NT,Schedule test2_full_1700 FULL 604800" JR(> print "Enter the filename of input file with full path\n"; JR(> my $input_file = <>;

Re: hash question

2009-09-25 Thread Jim Gibson
On 9/25/09 Fri Sep 25, 2009 10:05 AM, "Johnson, Reginald (GTS)" scribbled: > I don't see what I am doing wrong in printing out the values in the > hash. I am inputting a file with records of varying number of fields and > want to put them in a hash. My output says Use of uninitialized value in

hash question

2009-09-25 Thread Johnson, Reginald (GTS)
I don't see what I am doing wrong in printing out the values in the hash. I am inputting a file with records of varying number of fields and want to put them in a hash. My output says Use of uninitialized value in concatenation (.) or string at sample.pl line 35, line 1. => test2 Sample input fi

Re: remote hash question

2007-11-18 Thread Tom Phoenix
On 11/18/07, Craig Petty <[EMAIL PROTECTED]> wrote: > How can i get a remote hash over the internet like in a password cracker? What do you mean by the word "hash"? In Perl, it often means a data structure like %ENV or %hash, a variable which contains key-value pairs. But there are other meanings

remote hash question

2007-11-18 Thread Craig Petty
How can i get a remote hash over the internet like in a password cracker? Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. http://overview.mail.yahoo.com/ -- To unsubscrib

Re: hash question

2005-09-06 Thread Gergely Buday
Thank you all for your answers. - Gergely -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: hash question

2005-09-06 Thread Jeff 'japhy' Pinyan
On Sep 6, Gergely Buday said: do you have a clue why is this not working? The interpreter complains about a syntax error in line 7 near $myhash. You have written '$myhash($ky)' when you meant to write '$myhash{$ky}'. You have also written '%myhash = { ... }' when you meant to write '%myhash

Re: hash question

2005-09-06 Thread Ankur Gupta
On 9/6/2005 4:50 PM Gergely Buday wrote: Hi there, do you have a clue why is this not working? The interpreter complains about a syntax error in line 7 near $myhash. Seems like you are confused with the brackets... #!/usr/bin/perl %myhash = { "alma" => "apple", "korte" => "pear" }; Shou

Re: hash question

2005-09-06 Thread Shobha Deepthi
Its should be , print $ky, ":" , $myhash{$ky}, "\n"; Shobha Deepthi V The statement below is true. The statement above is false. Gergely Buday wrote: Hi there, do you have a clue why is this not working? The interpreter complains about a syntax error in line 7 near $myhash. #!/usr/bin

hash question

2005-09-06 Thread Gergely Buday
Hi there, do you have a clue why is this not working? The interpreter complains about a syntax error in line 7 near $myhash. #!/usr/bin/perl %myhash = { "alma" => "apple", "korte" => "pear" }; foreach $ky (keys (%myhash)) { print $ky, ":" , $myhash($ky), "\n"; } -- To unsubscribe, e-m

Re: Perl Hash Question.

2005-06-24 Thread Xavier Noria
On Jun 24, 2005, at 5:07, Anthony Roe wrote: A = Reads URI from URIHASH. Visits site A. Parses all URIS on site A and for each URI found adds the URI to the URIHASH. A = Reads next URI from URIHASH. Visits site A. And so on... until the MAX URIHASH size is reached. My question is, is there

Perl Hash Question.

2005-06-23 Thread Anthony Roe
Hi there everybody, I have a question and I am pretty stumped for the answer. I have a program that does the following: A = Reads URI from URIHASH. Visits site A. Parses all URIS on site A and for each URI found adds the URI to the URIHASH. A = Reads next URI from URIHASH. Visits site A. And so

Re: simple hash question

2004-11-08 Thread John W. Krahn
Ing. Branislav Gerzo wrote: Hi pals, Hello, I have simple hash question, lets we have example code: my %hash = ( 1 => 2, 2 => 3, 3 => 4, 4 => 5 ); while (my($key, $value) = each(%hash)) { print "$key => $value\n"; } how I can print all values, if I want print that in th

Re: simple hash question

2004-11-08 Thread Ing. Branislav Gerzo
Edward Wijaya [EW], on Tuesday, November 09, 2004 at 03:14 (+0800) wrote: EW> use Tie::IxHash module from CPAN, to preserve order in a Hash. thanks for answer, indeed, I created small subroutine, to look... sub hash_look { while ( my ($key, $value) = each(%tab_def) ) { print "$ke

Re: simple hash question

2004-11-08 Thread Edward Wijaya
use Tie::IxHash module from CPAN, to preserve order in a Hash. Regards, Edward WIJAYA SINGAPORE On Tue, 09 Nov 2004 03:06:03 +0800, Edward Wijaya <[EMAIL PROTECTED]> wrote: On Mon, 8 Nov 2004 11:59:13 +0100, Ing. Branislav Gerzo <[EMAIL PROTECTED]> wrote: Hi pals, I have simple h

Re: simple hash question

2004-11-08 Thread Edward Wijaya
On Mon, 8 Nov 2004 11:59:13 +0100, Ing. Branislav Gerzo <[EMAIL PROTECTED]> wrote: Hi pals, I have simple hash question, lets we have example code: my %hash = ( 1 => 2, 2 => 3, 3 => 4, 4 => 5 ); while (my($key, $value) = each(%hash)) { print "$key => $value\n"; }

simple hash question

2004-11-08 Thread Ing. Branislav Gerzo
Hi pals, I have simple hash question, lets we have example code: my %hash = ( 1 => 2, 2 => 3, 3 => 4, 4 => 5 ); while (my($key, $value) = each(%hash)) { print "$key => $value\n"; } how I can print all values, if I want print that in this order: 2 => 3 4 => 5 3 =&

Simple Hash Question / NEVER MIND

2003-12-31 Thread Jeff Westman
DOH . DOH . NEVER MIND, user error ( <- gun to head) DOH . DOH . DOH . Hi I have a hash defined as my %flag3 = ( A => "DBSpace backup thread", B => "Begin work", C => "Commiting/committ

Simple Hash Question

2003-12-31 Thread Jeff Westman
Hi I have a hash defined as my %flag3 = ( A => "DBSpace backup thread", B => "Begin work", C => "Commiting/committed", H => "Heuristic aborting/aborted", P => "Preparing/prepared", R => "Aborting/aborted", X

RE: hash question

2003-07-23 Thread Mike Bernhardt
3 4:52 AM To: [EMAIL PROTECTED] Subject: hash question Hi, maybe someone can enlighten me(if it is possible). I did a very simple loop/save/open/display to test hash. ... ... for(1..99){ $result{$_}=$_; } ##saved it in a dbm file and reopen to the file ##when i open the file i just r

Re: hash question

2003-07-23 Thread Todd W.
"Awarsd" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > for(1..99){ > $result{$_}=$_; > } > ##saved it in a dbm file and reopen to the file > ##when i open the file i just read all the keys and display > ## the key > . > foreach (keys %dbm){ > print "$_,"; > } > ## now the int

RE: hash question

2003-07-23 Thread Kipp, James
> > maybe someone can enlighten me(if it is possible). > I did a very simple loop/save/open/display to test hash. > > ... > ... > for(1..99){ > $result{$_}=$_; > } > ##saved it in a dbm file and reopen to the file > ##when i open the file i just read all the keys and display > ## the k

hash question

2003-07-23 Thread awarsd
Hi, maybe someone can enlighten me(if it is possible). I did a very simple loop/save/open/display to test hash. ... ... for(1..99){ $result{$_}=$_; } ##saved it in a dbm file and reopen to the file ##when i open the file i just read all the keys and display ## the key . foreach (key

Re: dumb array/hash question

2003-04-04 Thread R. Joseph Newton
jdavis wrote: Hi Please post to the list. I did a lot of work on my reply to this, and didn't even notice till now that it had not reached the list. Pasted below: > On Tue, 2003-04-01 at 13:07, R. Joseph Newton wrote: > > jdavis wrote: > > > > I have a hash. To use this hash with a module I ne

Re: dumb array/hash question

2003-04-01 Thread R. Joseph Newton
jdavis wrote: > > I have a hash. To use this hash with a module I need it in this form... > > > > @data = ( > > ["12am","1am","2am","3am","4am","5am","6am", "7am", "8am"], ### key > > [ 251, 102, 55, 36, 113, 200,32,99, 4], ###val > > ); > > I confused.. How could I

Re: dumb array/hash question

2003-04-01 Thread Rob Dixon
Jdavis wrote: > hello, > I have a hash. To use this hash with a module I need it in this form... > > @data = ( > ["12am","1am","2am","3am","4am","5am","6am", "7am", "8am"], ### key > [ 251, 102, 55, 36, 113, 200,32,99, 4], ###val > ); > > I confused.. How could I get

Re: dumb array/hash question

2003-04-01 Thread Scott R. Godin
Jdavis wrote: > > I have a hash that i needed to put into a 2d array. > I wound up doing this... > > foreach $key (keys(%temp)){ > push(@graph_key,$key); > push(@graph_value,$temp{$key}); > } > > $data[0] = [EMAIL PROTECTED]; > $data[1] = [EMAIL PROTECTED]; > > Though Im not qu

Re: dumb array/hash question

2003-04-01 Thread Ramprasad
Jdavis wrote: I have a hash that i needed to put into a 2d array. I wound up doing this... foreach $key (keys(%temp)){ push(@graph_key,$key); push(@graph_value,$temp{$key}); } $data[0] = [EMAIL PROTECTED]; $data[1] = [EMAIL PROTECTED]; Though Im not quite sure why i need to escape t

Re: dumb array/hash question

2003-04-01 Thread jdavis
I have a hash that i needed to put into a 2d array. I wound up doing this... foreach $key (keys(%temp)){ push(@graph_key,$key); push(@graph_value,$temp{$key}); } $data[0] = [EMAIL PROTECTED]; $data[1] = [EMAIL PROTECTED]; Though Im not quite sure why i need to escape the @? but

Re: dumb array/hash question

2003-04-01 Thread Aim
Hi, Here is one way to build a hash: my %data = ( "12am" => "251", "1am" => "102" ); etc. Regards. # jdavis wrote: > hello, > I have a hash. To use this hash with a module I need it in this form... > > @data =

Re: dumb array/hash question

2003-03-31 Thread Stefan Lidman
> hello, Hi, > I have a hash. To use this hash with a module I need it in this form... > > @data = ( > ["12am","1am","2am","3am","4am","5am","6am", "7am", "8am"], ### key > [ 251, 102, 55, 36, 113, 200,32,99, 4], ###val > ); > maybe this is what you want: my @data

dumb array/hash question

2003-03-31 Thread jdavis
hello, I have a hash. To use this hash with a module I need it in this form... @data = ( ["12am","1am","2am","3am","4am","5am","6am", "7am", "8am"], ### key [ 251, 102, 55, 36, 113, 200,32,99, 4], ###val ); I confused.. How could I get a hash to the above structure

RE: Probably a simple hash question

2003-01-24 Thread Michael Hooten
> Here's the setup: > I have set up a hash %categories where the key is one number and the value > is another > i.e. $categories('1094') = 100049-0220-14 I assume you meant (note braces and quotes): $categories{1094} = '100049-0220-14' otherwise the value will be 100049-0220-14 = -

Re: Probably a simple hash question

2003-01-23 Thread R. Joseph Newton
"Lara J. Fabans" wrote: > Hi, perl-friends,... Hi Lara, You said: > I had a while loop to search through each of the keys & values, but the problem is > that it doesn't break out of the while loop, and the wrong value gets set as $myID; Look at your words, thenlook at your code: > #while(my (

RE: Probably a simple hash question

2003-01-23 Thread Dan Muey
> Morning, Dan Morning! > > At 11:50 AM 1/23/2003 -0600, you wrote: > > > i.e. $categories('1094') = 100049-0220-14 > > > > do you mean $catagories{'1094'} ? > > Yup, I did. Never type anything in from memory :-) I can't anyway because my memory doesn't work. > > > > > value is ther

Re: Probably a simple hash question

2003-01-23 Thread Rob Dixon
Lara J. Fabans wrote: > Hi, perl-friends, > > Here's the setup: > I have set up a hash %categories where the key is one number and the > value is another > i.e. $categories('1094') = 100049-0220-14 You need quotation marks here, like this: $categories('1094') = '100049-0220-14'; othe

RE: Probably a simple hash question

2003-01-23 Thread Dan Muey
> Hi, perl-friends, > > Here's the setup: > I have set up a hash %categories where the key is one number > and the value > is another > i.e. $categories('1094') = 100049-0220-14 do you mean $catagories{'1094'} ? > > So, further on down, I'm trying to do a lookup in %categories > to see i

Probably a simple hash question

2003-01-23 Thread Lara J. Fabans
Hi, perl-friends, Here's the setup: I have set up a hash %categories where the key is one number and the value is another i.e. $categories('1094') = 100049-0220-14 So, further on down, I'm trying to do a lookup in %categories to see if a value is there. (I can swap the key and the value in

Re: Constants and Hash Question

2002-12-11 Thread John W. Krahn
Paul Kraus wrote: > > I am declaring my constants like this. > use constant SOURCE => "/path/folder/" > Now how would I use this constant is a print statement or any statement > for that matter. > print "$SOURCE" does not work and of course print "source" will not > work. The constant pragma crea

Re: Constants and Hash Question

2002-12-11 Thread Rob Dixon
b - Original Message - From: "Paul Kraus" <[EMAIL PROTECTED]> To: "'Kipp, James'" <[EMAIL PROTECTED]>; "'Perl'" <[EMAIL PROTECTED]> Sent: Wednesday, December 11, 2002 2:37 PM Subject: RE: Constants and Hash Question > ok b

RE: Constants and Hash Question

2002-12-11 Thread Kipp, James
> > ok but lets say I am doing this > > $copydir = `cp --preserve --recursive --update > SOURCE/$ini{$section}{path} DEST/$ini{$section}{machine}`; > could use concatenation. $copydir = `"cp --preserve --recursive --update" . SOURCE . "/$ini{$section}{path} DEST/$ini{$section}{machine}"`

RE: Constants and Hash Question

2002-12-11 Thread Duarte Cordeiro
$command="cp --preserve --recursive --update ". SOURCE ."/$ini{$section}{path}".. $copydir = `$command`; -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 11, 2002 2:38 PM To: 'Kipp, James'; 'Perl' Subje

Re: Constants and Hash Question

2002-12-11 Thread Rob Dixon
- Original Message - From: "Paul Kraus" <[EMAIL PROTECTED]> To: "Perl" <[EMAIL PROTECTED]> Sent: Wednesday, December 11, 2002 2:16 PM Subject: Constants and Hash Question > I am declaring my constants like this. > use constant SOURCE => &

RE: Constants and Hash Question

2002-12-11 Thread Paul Kraus
Paul Kraus'; Perl > Subject: RE: Constants and Hash Question > > > print SOURCE; > > > -Original Message- > > From: Paul Kraus [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, December 11, 2002 9:17 AM > > To: Perl > > Subject: Constants an

RE: Constants and Hash Question

2002-12-11 Thread Kipp, James
print SOURCE; > -Original Message- > From: Paul Kraus [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, December 11, 2002 9:17 AM > To: Perl > Subject: Constants and Hash Question > > > I am declaring my constants like this. > use constant SOURCE => "/

Constants and Hash Question

2002-12-11 Thread Paul Kraus
I am declaring my constants like this. use constant SOURCE => "/path/folder/" Now how would I use this constant is a print statement or any statement for that matter. print "$SOURCE" does not work and of course print "source" will not work. I understand that this works but I do not understand wha

Re: Hash Question

2002-12-06 Thread Jan Gruber
Hi, Sean && List >$Hash{"$User"}{"$Page"}{"$NumTimesVisited"} = $ANumber; > Is this possible? Sure, this will work. I would decrease the hash depth a bit: $Hash{$User}{$Page} = $NumTimesVisited; > If so, how would I traverse this, as I will not know > before hand the values in the hash; I wi

RES: Hash Question

2002-12-06 Thread Igor Sutton Lopes
;inner' hashes. Igor. > - Mensagem original - > De: Sean Rowe [SMTP:[EMAIL PROTECTED]] > Enviada em: sexta-feira, 6 de dezembro de 2002 11:30 > Para: Beginners@perl. org (E-mail) > Assunto: Hash Question > > I need to keep tra

RE: Hash Question

2002-12-06 Thread simran
o know before hand what my hash values are (as I create them > on the fly), how can I iterate through each hash to get each value? > > -Original Message- > From: Igor Sutton Lopes [mailto:[EMAIL PROTECTED]] > Sent: Friday, December 06, 2002 10:12 AM > T

RE: Hash Question

2002-12-06 Thread Sean Rowe
Thank you! -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 9:45 AM To: '[EMAIL PROTECTED]'; Beginners@perl. org (E-mail) Subject: RE: Hash Question > -Original Message- > From: Sean Rowe [mailto:[EMAIL PROTECTED]

RE: Hash Question

2002-12-06 Thread Sean Rowe
ECTED]] Sent: Friday, December 06, 2002 10:12 AM To: [EMAIL PROTECTED]; Beginners@perl. org (E-mail) Subject: RES: Hash Question You can do something like this: %url_options_hash = ("times_visited"=>0); %url_hash = ("this_url"=>\%url_options_hash); %usr_has

RE: Hash Question

2002-12-06 Thread Bob Showalter
> -Original Message- > From: Sean Rowe [mailto:[EMAIL PROTECTED]] > Sent: Friday, December 06, 2002 9:30 AM > To: Beginners@perl. org (E-mail) > Subject: Hash Question > > > I need to keep track of a user, all the web pages a user has > visited, and >

Re: Hash Question

2002-12-06 Thread Mystik Gotan
aster Insane Hosts) www.insane-hosts.net MSN: [EMAIL PROTECTED] From: "Sean Rowe" <[EMAIL PROTECTED]> Reply-To: <[EMAIL PROTECTED]> To: "Beginners@perl. org \(E-mail\)" <[EMAIL PROTECTED]> Subject: Hash Question Date: Fri, 6 Dec 2002 08:29:37 -0600 I need

Hash Question

2002-12-06 Thread Sean Rowe
I need to keep track of a user, all the web pages a user has visited, and the number of times the user visited each page. I get my information from a log file. Here's how I would like to say it programmatically: $Hash{"$User"}{"$Page"}{"$NumTimesVisited"} = $ANumber; Is this possible?

Re: Big hash question.

2002-11-20 Thread David Zhuo
Mark, A couple things: 1. if you have something like 099, Perl thinks that you mean the Octal value of 99. The leading 0 makes Perl think you mean Octal instead of digit. For example: my $i = 99; #-- means the value 99 my $j = 099; #-- means the value 99 in Octal Now, since the Octal number sy

Re: Big hash question.

2002-11-20 Thread mark
Thanks David, this works in the form that you gave me. However, I am butchering it up to try and see if it will work with all the values I have and I run into this error. Illegal octal digit '9' at noname.pl line 10, at end of line I get the impression that perl is interpreting one of my zips as

Re: Big hash question.

2002-11-19 Thread david
Mark wrote: > > I want to be able to determine what zone a zip code falls in from a user > input. Once I write the hash, the data contained within it will remain > unchanged throughout the script except maybe for the occasional update if > things change. > > I am just unsure of which approach w

Re: Big hash question.

2002-11-19 Thread wiggins
On Tue, 19 Nov 2002 11:41:09 -0500, "mark" <[EMAIL PROTECTED]> wrote: > > I want to be able to determine what zone a zip code falls in from a user > input. Once I write the hash, the data contained within it will remain > unchanged throughout the

Re: Big hash question.

2002-11-19 Thread wiggins
On Tue, 19 Nov 2002 11:41:09 -0500, "mark" <[EMAIL PROTECTED]> wrote: > > > A really good hash tutorial would be of excellent help if anyone can guide > me to an online one. Bare in mind that I am a novice. :-) > This should get you started:

Re: Big hash question.

2002-11-19 Thread mark
I want to be able to determine what zone a zip code falls in from a user input. Once I write the hash, the data contained within it will remain unchanged throughout the script except maybe for the occasional update if things change. I am just unsure of which approach would be the best or if I ha

Re: Big hash question.

2002-11-19 Thread Jeff 'japhy' Pinyan
On Nov 18, mark said: >Should I list zones as the name component with zips as a list of values and >try to work through the values to establish a zip's zone identity. > >%zone={ >one => [370,422..430,476,490..500] >two=> [200..232,388] >Or should list all the possible zips as the name component w

Re: Big hash question.

2002-11-19 Thread mark
An equally valuable answer to my question would be a good online tutorial about using perl hashs inside out. I haven't found that yet. Most of the stuff I find in the documentation at perldoc are brief and lack any real indepth discussion of the number of ways to use a hash. Also, do the archive

Big hash question.

2002-11-18 Thread mark
Hi, I am trying to make hash of delivery zones that allows me to maintain a record of a zone for every postal code based on the first three digits of each zip. Being new to perl I have a few questions about the logical approach. Should I list zones as the name component with zips as a list of va

RE: Anonymous hash question

2002-02-12 Thread Nikola Janceski
Janceski Cc: '[EMAIL PROTECTED]' Subject: Re: Anonymous hash question On Feb 12, Nikola Janceski said: >I am using a module function (method) that requires an anonymous hash as the >first parameter. No, it requires a hash reference. >ie. $sender->OpenMultipart({from => $

Re: Anonymous hash question

2002-02-12 Thread Jeff 'japhy' Pinyan
On Feb 12, Nikola Janceski said: >I am using a module function (method) that requires an anonymous hash as the >first parameter. No, it requires a hash reference. >ie. $sender->OpenMultipart({from => $FORM{'from'}, to => $FORM{'to'}, cc => >$FORM{'cc'}, > subject => $FORM{

Re: Anonymous hash question

2002-02-12 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Nikola Janceski" <[EMAIL PROTECTED]>: > I am using a module function (method) that requires an anonymous hash as the first >parameter. > > ie. $sender->OpenMultipart({from => $FORM{'from'}, to => $FORM{'to'}, cc => >$FORM{'cc'}, >s

Anonymous hash question

2002-02-12 Thread Nikola Janceski
I am using a module function (method) that requires an anonymous hash as the first parameter. ie. $sender->OpenMultipart({from => $FORM{'from'}, to => $FORM{'to'}, cc => $FORM{'cc'}, subject => $FORM{'subject'} } ) || die "$Mail::Sender::Error\n"; but sometimes $FORM{'cc'}

RE: Hash Question

2002-02-07 Thread Chas Owens
On Thu, 2002-02-07 at 14:27, Balint, Jess wrote: > After hours of pondering and sitting in wonder of simple it is, I have come > up with something. I do believe that this: > > for my $i (0..$#keys) { > > Quite possibly should be > > foreach ( @keys ) { > > Otherwise, why would yo

RE: Hash Question

2002-02-07 Thread Balint, Jess
After hours of pondering and sitting in wonder of simple it is, I have come up with something. I do believe that this: for my $i (0..$#keys) { Quite possibly should be foreach ( @keys ) { Otherwise, why would you have my @keys = (0, 1, 2, 3); Instead of just $keys = 3 and the

RE: Hash Question

2002-02-04 Thread Chas Owens
the values of '-f' > arguments? If so, it may be easier. Thanks for all your help. > > --Jess > > -Original Message- > From: Chas Owens [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 04, 2002 2:56 PM > To: Balint, Jess > Subject: RE: Hash Question

RE: Hash Question

2002-02-04 Thread Balint, Jess
for a single argument, '-f' here and store an array reference in the hash for all the values of '-f' arguments? If so, it may be easier. Thanks for all your help. --Jess -Original Message- From: Chas Owens [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002

RE: Hash Question

2002-02-04 Thread Balint, Jess
That seems like the best way to do it, but if I enter -f 3, $tables[n] = " " and not 3 like it should. I think that $1 is defined as " " in this argument. What can I do about this? -Original Message- On Fri, 2002-02-01 at 15:23, Balint, Jess wrote: > A scalar value based on the number of

Re: Hash Question

2002-02-02 Thread Dave Benware
7;tutorial'? > > -Original Message- > From: Dave Benware [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 01, 2002 2:44 PM > To: Beginners perl > Subject: Re: Hash Question > > "Balint, Jess" wrote: > > > > Since this is a beginners list

RE: Hash Question

2002-02-02 Thread Chas Owens
Okay, I came up with two solutions. The first is to use eval to build the hash and recursive functions to deal with it. The second takes up more space, but is easier to deal with: cat the keys together. The first is better when you have many things that are going to be the same and the key size

RE: Hash Question

2002-02-01 Thread Balint, Jess
The way I have the argument parsing set up is for ( 0..$#ARGV ) { . . . When a -f n is presented on the command line, n will be the field number for the first hash. So if I use -f 1 -f 2 -f 3, there will be three levels of hashes. The top level will contain all unique values in the first field of

RE: Hash Question

2002-02-01 Thread Chas Owens
On Fri, 2002-02-01 at 15:23, Balint, Jess wrote: > A scalar value based on the number of command line arguments put into an > array. > > if( $ARGV[$_] =~ /^-f/ ) { > # PARSE TABULATION VALUES > if( $table ) { > $table = $ARGV[$_]; >

RE: Hash Question

2002-02-01 Thread Chas Owens
how will you know how many keys are needed? On Fri, 2002-02-01 at 14:42, Balint, Jess wrote: > I think I will go ahead and use something like the multi-dimensional hash > example below. What I need to do is create hashes dynamically based on how > many are needed for this particular instance of t

RE: Hash Question

2002-02-01 Thread McCollum, Frank
Where might one find this 'tutorial'? -Original Message- From: Dave Benware [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 2:44 PM To: Beginners perl Subject: Re: Hash Question "Balint, Jess" wrote: > > Since this is a beginners list, I thought

RE: Hash Question

2002-02-01 Thread Balint, Jess
I think I will go ahead and use something like the multi-dimensional hash example below. What I need to do is create hashes dynamically based on how many are needed for this particular instance of the program. Any ideas on dynamic hash creation multi-dimensionally? Thanks -jess -Origina

Re: Hash Question

2002-02-01 Thread Dave Benware
"Balint, Jess" wrote: > > Since this is a beginners list, I thought I would be allowed to ask this > question. Can there be multiple values for hash keys, or just one? The > reason I am asking is that I am working on a statistical program and would > need to use multiple hashes as values of ano

RE: Hash Question

2002-02-01 Thread Hanson, Robert
age- From: Balint, Jess [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 12:43 PM To: '[EMAIL PROTECTED]' Subject: Hash Question Since this is a beginners list, I thought I would be allowed to ask this question. Can there be multiple values for hash keys, or just one? The re

Re: Hash Question

2002-02-01 Thread Chas Owens
On Fri, 2002-02-01 at 12:42, Balint, Jess wrote: > Since this is a beginners list, I thought I would be allowed to ask this > question. Can there be multiple values for hash keys, or just one? The > reason I am asking is that I am working on a statistical program and would > need to use multiple h

RE: Hash Question

2002-02-01 Thread Hanson, Robert
n $hash->{$key}; } } Rob -Original Message- From: Hanson, Robert Sent: Friday, February 01, 2002 1:04 PM To: 'Balint, Jess'; '[EMAIL PROTECTED]' Subject: RE: Hash Question Just one unless you use references. Here is an example with references... %hash =

Re: Hash Question

2002-02-01 Thread Deen Hameed
Keys are unique in a hash; what you put in them is up to you. the new value will overwrite the old value, unless you append it during assignment, using the . operator. Yes, you can store a hash in a hash in a hash... :) try perldoc perldsc for stuff on data structures. deen On Fri, 1 Feb 200

Re: Hash Question

2002-02-01 Thread Terry Dignon
Hashes cannot store multiple values (to the best of my knowledge), although they can store arrays or additional hashes which can of course, contain more values. "Balint, Jess" wrote > > Since this is a beginners list, I thought I would be allowed to ask this > question. Can there be multiple va

RE: Hash Question

2002-02-01 Thread Hanson, Robert
; } else { $hash->{$key} = $value; } } Rob -Original Message- From: Balint, Jess [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 12:43 PM To: '[EMAIL PROTECTED]' Subject: Hash Question Since this is a beginners list, I thought

Hash Question

2002-02-01 Thread Balint, Jess
Since this is a beginners list, I thought I would be allowed to ask this question. Can there be multiple values for hash keys, or just one? The reason I am asking is that I am working on a statistical program and would need to use multiple hashes as values of another hash. If this is possible, ple

Dumb hash question.

2002-01-03 Thread Dean Theophilou
Hello: I was wondering...I want to create (and later modify) a share with Win32::NetResource module. My question is: does the SHAREINFO hash structure need to be completely filled in (or at least initialized) before I use it, or can I just use only the key/value pairs that will be set?

Re: Hash question

2001-12-28 Thread Andrea Holstein
Wim De Hul wrote: > > Hashes are hard to understand (regarding on the questions in this > list...). I have also a question: > Why doesn't this work? I get a synthax error? > > foreach $index (sort keys %IfType{$router}) { > print " Interface: $IfType{$router}{$index

Hash question

2001-12-28 Thread Wim De Hul
Hello people, Hashes are hard to understand (regarding on the questions in this list...). I have also a question: Why doesn't this work? I get a synthax error? foreach $index (sort keys %IfType{$router}) { print " Interface: $IfType{$router}{$index}\n";

RE: Hash of a hash question... Answer to my own question...

2001-12-18 Thread Jonathan E. Paton
> Jonathan, > > Thank you very much for your response! It looks alot > tidier now :) But for some reason when I run the > script I get the following... > > %popusers = (); > > Ie %popusers is not being populated at all! I have > done nothing to your code I simply cut and pasted it > to test

Hash question...

2001-12-17 Thread Daniel Falkenberg
Hello All, I just have a quick question about printing hash of hash values. The hash looks like the following... %popusers = ( 'user1' => { 'fullname1' => 'YES' }, 'user2' => {

Re: Hash of a hash question... Answer to my own question...

2001-12-17 Thread Jonathan E. Paton
Hi, I must apologise for taking the time to rewrite your script, even though the issues could probably be easily fixed. It just seemed an easier way to express several changes *I would have made*, but you might not have. In doing so, I learned a few issues/bugs with your own version. In partic

Re: Hash question...

2001-12-17 Thread Andrea Holstein
Ahmed Moustafa wrote: > > Hi Dan, > > Try this: > > # -- > %flags=(); > foreach $user ( keys (%popusers) ) { > if (-e "/home/$user/test.pl") { > $flags{$user} = "YES"; > } else { > $flags{$user} = "NO"; > } > } > # -- > Or quite a little

Re: Hash question...

2001-12-17 Thread Ahmed Moustafa
Hi Dan, Try this: # -- %flags=(); foreach $user ( keys (%popusers) ) { if (-e "/home/$user/test.pl") { $flags{$user} = "YES"; } else { $flags{$user} = "NO"; } } # -- I hope that helps, Ahmed Daniel Falkenberg wrote: > Hi All, > > Just

  1   2   >