Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
Can anyone please explain this code for printing fibonacci series
Thanx in advance!!!
Can anyone please explain this code for printing fibonacci series
2 3 5 8 13 21 34 55 89 144 233$ perl -le ' $==1,(1 x $_)=~/(^)(1|11\1)*(?{$=++})^/,print $= for 0..1 +0'
Thanx in advance!!!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Explain Fibonacci one-liner ??
by JavaFan (Canon) on May 10, 2010 at 15:47 UTC | |
Re: Explain Fibonacci one-liner ??
by Marshall (Canon) on May 10, 2010 at 16:56 UTC | |
by JavaFan (Canon) on May 10, 2010 at 18:27 UTC | |
Re: Explain Fibonacci one-liner ??
by ambrus (Abbot) on May 10, 2010 at 19:02 UTC | |
Re: Explain Fibonacci one-liner ??
by biohisham (Priest) on May 10, 2010 at 19:17 UTC | |
Re: Explain Fibonacci one-liner ??
by Marshall (Canon) on May 10, 2010 at 22:04 UTC | |
by JavaFan (Canon) on May 10, 2010 at 22:22 UTC | |
by Marshall (Canon) on May 11, 2010 at 00:24 UTC |
Back to
Seekers of Perl Wisdom