Hello All!

> Peter Makholm wrote:
>> 
>> Trying to do completly stupid stuff with perl I tried to do the
>> following:
>> 
>> xyzzy% perl -le 'sort {print "a:$a\tb:$b"; $a cmp $b} qw(5 2 3 4 1)'

sort in non-array context is noop.

quote from perl-5.6.1/pp_ctl.c:
    if (gimme != G_ARRAY) {
        SP = MARK;
        RETPUSHUNDEF;
    }

it would be very useful in golf to force array context with sort:
    $i_need_add_something_to_number_of_letters+sort/\w/g

but unfortunately you need to write one stroke longer:
    $i_need_add_something_to_number_of_letters+${[/\w/g]}
or
    $i_need_add_something_to_number_of_letters+(()=/\w/g)

---
Mtv Europe

Reply via email to