Re: Trap undefined barewords in subroutines

2017-08-02 Thread Shawn H Corey
On Wed, 2 Aug 2017 18:48:43 + "Dyer, Dustin E. (KSC-VAH10)" wrote: > So is there something different I can do to cause an error when > provided files contain undefined barewords? Do you mean something like this? my $someVar = '[map {$_ - 250 * FT2M} 1,2,3,]'; #FT2M is undef eval $someVar;

Re: Trap undefined barewords in subroutines

2017-08-02 Thread Chas. Owens
I believe your best bet is to use string eval instead of do and injecting "no strict qw/vars/;" into the code (to prevent your use strict from requiring the variables be declared). I would spend a bit of time trying to understand where these files come from and fixing that though. There has to be

Trap undefined barewords in subroutines

2017-08-02 Thread Dyer, Dustin E. (KSC-VAH10)
How can I detect and/or error on undefined barewords in perl subroutines? I receive data files in perl, and I'd like to read them into Matlab. Some of the files contain barewords that I don't have an implementation for. When I process these files using the do command, the undefined barewords a