On 3/29/11 Tue  Mar 29, 2011  4:50 PM, "Noah Garrett Wallach"
<noah-l...@enabled.com> scribbled:

> Hi there,
> 
> s/(\d+)\.(\d+)\.(\d+)\.(\d+)/$1:$2:$3:$4::0/
> 
> so is there a slick, easily readable way  to get the value $1, $2, $3,
> $4 to be rewriten as  %x instead of a %d?

Try this:

s/(\d+)\.(\d+)\.(\d+)\.(\d+)/sprintf('%x:%x:%x:%x::0',$1,$2,$3,$4/e;



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to