Re: Replacement in a string with a function call.
- From: Gunnar Hjalmarsson <noreply@xxxxxxxxx>
- Date: Tue, 28 Nov 2006 20:31:47 +0100
K.J. 44 wrote:
What I want to do is search a string, find an IP Address, and replace------------------------------------------------^
that with the DNS name.
$details[$i] =~ s/(\d+)(\.\d+)(\.\d+)(\.\d+):/&resolveDNS($1$2$3$4)/;
Why the '&'?
Why aren't you using strictures?
Besides that, you need the /e modifier.
perldoc perlre
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.
- Follow-Ups:
- Re: Replacement in a string with a function call.
- From: Gunnar Hjalmarsson
- Re: Replacement in a string with a function call.
- References:
- Replacement in a string with a function call.
- From: K.J. 44
- Replacement in a string with a function call.
- Prev by Date: Re: perl on Mac/OS X Tiger
- Next by Date: Re: perl on Mac/OS X Tiger
- Previous by thread: Replacement in a string with a function call.
- Next by thread: Re: Replacement in a string with a function call.
- Index(es):
Relevant Pages
|
|