[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] crazy hoops to do something that seems so simple?



(first off, there has to be an easier way to generate a variable containing
a-z and z-a, but since I just created these to test with anyway, it's not
crucial)

my $forwards = join('', @{['a'..'z']});
print $forwards, "\n";
my $backwards = reverse('a'..'z');
print $backwards;

perl 5.004 doesn't understand the sort of
    my $forwards .= for ('a'..'z');
context (sigh) that you later version users have, and if I use
    my $forwards = 'a'..'z';
I get non-numeric errors in 'flip' and 'flop' whatever they are.


second, it is apparently not obvious to translate tr/a-z/z-a/ since it
doesn't work that way, but to have to write

(my $coercename = $filename) =~ tr/A-Z/a-z/;
$coercename =~ tr/abcdefghijklmnopqrstuvwxyz/zyxwvutsrqponmlkjihgfedcba/;

seems *ridiculously* cumbersome.

pray tell, is there a better way?

It suddenly dawned on me that while I wanted to sort the ratings DESCENDING,
I also wanted to sort the filenames ASCENDING

so that as-mapname (7.5) comes before as-thismapsucks (7.5)

it seemed to me that the easiest way to do this is to reverse the
alphabetization of the coerced name key for the hash, but trying to do it
gave me headaches until I just typed out the entire reversed alphabet (ugh)

awaiting enlightenment,



# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org