Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Variant permutation

by bsb (Priest)
on Aug 30, 2003 at 14:07 UTC ( [id://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__

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-24 11:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found