Hi Edward,

If you want to make a class of warnings fatal, 
http://perldoc.perl.org/perllexwarn.html tells you what the warning classes are 
('numeric', in your case), and shows how to do it:

use warnings FATAL => 'numeric';

OR make all warnings fatal:

use warnings FATAL => 'all';

Derek

On Apr 3, 2012, at 2:01 PM, Chris Marshall wrote:

> Edward-
> 
> I don't see a quick way to do this directly from
> rcols() but you could use the EXCLUDE option
> to have rcols skip the lines with entries matching
> a "bad" pattern.  If you need to do more, then I
> suggest adding a data validation check to the
> input file before slurping in with rcols.
> 
> --Chris
> 
> On Tue, Apr 3, 2012 at 12:14 PM, Hyer, Dr. Edward
> <[email protected]> wrote:
>> Chris,
>> 
>> The problem was not with PDL, exactly: basically, a routine created a 
>> temporary ASCII file, which either because of errors in the inputs or errors 
>> in the processing code, contained bad data-- specifically, values that 
>> exceeded the format codes used to write them, resulting in '***' in the 
>> file. When PDL 'readcols' got to that file, it spat out a warning telling me 
>> that the temporary file had bad values.
>> But because the warning was non-fatal, the routine moved on, the temporary 
>> file was erased, and the error log gave no indication of how to find where 
>> the problem had occurred-- that is, where the bad data had come from.
>> What I need is a way to couch the call to PDL so that the error in 'readcol' 
>> is fatal, stops everything, and gives me a backtrace.
>> 
>> You were talking about the Perl debugger, which I am sure is capable of 
>> this, but I have never used.
>> 
>> I hate asking for "suggestions for dumb people" but that's what I need.
>> 
>> Thanks,
>> 
>> --Edward H.
>> 
>> 
>> -----Original Message-----
>> From: Chris Marshall [mailto:[email protected]]
>> Sent: Tuesday, April 03, 2012 4:49 AM
>> To: Hyer, Dr. Edward
>> Cc: [email protected]
>> Subject: Re: [Perldl] Catching, or at least tracing, PDL errors
>> 
>> Were you able to track down the problem?
>> 
>> --Chris
>> 
>> On Fri, Mar 30, 2012 at 2:12 PM, Chris Marshall <[email protected]> 
>> wrote:
>>> You'll have to provide more information about
>>> your PDL install (version number,...) since my
>>> line 459 in Misc.pm does not have a multiplication
>>> on it.  You could try running under the perl
>>> debugger and put a breakpoint on the line in
>>> question when the argument "********" is found.
>>> 
>>> --Chris
>>> 
>>> To track this down,
>>> 
>>> On Fri, Mar 30, 2012 at 1:04 PM, Hyer, Dr. Edward
>>> <[email protected]> wrote:
>>>> Here is my error:
>>>> 
>>>> Argument "********" isn't numeric in multiplication (*) at
>>>>        
>>>> /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/PDL/IO/Misc.pm 
>>>> line 459, <$fh> line 6 (#1)
>>>>    (W numeric) The indicated string was fed as an argument to an operator
>>>>    that expected a numeric value instead.  If you're fortunate the message
>>>>    will identify which operator was so unfortunate.
>>>> 
>>>> I know how it happened, but I'm having a terrible time finding the problem 
>>>> and fixing it because I have no information on the backtrace, and this 
>>>> error is non-fatal. I tried using 'use diagnostics' but to no avail.
>>>> 
>>>> This happened on one of thousands of calls to this library, and without a 
>>>> backtrace, I have no way to figure out which one.
>>>> 
>>>> Thanks in advance,
>>>> 
>>>> --Edward H.
>>>> 
>>>> 
>>>> Dr. Edward J. Hyer
>>>> Physical Scientist
>>>> Naval Research Laboratory
>>>> Marine Meteorology Division
>>>> 7 Grace Hopper Avenue, Stop 2
>>>> Monterey, California 93940
>>>> 831-656-4023
>>>> FAX 831-656-4769
>>>> [email protected]
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Perldl mailing list
>>>> [email protected]
>>>> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
> 
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
> 


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to