|
|
| Perl Monk, Perl Meditation | |
| PerlMonks |
Re: I refuse to explain thisby Dominus (Parson) |
| on Apr 09, 2001 at 18:31 UTC ( [id://71098]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Says strredwolf:
$d and $q.OK, that just makes no sense at all. A state variable has to record state. The only thing $q is used for is to match the subtitution on the right side of the s{}{} with the pattern on the left. It's just a table lookup. In fact, an earlier version of the program omitted $q and just had:
I think the program probably would work fine with that change, although it would be less interesting. (It would sometimes go into an infinite loop for most interesting values of $_.) As for $d, it's only used internal to the regex itself, so it's obviously impossible that it could be a state variable.
The loop, of course, is conditional on $N.Of course, but $N never takes on any value except 0 or 1. State machines are normally understood to have more than two states. If what you're saying is that this is a state machine because it uses variables, then Oracle 8 is also a mere state machine.
In Section
Obfuscated Code
|
|
||||||||||||||||||||||||||||