Sorting mixed alphanumerics

2009-10-14 Thread Rick Triplett
I need to sort the keys in a hash. The keys are the question number and the values are the student's answer. A numeric sort with = won't work since retaking a missed question (say, 2) produces the new key, 2h with its new answer. A representative hash might look like this 1 = b 2h = c 3 =

Re: Sorting mixed alphanumerics

2009-10-14 Thread Shawn H Corey
Rick Triplett wrote: I need to sort the keys in a hash. The keys are the question number and the values are the student's answer. A numeric sort with = won't work since retaking a missed question (say, 2) produces the new key, 2h with its new answer. A representative hash might look like this

Re: Sorting mixed alphanumerics

2009-10-14 Thread Paul Johnson
On Tue, Oct 13, 2009 at 11:09:09AM -0500, Rick Triplett wrote: I need to sort the keys in a hash. The keys are the question number and the values are the student's answer. A numeric sort with = won't work since retaking a missed question (say, 2) produces the new key, 2h with its new

Re: Sorting mixed alphanumerics

2009-10-14 Thread Jenda Krynicky
Date sent: Wed, 14 Oct 2009 11:03:13 -0400 From: Shawn H Corey shawnhco...@gmail.com To: Rick Triplett r...@reason.net Copies to: Perl Beginners beginners@perl.org Subject:Re: Sorting mixed alphanumerics Rick

Re: Sorting mixed alphanumerics

2009-10-14 Thread Shawn H Corey
Jenda Krynicky wrote: ST is an overkill if the extraction is simple. Especially if the number of items is fairly small. Actually if the extraction is really simple and the extracted key is not so small, than ST may perform worse than an ordinary sort doing the extraction within the

Panic when decrypting

2009-10-14 Thread Fisher, John
I have written a Perl script which I have used for years to decrypt at the field level in a file. Occasionally I get a problem file. It throws out this message like this and stops - panic: sv_setpvn called with negative strlen at encrypt_ssn_2_live_STDIN_or_INFILE.pl line 108, STDIN line

Re: Sorting mixed alphanumerics

2009-10-14 Thread Uri Guttman
SHC == Shawn H Corey shawnhco...@gmail.com writes: SHC Jenda Krynicky wrote: ST is an overkill if the extraction is simple. Especially if the number of items is fairly small. Actually if the extraction is really simple and the extracted key is not so small, than ST may

Re: Panic when decrypting

2009-10-14 Thread Uri Guttman
FJ == Fisher, John john.j.fis...@salliemae.com writes: FJ It throws out this message like this and stops - FJ panic: sv_setpvn called with negative strlen at encrypt_ssn_2_live_STDIN_or_INFILE.pl line 108, STDIN line 1249. FJ #!/usr/bin/perl -w FJ use Crypt::GCrypt; a meta

RE: Sorting mixed alphanumerics

2009-10-14 Thread Hall, Scott
-Original Message- From: Rick Triplett [mailto:r...@reason.net] Sent: Tuesday, October 13, 2009 12:09 PM To: Perl Beginners Subject: Sorting mixed alphanumerics I need to sort the keys in a hash. The keys are the question number and the values are the student's answer. A numeric sort

Re: Sorting mixed alphanumerics

2009-10-14 Thread Jenda Krynicky
From: Shawn H Corey shawnhco...@gmail.com Jenda Krynicky wrote: ST is an overkill if the extraction is simple. Especially if the number of items is fairly small. Actually if the extraction is really simple and the extracted key is not so small, than ST may perform worse than an

Larry's filename fixer

2009-10-14 Thread Felix Dorner
Hi, I did the best book purchase in years: The Perl Cookbook. They have an example that seems to come right from Larry Wall himself. And I don't get it. I can use it but I don't understand why it works with wildcards. $op = shift or die Usage: rename expr [files]\n; chomp (@ARGV = STDIN)

Re: Larry's filename fixer

2009-10-14 Thread Shawn H Corey
Felix Dorner wrote: Hi, I did the best book purchase in years: The Perl Cookbook. They have an example that seems to come right from Larry Wall himself. And I don't get it. I can use it but I don't understand why it works with wildcards. $op = shift or die Usage: rename expr [files]\n;

RE: Larry's filename fixer

2009-10-14 Thread David Christensen
felix_do wrote: I did the best book purchase in years: The Perl Cookbook. They have an example that seems to come right from Larry Wall himself. And I don't get it. I can use it but I don't understand why it works with wildcards. $op = shift or die Usage: rename expr [files]\n; chomp (@ARGV =

Re: Larry's filename fixer

2009-10-14 Thread Jim Gibson
On 10/14/09 Wed Oct 14, 2009 3:38 PM, Felix Dorner felix...@web.de scribbled: Hi, I did the best book purchase in years: The Perl Cookbook. They have an example that seems to come right from Larry Wall himself. And I don't get it. I can use it but I don't understand why it works with

Use of eval()

2009-10-14 Thread Steve Bertrand
Hi all, Although I've read the docs and have been practising with it, I'm a bit confused on the use of eval(). For some reason, it took a few swings of the hammer to get past wanting to look for array elements within $@ :P I think I now understand the dangers of using eval() to trap errors,

Daemon::Easy and self-killing

2009-10-14 Thread Michael Pobega
I'm using the Daemon::Easy module to write a basic Perl daemon, but I'm wondering if there is a way to stop the daemon from within the script (as opposed to running ./script.pl stop)? Currently I have a subroutine to do this, but it doesn't seem to cleanly erase the pid file. killMe {

Re: Daemon::Easy and self-killing

2009-10-14 Thread Steve Bertrand
Michael Pobega wrote: I'm using the Daemon::Easy module to write a basic Perl daemon, but I'm wondering if there is a way to stop the daemon from within the script (as opposed to running ./script.pl stop)? Currently I have a subroutine to do this, but it doesn't seem to cleanly erase the pid