Bryan Harris wrote:


I don't claim to be a master, but you can do something along the lines of:

$range = '4.3:8.3';
$range =~ /(\d+).(\d+).(\d+).\2/ and print map "$_.$2 ", $1 .. $3;

Since it appears you require that the fractional part be the same for both
ends of the range, I'm just capturing the integer parts and using Perl's
range operator to build the list to feed to map()
>
> I do have a question, I notice you use "and" like an if..then.  What if you
> wanted to do two things if that =~ held true?  Is that possible?

Yes.

if ( $range =~ /(\d+).(\d+).(\d+).\2/ ) {
    print map "$_.$2 ", $1 .. $3;
    # do something else
    }



John
--
use Perl;
program
fulfillment

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