RE: Hash Questions

2002-02-04 Thread Walter Torres

 Hello,

 I have defined a hash in a specific order. When I print the hash elements,
 the hash become unsorted and prints the elements out of my original order.

 Is there any way to restrict the hash from internally sorting the
elements?

 snip

1) you can not determine the order of elements in a hash table.

2) Perl does not sort its hash tables.

3) Carl's solution to this issue is exactly what I use to pull out
   data from a hash in a particular order.

Walter

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Hash Questions

2002-02-04 Thread Tillman, James

 1) you can not determine the order of elements in a hash table.
 
 2) Perl does not sort its hash tables.
 
 3) Carl's solution to this issue is exactly what I use to pull out
data from a hash in a particular order.
 

Then again, just because Perl doesn't maintain hash key order by default
doesn't mean we can't.  Everybody knows nothing is impossible in Perl.
Check out Tie::IxHash if you haven't found it already.

jpt
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Re: Hash Questions

2002-02-04 Thread Jeffrey


--- Carl Jolley [EMAIL PROTECTED] wrote:
 Try this:
 
 for $key (wq(first_name last_name address
 transportation)) {
   print $reqfields{$key\n;
 }

Closing } on $key in the print statement aside, what
exactly does this do?  I can't find reference to wq anywhere.

=

Jeffrey Hottle
nkuvu at yahoo dot com

__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Hash Questions

2002-02-04 Thread Morse, Richard E.

I imagine that that was meant to be qw...

HTH,
Ricky

-Original Message-
From: Jeffrey [mailto:[EMAIL PROTECTED]]
Sent: Monday 04 February 2002 2:45 PM
To: Carl Jolley; [EMAIL PROTECTED]
Subject: Re: Hash Questions



--- Carl Jolley [EMAIL PROTECTED] wrote:
 Try this:
 
 for $key (wq(first_name last_name address
 transportation)) {
   print $reqfields{$key\n;
 }

Closing } on $key in the print statement aside, what
exactly does this do?  I can't find reference to wq anywhere.

=

Jeffrey Hottle
nkuvu at yahoo dot com

__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe:
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Re: Hash Questions

2002-02-04 Thread Edward G. Orton

- Original Message -
From: Jeffrey [EMAIL PROTECTED]
To: Carl Jolley [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Monday, February 04, 2002 2:44 PM
Subject: Re: Hash Questions



 --- Carl Jolley [EMAIL PROTECTED] wrote:
  Try this:
 
  for $key (wq(first_name last_name address
  transportation)) {
print $reqfields{$key\n;
  }

 Closing } on $key in the print statement aside, what
 exactly does this do?  I can't find reference to wq anywhere.

Should be 'qw'.

ego
Edward G. Orton, GWN Consultants Inc.
Phone: 613-764-3186, Fax: 613-764-1721
email: [EMAIL PROTECTED]

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Re: Hash Questions

2002-02-04 Thread Carl Jolley

On Mon, 4 Feb 2002, Jeffrey wrote:


 --- Carl Jolley [EMAIL PROTECTED] wrote:
  Try this:
 
  for $key (wq(first_name last_name address
  transportation)) {
print $reqfields{$key\n;
  }

 Closing } on $key in the print statement aside, what
 exactly does this do?  I can't find reference to wq anywhere.


My bad. Another typo. Should be qw not wq.

 [EMAIL PROTECTED] Carl Jolley
 All opinions are my own and not necessarily those of my employer 

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users