in reply to Test::More not working with Perl local special variables

Just thought I would follow this up with my alternative solution to this (for anyone who is curious or has a similar issue).

After reading more on Test::More I decided to use the pass and fail functions instead. This means I can do a normal if statement with the regex pattern matching and pass $1 or $& into them instead. For example:

if ($sel->get_value("name=wlSsid_wl0v0") =~ /(\S{1,})/) { pass("1000.0362 SSID - $1 - was displayed on the wireless settings pag +e"); } else { fail("1000.0362 SSID - $1 - was displayed on the wireless settings pag +e"); }

It's a bit more clunky but does the job nicely.

Replies are listed 'Best First'.
Re^2: Test::More not working with Perl local special variables
by choroba (Cardinal) on Apr 23, 2013 at 08:01 UTC
    What do you expect $1 will contain in the else branch?
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      That was a quick copy/paste job and I didn't realize. Obviously $1 will be undefined so the else statement will be adjusted accordingly. I will keep the rest of the statement the same as that will be what helps identify each test.