Re: initialising a list of variables

2003-10-30 Thread Brian Gerard
And the clouds parted, and Rob Dixon said... > > Gary Stainburn wrote: > > > > Hi Gary. > > Just one more offering: > >$_ = '' foreach my ($fred, $ginger); > > HTH, > > Rob ...and in the spirit of TMTOWTDI... map {$_=""} my ($fred, $ginger); :) /~

Re: initialising a list of variables

2003-10-29 Thread Rob Dixon
Gary Stainburn wrote: > > I've got a query about variable initialisation. I want to initialise a list of > variables to an empty string, but I'm having troubles. > > What's the best wat to do this? > > If I use the following I get: > > [EMAIL PROTECTED] gary]$ cat t > #!/usr/bin/perl -w > > use st

Re: initialising a list of variables

2003-10-06 Thread Jenda Krynicky
From: Gary Stainburn <[EMAIL PROTECTED]> > I've got a query about variable initialisation. I want to initialise a > list of variables to an empty string, but I'm having troubles. > > What's the best wat to do this? > > If I use the following I get: > > [EMAIL PROTECTED] gary]$ cat t > #!/usr/bi

RE: initialising a list of variables

2003-10-03 Thread Hanson, Rob
in @_, and @_ contains aliases to the variables that were passed. So modifying $_ modified $x and $y directly without having to return a value. Rob -Original Message- From: Gary Stainburn [mailto:[EMAIL PROTECTED] Sent: Friday, October 03, 2003 11:27 AM To: James Edward Gray II Cc: [EMAIL PROTE

Re: initialising a list of variables

2003-10-03 Thread Gary Stainburn
On Friday 03 Oct 2003 4:05 pm, James Edward Gray II wrote: > On Friday, October 3, 2003, at 09:55 AM, Gary Stainburn wrote: > > Hi folks > > Howdy. > > > I've got a query about variable initialisation. I want to initialise a > > list of > > variables to an empty string, but I'm having troubles. >

RE: initialising a list of variables

2003-10-03 Thread Ed Christian
> my $fred=$ginger=''; Should be: my $fred = my $ginger = ''; > my ($fred,$ginger)=''; Should be: my ($fred,$ginger) = ('',''); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: initialising a list of variables

2003-10-03 Thread James Edward Gray II
On Friday, October 3, 2003, at 09:55 AM, Gary Stainburn wrote: Hi folks Howdy. I've got a query about variable initialisation. I want to initialise a list of variables to an empty string, but I'm having troubles. What's the best wat to do this? How about: my($fred, $ginger) = ('') x 2; James

RE: initialising a list of variables

2003-10-03 Thread Bakken, Luke
> but if I use: > > [EMAIL PROTECTED] gary]$ cat t > #!/usr/bin/perl -w > > use strict; > > my ($fred,$ginger)=''; > > print "fred=$fred\n"; > print "ginger=$ginger\n"; > [EMAIL PROTECTED] gary]$ ./t > fred= > Use of uninitialized value in concatenation (.) or string at > ./t line 8. > ginger=

initialising a list of variables

2003-10-03 Thread Gary Stainburn
Hi folks I've got a query about variable initialisation. I want to initialise a list of variables to an empty string, but I'm having troubles. What's the best wat to do this? If I use the following I get: [EMAIL PROTECTED] gary]$ cat t #!/usr/bin/perl -w use strict; my $fred=$ginger=''; pr