On 5/3/05, Ing. Branislav Gerzo wrote:
> 
> CD>    my $address = '[EMAIL PROTECTED]';
> CD>    my ( $domain  = $address ) =~ m/@(.*)/;
> 
> uff, I think you write this in hurry, this simply won't work.

For completeness, you really should write what *will* work. Here's a
correct version:
   my $address  = '[EMAIL PROTECTED]';
   my ($domain) = $address =~ m/\@(.+)/;

And one more, using s/// instead of m// :
   my $address = '[EMAIL PROTECTED]';
   (my $domain = $address) =~ s/^.+?\@//;

-- 
Offer Kaye

--
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