John W. Krahn wrote:
[snip]
>>
>> example of my Subroutine declarations:
>>
>> # Get the Data Number
>> &get_number;
>>
>> # Get Form Information
>> &parse_form;
>>
[snip]
>
> You are running the subroutines. These are all equivalent (note that
> the third example only works if the sub ha
R. Joseph Newton wrote:
> James Edward Gray II wrote:
>
> > Almost. You have to declare them before you use them if you want
> > to leave of the parenthesis. :)
> >
> > James
>
> Actually, it is vice-versa.
Actually, James is correct. Quoting from perldoc perlsyn:
Declaring a subroutine
Paul Kraus wrote:
> >
> >
> > As a side note Where is the best place to put the subroutines?
> > After the exit command or in the beginning of the script? Any
> > preferences?
> I prefer sticking them in the bottom in the order they are called.
>
> This way when I open a script at a glance I
James Edward Gray II wrote:
> Almost. You have to declare them before you use them if you want to
> leave of the parenthesis. :)
>
> James
Actually, it is vice-versa. If you use prototypes, then the prototype must
be declared before any call to the function. In that case, you will have a
para
George Schlossnagle wrote:
> On Tuesday, September 9, 2003, at 10:59 AM, Rodney Wise wrote:
> >
> > It looks like by declaring my subroutines, they are being executed. ???
> >
> > example of my Subroutine declarations:
> >
> >
> >
> > # Get the Data Number
> > &get_number;
> >
> > # Get Form Info
Rodney Wise wrote:
> George,
>
> # Get the Data Number
> &get_number;
Avoid using the &function_name until you are a Perl expert, and know exactly
why you are using it. That is a call to the subroutine, but not the one to be
used under normal circumstances.
> # Get Form Information
> &parse_for
Rodney Wise wrote:
> I was under the impression that "subroutines" are only executed IF they're
> called. But, it looks like subroutines will execute on there own if they
> are written in the beginning part of the PERL code and before other code
> takes over the codes sequence of events. In oth
On Tue, 9 Sep 2003 12:28:42 -0400, "Rodney Wise" <[EMAIL PROTECTED]> wrote:
> Thanks everyone for your help.
>
> I'm working on a PERL script for the "WWWboard" originally written by Matt
> Wright. PERL isn't my primary language (as I'm sure you
ey Wise [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 09, 2003 9:29 AM
To: [EMAIL PROTECTED]
Subject: Re: PERL code execution rule?
Thanks everyone for your help.
I'm working on a PERL script for the "WWWboard" originally written by Matt
Wright. PERL isn't my primary la
: [EMAIL PROTECTED]
Subject: Re: PERL code execution rule?
Thanks everyone for your help.
I'm working on a PERL script for the "WWWboard" originally written by
Matt Wright. PERL isn't my primary language (as I'm sure you all can
see) ... although I'm finding it very po
Thanks everyone for your help.
I'm working on a PERL script for the "WWWboard" originally written by Matt
Wright. PERL isn't my primary language (as I'm sure you all can see) ...
although I'm finding it very powerful and useful.
Apparently, Matt used a lot of global variables in his subroutines.
Paul Kraus wrote:
>
> That's interesting. I have also read that you need to have the subs at
> the top of the script if you call it with sub()
>
> However I just realized that I always have my subs at the bottom and
> always call them with sub() without the ampersand.
>
> Am I getting lucky? Sho
On Tuesday, September 9, 2003, at 12:57 PM, Paul Kraus wrote:
That's interesting. I have also read that you need to have the subs at
the top of the script if you call it with sub()
Almost. You have to declare them before you use them if you want to
leave of the parenthesis. :)
James
--
To un
Paul
-Original Message-
From: John W. Krahn [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 09, 2003 1:53 PM
To: [EMAIL PROTECTED]
Subject: Re: PERL code execution rule?
Rodney Wise wrote:
>
> I was reviewing my code some more and here is what I think might be
> happening.
&
Rodney Wise wrote:
>
> I was reviewing my code some more and here is what I think might be
> happening.
>
> In my code, the first thing I do is declare my variables.
>
> Then I declare my subroutines'.
>
> It looks like by declaring my subroutines, they are being executed. ???
>
> example of m
> George,
>
> Thanks for the quick response.
>
> I was reviewing my code some more and here is what I think
> might be happening.
>
> In my code, the first thing I do is declare my variables.
>
> Then I declare my subroutines'.
>
> It looks like by declaring my subroutines, they are being
>
On Tuesday, September 9, 2003, at 10:59 AM, Rodney Wise wrote:
It looks like by declaring my subroutines, they are being executed. ???
example of my Subroutine declarations:
# Get the Data Number
&get_number;
# Get Form Information
&parse_form;
Just to be sure we're on the same playing field -
eason to "declare" them.
HTH
Paul
-Original Message-
From: Rodney Wise [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 09, 2003 10:59 AM
To: [EMAIL PROTECTED]
Subject: Re: PERL code execution rule?
George,
Thanks for the quick response.
I was reviewing my code some more
George,
Thanks for the quick response.
I was reviewing my code some more and here is what I think might be
happening.
In my code, the first thing I do is declare my variables.
Then I declare my subroutines'.
It looks like by declaring my subroutines, they are being executed. ???
example of my
On Tuesday, September 9, 2003, at 09:50 AM, Rodney Wise wrote:
I was under the impression that "subroutines" are only executed IF
they're
called. But, it looks like subroutines will execute on there own if
they
are written in the beginning part of the PERL code and before other
code
takes ove
20 matches
Mail list logo