Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Re: Fibonacci Generator

by sifukurt (Hermit)
on Aug 10, 2001 at 19:50 UTC ( #103921=note: print w/replies, xml ) Need Help??

in reply to Re: Fibonacci Generator
in thread Fibonacci Generator

Ooooo, I like that. Hadn't even thought of doing it that way. I'm updating the posted code using your suggestion.

I think I developed using strict and whatnot. I almost always do unless it is only going to be a two- or three-liner. Sometimes I still unconsciously rebel against my COBOL days and forget to use strict, but that happens far less often than it used to.

Replies are listed 'Best First'.
Re: Re: Re: Fibonacci Generator
by John M. Dlugosz (Monsignor) on Aug 11, 2001 at 07:16 UTC
    if ($opt_c) { $\ = "\n"; } else { $\ = " "; }
    You can avoid that ugly if/else and excess braces by writing:
    $/= $opt_c ? "\n" : " ";

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://103921]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2023-03-28 20:40 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (69 votes). Check out past polls.