Opened 5 years ago

Last modified 4 years ago

#648 new enhancement

beginner error: do not use $a and $b outside of sort

Reported by: szabgab Owned by:
Priority: major Milestone:
Component: Context Sensitive Help Version: 0.47
Keywords: Cc:

Description

If someone writes my $a or my $b (as could have be seen in trunk/Padre/lib/Padre/Document/Perl.pm until r8595) it should be pointed out that it is a bad practice to use either of those as they are special variables of sort().

Also any other use that is clearly not related to sort should be discouraged. I think and assignment to $a or $b should be also caught
but make sure to allow for external sort functions eg.

sub sort_by_num { $a <=> $b }

is a legitimate code.

Such practices should be probably caught in comments as well to avoid distributing bad examples?

Change History (1)

comment:1 Changed 4 years ago by zenogantner

  • Summary changed from beginner error: do not use $a and $b outisde of sort to beginner error: do not use $a and $b outside of sort

fix typo in summary

Note: See TracTickets for help on using tickets.