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

Re: How would you simplify this code?

by NetWallah (Canon)
on Apr 07, 2011 at 04:20 UTC ( [id://897929]=note: print w/replies, xml ) Need Help??


in reply to How would you simplify this code?

Untested:
$args($_) ? $self->$_($args{$_}) : $self->$_ or die "Missing variable + $_" for qw|resource username|;
Just use "$self-><Varname>" instead of the lexically defined var names for the rest of the sub.

     Syntactic sugar causes cancer of the semicolon.        --Alan Perlis

Replies are listed 'Best First'.
Re^2: How would you simplify this code?
by elTriberium (Friar) on Apr 07, 2011 at 05:48 UTC
    Cool, didn't know that this would work. I like the idea but it looks very "line noise"-ish.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 14:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found