Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Fibonacci Generator

by sifukurt (Hermit)
on Aug 10, 2001 at 19:50 UTC ( [id://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.
___________________
Kurt

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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-20 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found