in reply to detecting file open failure
That looks a lot like the code I wrote in Re: Converting from string to SCALAR when using strict "refs". If I assume that what I learned about the problem back then still applies today, then I think you're looking for a way to tell if setting $processor failed in some way.
One way is to check $?, and that will tell you the exit status of the program you ran in backticks. I suspect you don't care about that, however, if the program gave you bogus output. What you really want is to check that you got a number from it.
To check that it gave you a number, like you want, look at ${$processor}. You could use Scalar::Util::looks_like_number, or you could match against a simple regular expression like so:
my $processor = \( 0+ `blah` ); if ( ${$processor} !~ m{ \A \d+ \z }xms ) { die 'oh noes'; }
If that doesn't do what you want, you'll have to explain better what you're looking for.
|
|---|