in reply to Re: Re: Is this enough good, or can be improved?
in thread Is this enough good, or can be improved?
perhaps this is better.
#!/usr/bin/perl use strict; use warnings; $a = "12.2424.4812367"; $a =~ s/(?x) ( (?# match integer and floating point numbers ) (?: \d+ (?: \. \d+ )? ) ) ( (?# execute code, match result ) (??{ ## return twice the first argument sub{ shift() * 2 }->( $1 ) }) ) / ## print the arguments as a couple sub{ join( '', '(', shift(), ',', shift(), ')' ) }->( $1, $2 ) /ge; print $a;
~Particle *accelerates*
|
|---|