in reply to Perl script comes out because of a command failure. How to overcome it?
G'day Sharath,
I'd recommend starting by cleaning up your code. I don't know if you've shown everything here: there's a few things that could potentially cause problems that can easily be avoided. Here's some suggestions:
Your current code:
my $req; while ($req = ...
would probably be better as:
while (my $req = ...
And I suspect:
chomp;
is supposed to be:
chomp $req;
Once you've done that, it's possible your current problems may be resolved (I'm unfamiliar with this adb program you mention, so I don't really know). However, assuming that's not the case, look at eval for a way to trap errors: you'll want the block form of eval which you'd code something like this:
eval { # Code which might generate an error } if ($@) { # Handles any errors here # $@ holds the error message }
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl script comes out because of a command failure. How to overcome it?
by ramki067 (Acolyte) on Nov 05, 2013 at 08:58 UTC | |
by kcott (Archbishop) on Nov 05, 2013 at 09:44 UTC |