It was Friday, July 04, 2003 when David Storrs took the soap box, saying:
: I've got a function that takes several arguments, the first of which
: should be a scalar (specifically, a string). I'd like to have a
: precondition to verify that the argument is, in fact, a scalar. Is
: there a way to do that (preferably without using modules--I'm trying
: to write an entirely self-contained script).
Provided that you really have a function, that you're calling as a
function, you can use prototypes. They are documented in perlsub, and
have the following syntax.
sub function($) {
}
This will require the first argument to be scalar. If the first
argument is mandatory, follow the dollar sign ($) with a semi-colon
(;).
Casey West
--
"DOS addresses only 1 Megabyte of RAM because we cannot imagine any
applications needing more."
-- Microsoft, 1980, on the development of DOS
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]