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