On Tuesday, April 9, 2002, at 11:13 , Jenda Krynicky wrote:
[..]
> So if a module defines several classes it has to contain several
> packages.
>
> Jenda
yes I think I would modify that slightly
it is simpler to deliver one long file as a singular 'package'
that carries with
On Apr 9, Gary Hawkins said:
>> From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]]
>>
>> Perhaps you're missing the point.
>
>Gee, maybe that was the reason for the question. Ya think? Why do you
>hammer people for asking questions, that's what this place is for.
I wasn't. I was saying that
> -Original Message-
> From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 09, 2002 11:58 AM
> To: Gary Hawkins
> Cc: [EMAIL PROTECTED]
> Subject: RE: Scope of variables. Lost in subs
>
> Perhaps you're missing the point.
On Apr 9, Gary Hawkins said:
>I was thinking there might be an instance where 'package bar' is
>essential, or the best way to go.
Perhaps you're missing the point. The package directive allows you to
change namespaces. Your Perl program operates in package 'main'. Most
modules operate in thei
From: "Gary Hawkins" <[EMAIL PROTECTED]>
> > > How many "things" can packages be? Is this foo a file?
> >
> > No this "foo" doesn't have to be a file. You can "have" several
> > packages in one file and "switch" between them.
> >
> > I don't know how to explain what ARE packages though.
> > Try
> > How many "things" can packages be? Is this foo a file?
>
> No this "foo" doesn't have to be a file. You can "have" several
> packages in one file and "switch" between them.
>
> I don't know how to explain what ARE packages though.
> Try if
> perldoc perlmod
> makes sense to you.
After
From: "Gary Hawkins" <[EMAIL PROTECTED]>
> > #!perl -w
> > my $x = 'Ahoj';
> > print "$x\n";
> > package foo;
> > print "$x\n";
> > __END__
> >
> > I believe packages are completely irrelevant to lexical (declared
> > with my()) variables.
> >
>
> I was following it up un
> > > If you declare a variable with my() its scope will be from the
> > > declaration to the end of the enclosing block. Which for variables
> > > declared outside any {} block or eval"" means ... to the end of the
> > > file.
> > >
> >
> > Wrong.
> >
> > You forgot about 'package'.
>
> What do y
Thanks to everyone who replied.
I got enough information to solve the problem, and then some more :)
Tor
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
From: "Jonathan E. Paton" <[EMAIL PROTECTED]>
> Jonathan... nul point - my Eurovision song contest
> attempt would be less than that though. Yes, Jenda is
> right, and I'm wrong (again). Oh well, I do remember
> reading that.
A it feels so god to be right ;-)
And well ... I used to sin
--- Jenda Krynicky <[EMAIL PROTECTED]> wrote: > From: "Jonathan E. Paton"
<[EMAIL PROTECTED]>
> > > > It loses
> > > > scope in subroutines.
> > >
> > > Wrong.
> > >
> > > If you declare a variable with my() its scope will be from the
> > > declaration to the end of the enclosing block. Whic
Yep. I guess I'm still a little groggy. I think this whole "Spring
Forward" thing is a bit of a misnomer.
-Original Message-
From: drieux [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 08, 2002 8:07 AM
To: [EMAIL PROTECTED]
Subject: Re: Scope of variables. Lost in su
Oops. My bad. I wonder how much extra work that one's cost me...
-Original Message-
From: Jenda Krynicky [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 08, 2002 8:49 AM
To: Timothy Johnson
Cc: [EMAIL PROTECTED]
Subject: RE: Scope of variables. Lost in subs
From: "Timot
From: "Jonathan E. Paton" <[EMAIL PROTECTED]>
> > > It loses
> > > scope in subroutines.
> >
> > Wrong.
> >
> > If you declare a variable with my() its scope will be from the
> > declaration to the end of the enclosing block. Which for variables
> > declared outside any {} block or eval"" mea
> > It loses
> > scope in subroutines.
>
> Wrong.
>
> If you declare a variable with my() its scope will be from the
> declaration to the end of the enclosing block. Which for variables
> declared outside any {} block or eval"" means ... to the end of the
> file.
>
Wrong.
You forgot abo
From: "Timothy Johnson" <[EMAIL PROTECTED]>
> Another thing to remember is that declaring a variable with my() at
> the top of your script does NOT make the variable global.
Right.
> It loses
> scope in subroutines.
Wrong.
If you declare a variable with my() its scope will be from the
decl
On Monday, April 8, 2002, at 07:28 , Timothy Johnson wrote:
[..]
> If you just pass the value,
> then any operations performed on your variable in the subroutine will be
> destroyed when the sub exits. This way you will be performing all
> operations on the original variable, allowing you to cha
6:07 AM
Subject: Re: Scope of variables. Lost in subs
On Mon, 08 Apr 2002 11:00:54 +0200, [EMAIL PROTECTED] (Tor Hildrum)
wrote:
>On 8/4/02 9:15, "Tor Hildrum" <[EMAIL PROTECTED]> wrote:
>
>> Here are some of the error messages I get:
>> Use of uninitialized value
On Mon, 08 Apr 2002 11:00:54 +0200, [EMAIL PROTECTED] (Tor Hildrum) wrote:
>On 8/4/02 9:15, "Tor Hildrum" <[EMAIL PROTECTED]> wrote:
>
>> Here are some of the error messages I get:
>> Use of uninitialized value in concatenation (.) at script.cgi line 55.
>> Use of uninitialized value in concatena
On 8/4/02 9:15, "Tor Hildrum" <[EMAIL PROTECTED]> wrote:
> Here are some of the error messages I get:
> Use of uninitialized value in concatenation (.) at script.cgi line 55.
> Use of uninitialized value in concatenation (.) at script.cgi line 55.
> Can't open : No such file or directory
Full so
I have the following script:
..my $variable = ""; # Global variable, right?
if (true/false) { sub3(); }
elsif (true/false) { sub2(); }
else { sub1(); }
## The point with this, is that sub1 is always called first, then sub2, then
## sub3. This works perfectly.
sub sub1{
}
sub sub2{
$vari
21 matches
Mail list logo