jcwren has asked for the wisdom of the Perl Monks concerning the following question:
I am off on a jobsite without my trusty Perl CD Bookshelf.
I need(want) to pass named parameters to a subroutine, ala CGI..
do_this_cool_function (-retire=>'early', -payscale=>-55.00, -pizza=>'cold', -beer=>none);
I'm using 'use strict' and '-w'. The compiler throws up on my shoes with
"Can't use string ("-spot") as a HASH ref while "strict refs" in use at t.pl line 13."
A) What do I need to do remove this error,
B) How do I access the named arguments in the subroutine?.
I need(want) to pass named parameters to a subroutine, ala CGI..
do_this_cool_function (-retire=>'early', -payscale=>-55.00, -pizza=>'cold', -beer=>none);
I'm using 'use strict' and '-w'. The compiler throws up on my shoes with
"Can't use string ("-spot") as a HASH ref while "strict refs" in use at t.pl line 13."
A) What do I need to do remove this error,
B) How do I access the named arguments in the subroutine?.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Passing named parameters
by snowcrash (Friar) on May 02, 2000 at 10:45 UTC | |
RE: Passing named parameters
by ChOas (Curate) on May 02, 2000 at 10:50 UTC | |
by perlmonkey (Hermit) on May 02, 2000 at 11:38 UTC | |
by Adam (Vicar) on May 09, 2000 at 21:05 UTC | |
by perlmonkey (Hermit) on May 09, 2000 at 23:57 UTC | |
by eric256 (Parson) on Mar 25, 2004 at 16:59 UTC | |
|
Back to
Seekers of Perl Wisdom