in reply to Re: How to perform different sorts on multiple sections of items in the same array
in thread How to perform different sorts on multiple sections of items in the same array

The .* is not required in your match expression nor is the /g. The whole loop can be replaced by:

my @selected = grep {/r/} @array;

Note that neither version of the matching code actually performs a sort so the variable name is more appropriately 'selected' than 'sorted'.

Perl is the programming world's equivalent of English
  • Comment on Re^2: How to perform different sorts on multiple sections of items in the same array
  • Download Code