Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: RFC: CGI::Tables (topicalize with for)

by chip (Curate)
on May 11, 2003 at 01:14 UTC ( #257182=note: print w/replies, xml ) Need Help??


in reply to Re^2: RFC: CGI::Tables (topicalize with for)
in thread RFC: CGI::Tables

Absolutely; I often topicalize with for. But I'd also write "ref $_" as "ref" or "ref()" -- concision!

    -- Chip Salzenberg, Free-Floating Agent of Chaos

Replies are listed 'Best First'.
Re^4: RFC: CGI::Tables (topicalize with for)
by Aristotle (Chancellor) on May 11, 2003 at 02:19 UTC
    I don't generally like foo() much for routines that operate on $_. In this case I added it because I'd've had to if I'd written
    'HASH' eq ref ? $_ : {}
    as the question mark is then parsed as a pattern delimiter instead of as part of a ternary. I usually write my comparisons that way around. But here neither the parens nor the variable is necessary as the following eq is unambiguous as to its meaning.

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://257182]
help
Chatterbox?
[Eily]: oh, boolean context uses the "" overload if no bool overload has been defined
[Eily]: (I wondered if overloading bool was actually necessary)
[Corion]: Yeah, you need bool to get a true value, and the rest to return the other value ;)
[choroba]: perl -wE '{package o; use Tie::Scalar; use parent -norequire => "Tie::StdScalar" ;sub FETCH { "x" x int rand 2}} tie my $x, "o" ; say $x for 1 .. 10'

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2017-07-27 13:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (414 votes). Check out past polls.