On Wed, 20 Sep 2000 07:03:33 -0600, Tom Christiansen wrote:

>I'm pretty sure it's not just the people coming from C who expect this.

Uh-oh.

>This all points to the bug^H^H^Hdubious feature which is the sub($)
>context template as applied to named arrays and hashes.  Requiring
>an explicit conversion would help a lot.  Or so it seems.

I think you've nailed it on the head. I've tested it, and you can't use
a generic list for arguments:

        print length(@a, 'this is a string');
-->
    Too many arguments for length at test.pl line 2, near "'this is a
    string')"
    Execution of test.pl aborted due to compilation errors.

So length is already picky on what it accepts. You need to turn it into

        print length(scalar(@a, 'this is a string'));

to get perl to accept it.

Let's just make length()-- and all other functions with ($) as
proptotype -- reject hashes and arrays. Those are currently probably the
only weird things, that it does accept.

-- 
        Bart.

Reply via email to