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" http://perldoc.pe

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 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.  Unless I'm > mistaken,

Re: Disadvantages of "our" v. "my" when declaring variables

2010-10-15 Thread Uri Guttman
> "OC" == Owen Chavez 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 I'm mistaken, th

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: 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

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" i

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). Basica

RE: Different ways of declaring variables

2002-05-13 Thread Hanson, Robert
c: Beginners (E-mail) Subject: Re: Different ways of declaring variables On Mon, 2002-05-13 at 18:07, Scott Lutz wrote: > 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 b

Re: Different ways of declaring variables

2002-05-13 Thread Chas Owens
On Mon, 2002-05-13 at 18:07, Scott Lutz wrote: > 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 > Paci

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: 1.877.5