"Mr. Shawn H. Corey" schreef:
> Tom Allison:
>> Maybe I'm getting old, but I'm starting to thing that if there is a
>> method/sub/function/whatever that has more than one argument, one
>> should always pass the args as a hash reference. This eliminates
>> the problems of getting the variables out
On Thu, 2006-20-04 at 20:54 -0400, Tom Allison wrote:
> Maybe I'm getting old, but I'm starting to thing that if there is a
> method/sub/function/whatever that has more than one argument, one should
> always
> pass the args as a hash reference. This eliminates the problems of getting
> the
>
Hi,
> It's probably slower and higher memory usage, but it seems to make
> sense.
> Any one else have suggestions on how to keep the args straight?
>
I would document my functions first. Pod is good.
The hash ref idea is good for constructors with lots of optional params.
Regards,
Edward WI
sub make_binary
{
my $vars = shift;
return eval "sub { $vars; }";
}
I understand the mechanism of the closure, but I don't figure out how
the anonymous subroutine puts the two arguments in $_[0] and in $_[1] ?
Its evaling a string and $vars is being interpolated so the eval, in
that e
root am Freitag, 6. Januar 2006 13.15:
> Hello,
> about closure I read the
>
> Perl literacy course
>
> lecture #9 Closures
>
> Shlomo Yona http://cs.haifa.ac.il/~shlomo/
>
>
> The explanations are clear but in this example:
> (it's an excerpt of an example of Shlomo)
>
> #!/usr/bin/perl
> use war
On 26 Mar, Carlos Mantero wrote:
> However, today I need a program that accepts many
> arguments but I've tryied to make for myself but it's impossible.
Global arguments usually reside in @ARGV; parsing @ARGV "manually"
is unnecessary and awkward in most cases.
Instead, you may consider using Ge
-Original Message-
From: Carlos Mantero [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 26, 2005 12:53 PM
To: Beginners Perl
Subject: Arguments in a program
Hi folks! I'm really new with perl, but I practice making little
programs or scripts. However, today I need a program that accepts m
Michael Gargiullo wrote:
> I have a bit of code thats throwing errors. "Use of uninitialized value..."
>
>
> #!/usr/bin/perl -w
> my $setup=0;
> while ($ARGV[0] =~ /^\-/) {
> if ($ARGV[0] eq '-s') {
>$setup = 1;
> shift;
The shift here removes $ARGV[0] from
umans
- Original Message -
From: "F.H" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, August 16, 2001 10:52 PM
Subject: RE: Re: arguments with a module
> what I mean by argument is a switch/option that I pass to the module tha
Gibbs Tanton - tgibbs [[EMAIL PROTECTED]] quoth:
*> Here is one way to get what you want:
*>
*>our @ISA = qw(Exporter);
*>our @EXPORT = ();
*>our @EXPORT_OK = qw(myfunc);
Just to point this out since the other examples had a subtle yet important
difference that Gibbs got right.
DO NOT USE @EXPOR
F.H
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: 8/16/2001 4:03 PM
Subject: Re: arguments with a module
On Thu, Aug 16, 2001 at 04:52:09PM -0400, F.H wrote:
> what I mean by argument is a switch/option that I pass to the module
that I call whithin my main perl script. Yes I have those line in
moves anything that starts with a dash.
If you have any other questions about this, let me know.
Thanks!
Tanton Gibbs
-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: 8/16/2001 3:52 PM
Subject: RE: Re: arguments with a module
what I mean by argument
--- "F.H" <[EMAIL PROTECTED]> wrote:
> what I mean by argument is a switch/option that I pass to the module that I call
>whithin my main
> perl script. Yes I have those line in my module:
> >use vars qw( @EXPORT, @ISA );
> >@EXPORT = qw( function_name );
> >@ISA = qw( Exporter );
> >require Expor
On Thu, Aug 16, 2001 at 04:52:09PM -0400, F.H wrote:
> what I mean by argument is a switch/option that I pass to the module that I call
>whithin my main perl script. Yes I have those line in my module:
> >use vars qw( @EXPORT, @ISA );
> >@EXPORT = qw( function_name );
> >@ISA = qw( Exporter );
>
I meant to send this to the whole list.
__
Your favorite stores, helpful shopping tools and great gift ideas. Experience the
convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/
Get your own FREE, personal
what I mean by argument is a switch/option that I pass to the module that I call
whithin my main perl script. Yes I have those line in my module:
>use vars qw( @EXPORT, @ISA );
>@EXPORT = qw( function_name );
>@ISA = qw( Exporter );
>require Exporter
the module is so long that is not worth postin
--- Curtis Poe <[EMAIL PROTECTED]> wrote:
>
> package CGI::Safe;
>
> $VERSION = 1.0;
> use strict;
> use Exporter;
> use vars qw/ @ISA @EXPORT_OK /;
> @ISA = qw/ CGI Exporter /;
> @EXPOR
--- "F.H" <[EMAIL PROTECTED]> wrote:
> Hi there,
> Can you use in a perl script a module with an argument. something like
> use mymodule -myargument;
Why yes, you can use a module with an argument. Why, just the other day I yelled at
one of my
coworkers "use DBI.pm, you fool!" :)
> I get this
On Thursday 16 August 2001 16:16, F.H wrote:
> Hi there,
> Can you use in a perl script a module with an argument. something like
> use mymodule -myargument;
>
> I get this message: "-myargument" is not exported bt the mymodule module.
> I tried in the module this
> @mymodule::EXPORT = qw(myargume
19 matches
Mail list logo