http://www.perlmonks.org?node_id=582169


in reply to Golfing a fibonacci number generator

Well, I'm not exactly addressing your math, but I can shave a couple of characters off your map:

die map{int((($;=((1+($^=5**.5))/2)**$_)-((-1**$_)/$;))/$^).$/}0..9

By changing the map to use the coderef syntax, you eliminate the need for the comma between the operation and the operands. You can also get rid of that last semicolon in the map block, as it is uneeded.

My personal fibonacci generator is:

@@=(1,1);push(@@,$@[0]+$@[1]),print(shift@@)for(1..20)

Ivan Heffner
Sr. Software Engineer, DAS Lead
WhitePages.com, Inc.