beast wrote:
> 
> Hi All,

Hello,

> Basically I want these input :
> name=
>    name=
> name        =
>    name   =
> 
> But I did not want these input:
> my name =
> name is =
> my name is =
> 
> -- 
> 
> if ( /\s*name\s*=/) {
>      print "Match: $_";
> }
> 
> did not works as i expected.

You need to anchor the pattern to the beginning of the line:

if ( /^\s*name\s*=/ ) {



John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to