Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2014-10-31 17:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (221 votes), past polls