x=i=1;p x+=i=x-i while+1
2006-11-17 Retitled by Arunbear, as per Monastery guidelines Original title: 'Fibonacci numbers - final shot - 24 chars'
Meh, if you don't have to use perl, you can do much better:
Re: Fibonacci numbers (again).
Update: let's put them under each other to see which one is longer.
1 2 3
ruby -e'x=i=1;p x+=i=x-i while+1'
It's also easy to shorten the ruby version by two characters
That's 33, not 24 (since omitting the first line gives a compile error).
If you want really small, try 4!
I'm sure f can be made way smaller than ruby.
Update: Downsized from 10
ruby -e 'x=i=1;p x+=i=x-i while+1'
While your first post ran in Perl, this one doesn't.
syntax error at 584097.pl line 1, near "ruby -e "
Execution of 584097.pl aborted due to compilation errors.
A Programming Language, 1962
Programming the 1900 series in COBOL, 1974
Algorithms + Data Structures = Programs, 1976
The C Programming Language, 1978
System V - Interface definition, 1986
Z80 Assembly Language Programming, 1979
TheSOURCE User's Manual, 1979
The C Primer, 1983
Interactive Fortran 77, A Hands on Approach, 1984
Perl.1 man page, 1991
Results (334 votes),