Re: [Perl-unix-users] sorting hash values

2004-07-29 Thread Kester Allen
You can sort the hash on the values with a snippet like this: foreach ( sort { $urls{$a} cmp $urls{$b} } keys %urls ) { print "$urls{$_} $_\n"; } For more info, read perldoc -f sort. --Kester On Thu, 29 Jul 2004 13:46:55 -0300, Márcio Oliveira <[EMAIL PROTECTED]> wrote: > hi! > > I need t

Re: [Perl-unix-users] Some help with strings

2004-04-05 Thread Kester Allen
Hi Johnno-- You can use '+' in a regex to mean 'one-or-more', so s/\|+/|/ would mean "replace one or more pipe with a single pipe" (you don't need to escape the pipe in the replacement string). As a style matter, you can enclose the pipe in a chacter class with []s to make it easier to read: