in reply to Scope Issue
If you're using Perl 5.10 or greater, you can also use the defined or operator:
my $f1missing = $t->waitfor(String => 'That file is unavailable', errmode => 'return') // 0;What the code above does is similar to what Corion suggested. It tests whether the result is defined, and will substitute with 0 if it is not.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Scope Issue
by fidesachates (Monk) on Mar 15, 2011 at 13:12 UTC | |
by AR (Friar) on Mar 15, 2011 at 13:21 UTC | |
by MKJ747 (Acolyte) on Mar 15, 2011 at 13:51 UTC | |
by GrandFather (Saint) on Mar 15, 2011 at 21:03 UTC | |
by Anonymous Monk on Mar 15, 2011 at 13:19 UTC | |
by fidesachates (Monk) on Mar 15, 2011 at 13:23 UTC | |
|
Re^2: Scope Issue
by MKJ747 (Acolyte) on Mar 15, 2011 at 13:46 UTC | |
by MKJ747 (Acolyte) on Mar 15, 2011 at 15:05 UTC | |
by Corion (Patriarch) on Mar 15, 2011 at 15:08 UTC | |
by MKJ747 (Acolyte) on Mar 15, 2011 at 15:50 UTC |