Re: Disadvantages of our v. my when declaring variables

2010-10-16 Thread Shlomi Fish
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

Disadvantages of our v. my when declaring variables

2010-10-15 Thread Owen Chavez
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

Re: Disadvantages of our v. my when declaring variables

2010-10-15 Thread Uri Guttman
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

Re: Disadvantages of our v. my when declaring variables

2010-10-15 Thread Brandon McCaig
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.

Problems declaring variables in external packages

2004-04-18 Thread Richard Heintze
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

Re: Problems declaring variables in external packages

2004-04-18 Thread Wiggins d'Anconia
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

Re: Problems declaring variables in external packages

2004-04-18 Thread Randy W. Sims
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

Re: declaring variables

2002-12-13 Thread John W. Krahn
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

Re: declaring variables

2002-12-13 Thread Mystik Gotan
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

declaring variables

2002-12-12 Thread Mariusz
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).

Different ways of declaring variables

2002-05-13 Thread Scott Lutz
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: