Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Improve readability of Perl code. Naming reference variables.

by kcott (Archbishop)
on Jan 21, 2017 at 20:06 UTC ( [id://1180091]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Improve readability of Perl code. Naming reference variables.
in thread Improve readability of Perl code. Naming reference variables.

sub func { my ( $rs_str, $hr_desktop_info, $ha_files ) = @_; $$str = update_string_ref(); for ( keys %$desktop_info ) { ... push @$files, $file; } .... }

I rather feel that $$str, %$desktop_info and @$files make it pretty clear, not only that your dealing with references, but also what type of references they are.

If you're having problems reading that, I suggest you do what ++stevieb has already alluded to and put the prefixes in a comment. Something like:

my ($str, $desktop_info, $files) = @_; # rs, rh, ra

Update (minor typo fix): s{deck}{desk} in ..., %$decktop_info and ....

— Ken

Log In?
Username:
Password:

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

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

    No recent polls found