in reply to Re^3: extract the value before a particualr string
in thread extract the value before a particualr string

So, if we need to do the operation on a variable line and assign the output to a variable how do we go abt it???

$count = $line if/\s+?(\d+?)\/total$/;

will this look fine?

Replies are listed 'Best First'.
Re^5: extract the value before a particualr string
by hdb (Monsignor) on Sep 05, 2013 at 11:49 UTC

    No, that would be

    $count = $1 if $line =~ /\s+?(\d+?)\/total$/;