And i have this following issue in my shell :use vars '$start'; sub Start_timer : Test(startup) { my $start = time(); cprint "#\x037Started at ", (strftime '%A %d %B %Y %H:%M:%S',localti +me($start)), "\x030\n"; } sub End_timer : Test(shutdown) { print time - $start; my $end = time; cprint "#\x037Ended at ", (strftime '%A %d %B %Y %H:%M:%S', localtim +e($end)),"\x030\n"; cprintf "#\x035 Total run time=>", $end-$start, " seconds\n"; cprintf ("%02d:%02d:%02d\x030\n",(gmtime($end-$start))[2,1,0]); }
ok 243 - Logout ok Use of uninitialized value $MyTest::start in subtraction (-) at MyTest +.pm line 402. 1463646157#Ended at jeudi 19 mai 2016 10:22:37 Use of uninitialized value $MyTest::start in subtraction (-) at MyTest +ingSuite.pm line 407. # Total run time=>Use of uninitialized value $MyTest::start in subtrac +tion (-) at MyTest.pm line 408. 08:22:37
In reply to Re^2: Recover a variable from a function
by Chaoui05
in thread Recover a variable from a function
by Chaoui05
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |