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

Re: Optimizing the bejeezus out of a sub

by tall_man (Parson)
on Jun 24, 2003 at 15:42 UTC ( [id://268558]=note: print w/replies, xml ) Need Help??


in reply to Optimizing the bejeezus out of a sub

Is this really what you want to do? If $val is defined, print it. Otherwise, pass undef and a string concatenated with undef to a subroutine. I suspect your code has never branched to that case, since it is almost certainly a bug.
print $fh defined($val) ? $val : $self->_nosuchvar($val,"\$".$val);

Replies are listed 'Best First'.
Re: Re: Optimizing the bejeezus out of a sub
by sgifford (Prior) on Jun 24, 2003 at 16:29 UTC

    No, you're right; I introduced that error while optimizing. It should be:

    print $fh defined($val) ? $val : $self->_nosuchvar($v->[_contents], "\$".$v->[_contents]);
    Thanks!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2024-04-19 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found