http://qs1969.pair.com?node_id=1180071


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

Hi stevieb,

Yes I think I get the point :) But consider another example, a sub routine is called with three references. A scalar reference, a hash refernece, and an array reference. Here is an example of a corresponding sub definition:

sub func { my ( $str, $desktop_info, $files ) = @_; #sref, href, aref ... }
In this case your end-of-line comment could work. But would it not be better if the comment could be avoided? If the variable names were self-documenting there would be no need for the comment. And the code should be easier to maintain. If you change the arguments to func you do not need to also remember to update the comment:
sub func { my ( $str->$, $desktop_info->%, $files->@ ) = @_; ... }