Page 1 of 1

Cleaned Selenium Perl still does not work (what to do)?

Posted: Wed Jul 20, 2016 9:10 am
by dlukinski
Hello XI support

Cleaned Selenium Perl (attached) still does not work (what to do)?

Code: Select all

[root@fikc-nagxidev01 libexec]# perl nagios_test1
"my" variable $sel masks earlier declaration in same scope at nagios_test1 line 61.
"my" variable $sel masks earlier declaration in same scope at nagios_test1 line 62.
"my" variable $sel masks earlier declaration in same statement at nagios_test1 line 62.
"my" variable $sel masks earlier declaration in same scope at nagios_test1 line 66.
"my" variable $sel masks earlier declaration in same scope at nagios_test1 line 73.
"my" variable $sel masks earlier declaration in same scope at nagios_test1 line 102.
"my" variable $sel masks earlier declaration in same scope at nagios_test1 line 103.
"my" variable $sel masks earlier declaration in same statement at nagios_test1 line 103.
"my" variable $sel masks earlier declaration in same scope at nagios_test1 line 107.
"my" variable $endtime masks earlier declaration in same scope at nagios_test1 line 114.
"my" variable $sel masks earlier declaration in same scope at nagios_test1 line 114.
syntax error at nagios_test1 line 37, near "elsif"
syntax error at nagios_test1 line 41, near "last WAIT }"
syntax error at nagios_test1 line 52, near "last WAIT }"
syntax error at nagios_test1 line 66, near "last WAIT }"
syntax error at nagios_test1 line 76, near "elsif"
syntax error at nagios_test1 line 80, near "last WAIT }"
syntax error at nagios_test1 line 91, near "last WAIT }"
syntax error at nagios_test1 line 107, near "last WAIT }"
syntax error at nagios_test1 line 117, near "elsif"
syntax error at nagios_test1 line 121, near "last WAIT }"
nagios_test1 has too many errors.
1..0

Re: Cleaned Selenium Perl still does not work (what to do)?

Posted: Wed Jul 20, 2016 9:35 am
by mcapra
Is this script of your own design? It doesn't look like anything clean_selenium_script would churn out.

An elsif chain is broken starting at line 37. If you break an elsif chain in perl (or most languages), you need to start it up with a new if evaluation.

There are also some scoping issues mentioned in your script's output.
http://perlmaven.com/scope-of-variables-in-perl

Re: Cleaned Selenium Perl still does not work (what to do)?

Posted: Tue Dec 20, 2016 9:36 am
by dlukinski
mcapra wrote:Is this script of your own design? It doesn't look like anything clean_selenium_script would churn out.

An elsif chain is broken starting at line 37. If you break an elsif chain in perl (or most languages), you need to start it up with a new if evaluation.

There are also some scoping issues mentioned in your script's output.
http://perlmaven.com/scope-of-variables-in-perl
Please close this support thread

Thank you