in reply to Fibonacci golf with one state variable

Not the shortest, but how do you like this? It prints the whole sequence upt to the first number needing an exponent.

perl -e '$_||="0$/1";s;(.+)$/(.+)$;"$1$/$2$/".($1+$2);ge while!/e/;pri +nt'

BTW: What's "say"? My perdoc doesn't tell me anything about it.


s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

Replies are listed 'Best First'.
Re^2: Fibonacci golf with one state variable
by Lawliet (Curate) on Oct 05, 2008 at 22:32 UTC
    "BTW: What's "say"? My perdoc doesn't tell me anything about it."

    It's like print, but appends a newline. See say.

    I'm so adjective, I verb nouns!

    chomp; # nom nom nom

Re^2: Fibonacci golf with one state variable
by ikegami (Patriarch) on Oct 05, 2008 at 23:01 UTC
    It's new in 5.10, and so is -E.