Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Unicode in almost any Browser?!?

by chromatic (Archbishop)
on Jan 17, 2001 at 10:25 UTC ( [id://52468]=note: print w/replies, xml ) Need Help??


in reply to Unicode in almost any Browser?!?

Is there any particular reason (bug workaround, stylistic evolution, personal preference, difference in functionality of which I'm not aware) some of the param accesses use the logical or operator and others use a defined check?

I prefer the form:

my $bcol = $q->param("bcol") || "03072B";

It is concise and easy to read. Consistency is very important, especially when debugging.

Replies are listed 'Best First'.
Re: Re: Unicode in almost any Browser?!?
by PipTigger (Hermit) on Jan 17, 2001 at 16:12 UTC
    I thinq I did it that way because I wanted the form to accept "0" for the border width && cell padding but not for any of the other fields. If the form is submitted with a "0" in the fields seeded w/ "|| xxxx", it'll get the default value but I used the "unless defined" construct in order to avoid overriding a valid "0" value from the form. I'm sure I'm describing this way too verbosely here. I hope it makes sense.

    There's surely a better way I'm not aware of to handle these conditions in the code too. I really should've used the "here document" method for printing all that stuff to. Thanks for the suggestion OeufMayo! I'll try to remember that next time =). Shalom.

    -PipTigger
      I'll try to remember that next time =).
      yeah, right. ;-)
        Hey you skeptic! Look at my code from a few months ago. Who would've thought I'd actually start using "#!perl -w" && "use strict;" but it happened. I'll use a here document in the future too. I'm not opposed to doing things in a new way if I lern that it's better than what I have been doing. In fact I didn't normally use the qq() function either... I used to escape all my double quotes.

        So I am adopting new habits. I am constantly trying to become a more efficient && elegant Perl hacker... a more practiced Monk if you will. I'm all defensive about it because I care what you thinq! You're just trolling me aren't you!?! Punko! I'll get you back! ;-) TTFN.

        -PipTigger
        p.s. Initiate Nail Removal Immediately!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-24 08:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found