Jeff Pang wrote:
Sayed, Irfan (Irfan) wrote:
Now I want only "test" from this string, so I wrote reg. ex. like this

Missing:

    use strict;
    use warnings;

$test="test@/vobs/pvob_aic";
$ts = ($test =~ m{(.+)@$});
print "$ts\n";

But I am getting output as 1 not a string "test"

'$' means end of a line,

Obviously not in this case, since the regex returns 1 in scalar context (i.e. it matches).

you shouldn't specify a $ here.

Agreed. ;-)

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

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


Reply via email to