Re: Printing Hash Keys

2001-11-16 Thread Scott R. Godin
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Rafal Pocztarski) wrote: > Are you serious? (excuse my ignorance, I've never used Mac) Does it mean > no one-liners? No filters?? No piped filters??? No piped one-line > filters Classic MacOS doesn't have such things as pipes, although OS X

Re: Printing Hash Keys

2001-11-16 Thread Scott R. Godin
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Rafal Pocztarski) wrote: > > > > Couldn't seem to locate it (using MacPerl) unfortunately. There is a few > > pods that came with it, but mostly I'm using The Perl CD Bookshelf by > > O'reilly & Associates for reference. It's on my PC system

Re: Printing Hash Keys

2001-10-29 Thread RaFaL Pocztarski
"Brett W. McCoy" wrote: > > On Thu, 25 Oct 2001, RaFaL Pocztarski wrote: > > > You can always use http://www.perldoc.com/ but it's hard to believe that > > any version of perl comes without perldoc, however I don't know MacPerl > > at all. Try to find any info about perldoc in MacPerl docs or we

Re: Printing Hash Keys

2001-10-29 Thread RaFaL Pocztarski
Shannon Murdoch wrote: > >> foreach (sort keys %params) { print "\t$params{$_}" } > > > > The same way. $_ is the key for the hash element in the while loop. > > I want a list of keys, not their values though. You have it already in your code: sort keys %params is a sorted list of keys in

Re: Printing Hash Keys

2001-10-25 Thread Shannon Murdoch
I was originally going to write all the values that a form submitted to a text file, delimited by tabs and Carriage Returned, ready for the next submission. Now I've changed the structure of the site so that the valid keys to the submitted data are written to a file as the form is created online

Re: Printing Hash Keys

2001-10-25 Thread Shannon Murdoch
Brett W. McCoy) > Newsgroups: perl.beginners.cgi > Date: Thu, 25 Oct 2001 17:02:29 -0400 (EDT) > To: Shannon Murdoch <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Subject: Re: Printing Hash Keys > > Why do you need to? There is way by using the Tie::IxHash module

Re: Printing Hash Keys

2001-10-25 Thread Brett W. McCoy
On Thu, 25 Oct 2001, RaFaL Pocztarski wrote: > You can always use http://www.perldoc.com/ but it's hard to believe that > any version of perl comes without perldoc, however I don't know MacPerl > at all. Try to find any info about perldoc in MacPerl docs or website. Yeah, but recall that Macs (p

Re: Printing Hash Keys

2001-10-25 Thread Brett W. McCoy
On Thu, 25 Oct 2001, Shannon Murdoch wrote: > So I take it there is no way to list all the keys contained in a hash in the > same order they were entered in, like I can with a normal array? Why do you need to? There is way by using the Tie::IxHash module. It is available from CPAN (if you have

Re: Printing Hash Keys

2001-10-25 Thread RaFaL Pocztarski
Shannon Murdoch wrote: > > Couldn't seem to locate it (using MacPerl) unfortunately. There is a few > pods that came with it, but mostly I'm using The Perl CD Bookshelf by > O'reilly & Associates for reference. It's on my PC system when I need it > though. You can always use http://www.perldoc

RE: Printing Hash Keys

2001-10-25 Thread Bob Showalter
> -Original Message- > From: Shannon Murdoch [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 25, 2001 9:35 AM > To: [EMAIL PROTECTED] > Subject: Re: Printing Hash Keys > > > Couldn't seem to locate it (using MacPerl) unfortunately. > There is a f

Re: Printing Hash Keys

2001-10-25 Thread Shannon Murdoch
Couldn't seem to locate it (using MacPerl) unfortunately. There is a few pods that came with it, but mostly I'm using The Perl CD Bookshelf by O'reilly & Associates for reference. It's on my PC system when I need it though. >> ... Perldoc (found out I can only use it under Windows, which >> I

RE: Printing Hash Keys

2001-10-25 Thread Bob Showalter
> -Original Message- > From: Shannon Murdoch [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 25, 2001 5:51 AM > To: [EMAIL PROTECTED] > Subject: Re: Printing Hash Keys > > > ... Perldoc (found out I can only use it under Windows, which > I have

Re: Printing Hash Keys

2001-10-25 Thread matt jones
At 19:51 25/10/01 +1000, Shannon Murdoch wrote: > So I take it there is no way to list all the keys contained in a hash in > the same order they were entered in, like I can with a normal array? use Tie::IxHash; It makes hash functions return elements in insertion order, IIRC. -- mjx free love

Re: Printing Hash Keys

2001-10-25 Thread Shannon Murdoch
x27;t know enough about the CGI.pm's internal workings I guess. -Shannon > From: "Bradford Ritchie" <[EMAIL PROTECTED]> > Date: Wed, 24 Oct 2001 20:03:34 -0400 > To: "Shannon Murdoch" <[EMAIL PROTECTED]> > Subject: Re: Printing Hash Keys > >

Re: Printing Hash Keys

2001-10-25 Thread Shannon Murdoch
array? -Shannon > From: [EMAIL PROTECTED] (Rafal Pocztarski) > Newsgroups: perl.beginners.cgi > Date: Wed, 24 Oct 2001 16:04:19 +0200 > To: [EMAIL PROTECTED] > Subject: Re: Printing Hash Keys > > Shannon Murdoch wrote: >> >> What everyone has said so far is ways to lis

RE: Printing Hash Keys

2001-10-24 Thread Moon, John
... @seq = qw(dirt sand land air wind breath); foreach (@seq) { print $param{$_} . "\n"; } is one way ... -Original Message- From: Shannon Murdoch [mailto:[EMAIL PROTECTED]] Sent: October 24, 2001 19:01 To: [EMAIL PROTECTED] Subject: Re: Printing Hash Keys Th

Re: Printing Hash Keys

2001-10-24 Thread Shannon Murdoch
CTED] (Rafal Pocztarski) > Newsgroups: perl.beginners.cgi > Date: Wed, 24 Oct 2001 16:04:19 +0200 > To: [EMAIL PROTECTED] > Subject: Re: Printing Hash Keys > > Shannon Murdoch wrote: >> >> What everyone has said so far is ways to list all the VALUES contained in a

Re: Printing Hash Keys

2001-10-24 Thread Shannon Murdoch
9:57:09 -0400 (EDT) > To: Shannon Murdoch <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Subject: Re: Printing Hash Keys > > On Wed, 24 Oct 2001, Shannon Murdoch wrote: > >>>> foreach (sort keys %params) { print "\t$params{$_}" } >>> >&

Re: Printing Hash Keys

2001-10-24 Thread matt jones
At 23:26 24/10/01 +1000, Shannon Murdoch wrote: > What everyone has said so far is ways to list all the VALUES contained > in a hash array, what I need to do is list all the KEYS contained in the > hash array-with a tab (\t) between each. foreach (keys %params) { print "$_\t"; } should work --

Re: Printing Hash Keys

2001-10-24 Thread RaFaL Pocztarski
Shannon Murdoch wrote: > > What everyone has said so far is ways to list all the VALUES contained in a > hash array, what I need to do is list all the KEYS contained in the hash > array-with a tab (\t) between each. print join "\t", sort keys %hashname; - RaFaL Pocztarski, [EMAIL PROTECTED] --

Re: Printing Hash Keys

2001-10-24 Thread Brett W. McCoy
On Wed, 24 Oct 2001, Shannon Murdoch wrote: > What everyone has said so far is ways to list all the VALUES contained in a > hash array, what I need to do is list all the KEYS contained in the hash > array-with a tab (\t) between each. Read the perldoc on the keys function. It takes all of the k

Re: Printing Hash Keys

2001-10-24 Thread Brett W. McCoy
On Wed, 24 Oct 2001, Shannon Murdoch wrote: > >> foreach (sort keys %params) { print "\t$params{$_}" } > > > > The same way. $_ is the key for the hash element in the while loop. > > > I want a list of keys, not their values though. Right -- the 'keys' function extracts the list of keys from a

Re: Printing Hash Keys

2001-10-24 Thread Shannon Murdoch
Reply-To: [EMAIL PROTECTED] > Newsgroups: perl.beginners.cgi > Date: Wed, 24 Oct 2001 08:15:12 -0400 > To: Shannon Murdoch <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Subject: Re: Printing Hash Keys > > Shannon Murdoch wrote: >> >>> From: [EMAIL PROTE

Re: Printing Hash Keys

2001-10-24 Thread fliptop
Shannon Murdoch wrote: > > > From: [EMAIL PROTECTED] (Brett W. McCoy) > > > > On Wed, 24 Oct 2001, Shannon Murdoch wrote: > > > >> I know how to print the contents of a hash, but what if I wanted to print > >> the keys themselves that the hash is called from (delimited by tabs)? > >> > >> This is

Re: Printing Hash Keys

2001-10-23 Thread Shannon Murdoch
> From: [EMAIL PROTECTED] (Brett W. McCoy) > > On Wed, 24 Oct 2001, Shannon Murdoch wrote: > >> I know how to print the contents of a hash, but what if I wanted to print >> the keys themselves that the hash is called from (delimited by tabs)? >> >> This is how I print the contents of a hash (Th

Re: Printing Hash Keys

2001-10-23 Thread Brett W. McCoy
On Wed, 24 Oct 2001, Shannon Murdoch wrote: > I know how to print the contents of a hash, but what if I wanted to print > the keys themselves that the hash is called from (delimited by tabs)? > > This is how I print the contents of a hash (Thanks to Brett W. McCoy): > > %params = qw( > i01 4 > i0