Re: How can I write in perl: #ifdef __GNUC?

2003-09-04 Thread Carl Jolley
On Thu, 4 Sep 2003, Ecker Sandor wrote: > Hi! > > I write a program for a win98 machine, and I use (thenks for this list) the > Win32::Serialport module. But I would like to test this program under Linux, so > I would like to write something like this: > > package Utils; > #ifdef __WIN32

RE: Rename hash keys

2003-09-04 Thread Arms, Mike
Gerard ter Haar ([EMAIL PROTECTED]) wrote: > I have a hash related question. Thanks in advance for your assistance! > > I have quite a large number of values in a hash: > > $errs->{ err_main_notfound } = "file not found. check config."; > $errs->{ err_main_perms } = "no permissions, check docs".;

Re: Rename hash keys

2003-09-04 Thread Keith C. Ivey
Gerard ter Haar <[EMAIL PROTECTED]> wrote: > $errs->{ err_main_notfound } = "file not found. check config."; > $errs->{ err_main_perms } = "no permissions, check docs".; > $errs->{ err_main_unknown } = "unknown error occured."; > > Now I would like to remove the _main part of the hash keys, so I

Re: Rename hash keys

2003-09-04 Thread $Bill Luebkert
Gerard ter Haar wrote: > Hi! > > I have a hash related question. Thanks in advance for your assistance! > > I have quite a large number of values in a hash: > > $errs->{ err_main_notfound } = "file not found. check config."; > $errs->{ err_main_perms } = "no permissions, check docs".; > $errs->

RE: STDERR in Windows

2003-09-04 Thread Moon, John
Thank you. I will review that module... jwm -Original Message- From: Ryan Amschel [mailto:[EMAIL PROTECTED] Sent: September 04, 2003 19:31 To: 'Moon, John'; [EMAIL PROTECTED] Subject: RE: STDERR in Windows John, I have used Tie::STDERR to accomplish this. -Ryan Amschel ESRI -Ori

RE: Rename hash keys

2003-09-04 Thread Peter Guzis
Here's one way to do it: my @keys = keys %$errs; foreach my $key (@keys) { if (my ($suffix) = $key =~ /^err_main_(.+)/) { $errs->{"err_$suffix"} = delete $errs->{$key}; } } Peter Guzis Web Administrator, Sr. ENCAD, Inc. - A Kodak Company email: [EMAIL PROTECTED] www.encad.com -Orig

RE: Rename hash keys

2003-09-04 Thread Hanson, Rob
> Now I would like to remove the _main > part of the hash keys, so I would get... No, there is no way to change the name. The only way is to delete the key and create another one like this: $errs->{ err_notfound } = $errs->{ err_main_notfound }; delete $errs->{ err_main_notfound }; If you neede

RE: STDERR in Windows

2003-09-04 Thread Ryan Amschel
John, I have used Tie::STDERR to accomplish this. -Ryan Amschel ESRI -Original Message- From: Moon, John [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 3:45 PM To: [EMAIL PROTECTED] Subject: STDERR in Windows I have a perl script I have converted (pl2bat) to a .bat file

RE: Perl eval wierdness

2003-09-04 Thread Keith C. Ivey
Joseph Discenza <[EMAIL PROTECTED]> wrote: > Simple operations on constants are probably performed at compile > time (not an internals guru) even within an eval block. Someone > else would have to explain to you why all parsing of the eval > block is not delayed until runtime. Presumably because

Rename hash keys

2003-09-04 Thread Gerard ter Haar
Hi! I have a hash related question. Thanks in advance for your assistance! I have quite a large number of values in a hash: $errs->{ err_main_notfound } = "file not found. check config."; $errs->{ err_main_perms } = "no permissions, check docs".; $errs->{ err_main_unknown } = "unknown error occu

STDERR in Windows

2003-09-04 Thread Moon, John
I have a perl script I have converted (pl2bat) to a .bat file which will run from the scheduler on an NT platform. I would like to "capture" STDERR in a "file" so that it can be reviewed after the job is ran. Is there a way to do this in my perl script or the .bat file ? jwm __

Re: How do I measure text length? (+ How to measure page-width)

2003-09-04 Thread work
> PPS: Summary of answers to other questions: > > FreezePanes (to make only a lower/to-right section scroll) works on a > single cell, not a row or column. Do cellRange->Select; > app->ActiveWindow0>{FreezePanes} = 1; FreezePanes can work on a row or column, if you select that range. use Win32

Re: Perl eval wierdness

2003-09-04 Thread $Bill Luebkert
John Deighan wrote: > Consider this simple program: > > use strict; > use warnings; > eval { > my $x = 5; > my $y = $x / 0; # simulate an error > }; > if ($@) { > eval { # ignore errors in this code > print("An error occurred\n"); > } >

my bad Re: Perl eval wierdness

2003-09-04 Thread Randy Strauss
my bad. JD was right, ';' is a statement separator. { print "hi\n" } is fine. { eval {..} print "hi\n" } is not- the eval{..} needs a semi colon after it. -r ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState