Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Variant permutation

by bsb (Priest)
on Aug 30, 2003 at 14:07 UTC ( #287908=note: print w/ replies, xml ) Need Help??

in reply to Variant permutation

Can anyone suggest a more linear course of action?
Not me. I can suggest something stupid though.

My pet toy at the moment, genexes.

(Generating regex strings with a regex)

#!/usr/bin/perl -wl use strict; use re "eval"; my @array = ( [ 'a', 'b', 'c' ], [ 1, 2 ], ['x', 'y', 'z'], [7, 8, 9] ); my $re; map { $re .= "(\n". '((?{$^R."' . join('"})|(?{$^R."', @$_) . qq'"}))\n'; } @array; $re .= ")?" x @array; $re .= '(?{ push @_, $^R })(?!)'; print $re; ''=~/$re/x; print for(grep defined($_), @_); __END__

Comment on Re: Variant permutation
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://287908]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2015-08-31 02:50 GMT
Find Nodes?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...

    Results (351 votes), past polls