Re: my( $string )

2003-03-07 Thread Bob X
"David Gilden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Quick question: > my( $string ) = "you ordered " . $q->param('quantity') . " foobars\n"; > > > What with the '( )' do I need them every time I declare a variable? > You can declare them like this: my $foo; my $bar; Or

RE: my( $string )

2003-03-06 Thread Hanson, Rob
> do I need them every time I declare a variable? Nope. The parens force "list context". Without them is "scalar" context. For example... my @foo = qw(1 2 3 4 5); my $x = @foo; # =5, the number of elements my ($y) = @foo; # =1, the first element Certain functions and operations will do diffe