Please remove me from email list. thanks.


--- Felix Geerinckx <[EMAIL PROTECTED]>
wrote:
> on Wed, 29 May 2002 12:58:33 GMT,
> [EMAIL PROTECTED] (Craig
> Hammer) wrote: 
> 
> > I thought this would work:
> 
> Your code is very buggy:
> 
>  
> > @sorted = sort { $myhash{$b} <=> $myhash{a} } keys
> %myhash ;
> 
> This should read:
>   @sorted = sort { $myhash{$b} <=> $myhash{$a} }
> keys %myhash ;
>                                            ^
> Now '@sorted' contains the keys of your '%myhash',
> sorted 
> numerically, largest first.
> 
>  
> > while ( <@sorted> ) {
> 
> Since '@sorted' is not a filehandle, this will be
> interpreted as a 
> glob("something"), where "something" is the
> catenation of all your 
> hashkeys, thus looping over all files in the current
> working 
> directory that fit the "something" fileglob
> (probably none).
> You want
> 
>      for(@sorted) {
>         # whatever
>      }
> 
> >     printf ( "first field = %s second field =
> %s\n", $sorted{1},
> >     $sorted{2} 
> > )  ;
> 
> '@sorted' is an array, not a hash,
> $sorted{something} will not work.
> 
> -- 
> felix
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


=====
Peter Lemus
Network Engineer
[EMAIL PROTECTED]

--A wise man will be master of his mind, a fool will be its slave.  Dr.David Schwartz.
--Enjoy every moment of the day; Live like as if today was your last day alive, and 
perhaps, it might be.
--Those who know, don't say; those who say don't know.

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to