Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #40123] [TODO] push_eh + .param for argument mismatch errors

0 views
Skip to first unread message

Matt Diephouse

unread,
Aug 8, 2006, 2:56:59 PM8/8/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Matt Diephouse
# Please include the string: [perl #40123]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=40123 >


Currently, if you want to use an exception handler to catch argument
mismatch errors inside of your subroutine, you need to use get_params:

.sub foo
push_eh argument_mismatch
get_params '()'
clear_eh

...
.end

I'd really like to be able to use .param with this:

.sub foo
push_eh argument_mismatch
.param pmc a
.param pmc b
clear_eh

...
argument_mismatch:
print "too few/many arguments to 'foo'\n"
end
.end

.sub main :main
foo(1) # this would print the error and exit
.end

Ideally, I'd also be able to find out how many arguments were
actually passed (1 in this case).

--
Matt Diephouse

0 new messages