http://www.perlmonks.org?node_id=140606


in reply to returning word from a file position

change:
( $word1 ) = $file =~ /EditorName\b.+\b(\s*)/;
to:
( $word1 ) = ($file =~ /EditorName\b(.+?)\b\s*/);
to extract the thing matched in the ( ) the =~ has to be in array context, thus the parens. In scalar context you get the number of matches. Aside from that, I suspect that you really want the .+ part, not the \s* part. Also .+ will match as much as it can, which is probably more than you want, so the ? makes it match as little as it can...just the stuff between the two \b's.

HTH

/\/\averick
perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"