in reply to Re^2: usage of "my" keyword (quibble re clarity)
in thread usage of "my" keyword

if i dont want to loose that variable scope & also i want to use strict then how can i edit it

Its simple, use another variable that isn't $row

my $what; for my $row ( $min .. $max ){ if( $data == $required ){ $what = $row; last; } } print "Data presented in:: $row \n";

Replies are listed 'Best First'.
Re^4: usage of "my" keyword (quibble re clarity)
by ravi45722 (Pilgrim) on Aug 20, 2015 at 07:22 UTC

    I am done in the same way. But i think MONKS will reduce the code without creating another module. Anyway thanks for your reply

      I am done in the same way. But i think MONKS will reduce the code without creating another module. Anyway thanks for your reply

      :) I am MONKS, and yes I'm fairly confident its not possible to do this without another variable (not module)