Replacement in a string with a function call.
- From: "K.J. 44" <Holleran.Kevin@xxxxxxxxx>
- Date: 28 Nov 2006 10:51:23 -0800
Hi,
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)/;
The string is named $details[$i] and resolveDNS is the function. The
function itself works. The IP Addresses I want to match are followed
by a colon and I do not want to match any other IP Addresses.
It is not making the subsitutions. It simply substitutes
&resolveDNS(IPADDRESS) instead.
Is there a way to call the function to have it return the value that i
want replaced?
Thanks.
.
- Follow-Ups:
- Re: Replacement in a string with a function call.
- From: Gunnar Hjalmarsson
- Re: Replacement in a string with a function call.
- Prev by Date: Re: Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema
- Next by Date: perl on Mac/OS X Tiger
- Previous by thread: Perlthrtut threadqueue example : possibly incorrect ?
- Next by thread: Re: Replacement in a string with a function call.
- Index(es):
Relevant Pages
|