Hi Brandon,
Just a note about your code:
On Saturday 16 October 2010 06:53:29 Brandon McCaig wrote:
sub print_sum
{
my ($a, $b) = @_;
print($a + $b, \n);
}
You should not call lexical variables $a and $b because this interferes
with the $a and $b
Hello,
I've started experimenting with the use of subroutines in place of large,
repeating blocks of code in a few of my programs. Without exception, these
subroutines require variables defined outside of the subroutine. Unless I'm
mistaken, the only way to make these variables available within
OC == Owen Chavez owen.chavez314...@gmail.com writes:
OC I've started experimenting with the use of subroutines in place of
OC large, repeating blocks of code in a few of my programs. Without
OC exception, these subroutines require variables defined outside of
OC the subroutine. Unless
On Fri, Oct 15, 2010 at 11:40 PM, Owen Chavez
owen.chavez314...@gmail.com wrote:
I've started experimenting with the use of subroutines in place of large,
repeating blocks of code in a few of my programs. Without exception, these
subroutines require variables defined outside of the subroutine.
I'm using these statements in my main program:
use DisplayPCE qw($order $fnx );
...
print join(, map { qq[td$_/td] }
@{$DisplayPCE::order});
...
When I use the debugger, I find that order is
undefined! When I use the browser to view the page,
the value of undef is confirmed.
When I abandon
Richard Heintze wrote:
I'm using these statements in my main program:
use DisplayPCE qw($order $fnx );
...
print join(, map { qq[td$_/td] }
@{$DisplayPCE::order});
...
When I use the debugger, I find that order is
undefined! When I use the browser to view the page,
the value of undef is
Wiggins d'Anconia wrote:
Richard Heintze wrote:
I'm using these statements in my main program:
use DisplayPCE qw($order $fnx );
...
print join(, map { qq[td$_/td] }
@{$DisplayPCE::order});
...
When I use the debugger, I find that order is
undefined! When I use the browser to view the page,
the
Mariusz wrote:
In one of my scripts I have lots of variables to declare. I wanted to type them in
groups instead of one long line but I think dividing my lines trough the use of the
ENTER key stops the script from working. (Although when I check the syntax through
perl - c script.cgi it
with
this construct, I'm sure it'll work.
--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]
From: Mariusz [EMAIL PROTECTED]
To: perl [EMAIL PROTECTED]
Subject: declaring variables
Date: Thu, 12 Dec 2002 20:47:15 -0600
In one of my scripts I have lots
In one of my scripts I have lots of variables to declare. I wanted to type them in
groups instead of one long line but I think dividing my lines trough the use of the
ENTER key stops the script from working. (Although when I check the syntax through
perl - c script.cgi it gives me OK).
I am wondering about the different ways of initializing a single scalar.
usual method:
my $variable;
but I am trying to get what (if anything) is being done differently by
this :
my ($variable);
Thanks!
Scott Lutz
Pacific Online Support
Phone: 604.638.6010
Fax: 604.638.6020
Toll Free:
11 matches
Mail list logo