On Jan 24, 2008 7:49 AM, Rob Dixon <[EMAIL PROTECTED]> wrote:
snip
> >> Of course. Thanks Chas. I think the docs could do with a tweak here.
> >
> > They seem fine to me:
> >
> > from perldoc strict
> >"strict refs"
> > This generates a runtime error if you use symbolic referen
Chas. Owens wrote:
>
On Jan 23, 2008 10:29 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
>>
Chas. Owens wrote:
On Jan 23, 2008 10:07 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
Along these lines, can someone explain to me why
use strict 'vars';
my $name = 'data';
print foreach @$name;
p
Chas. Owens wrote:
Gunnar Hjalmarsson wrote:
Chas. Owens wrote:
On Jan 23, 2008 10:07 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
Along these lines, can someone explain to me why
use strict 'vars';
my $name = 'data';
print foreach @$name;
produces no error, when
use strict 'vars';
On Jan 23, 2008 10:34 PM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
snip
> >>use strict 'vars';
> >>my $name = 'data';
> >>print foreach @$name;
snip
> Don't think so, Chas. It's
>
> use strict 'refs';
>
> that captures symbolic references, not 'vars'.
snip
He was referring t
On Jan 23, 2008 10:29 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
> Chas. Owens wrote:
> >
> > On Jan 23, 2008 10:07 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
> >>
> >> Along these lines, can someone explain to me why
> >>
> >>use strict 'vars';
> >>my $name = 'data';
> >>print foreach @
Chas. Owens wrote:
On Jan 23, 2008 10:07 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
Along these lines, can someone explain to me why
use strict 'vars';
my $name = 'data';
print foreach @$name;
produces no error, when
use strict 'vars';
print foreach @data;
does?
snip
Because
Chas. Owens wrote:
>
On Jan 23, 2008 10:07 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
>>
Along these lines, can someone explain to me why
use strict 'vars';
my $name = 'data';
print foreach @$name;
produces no error, when
use strict 'vars';
print foreach @data;
does?
Becaus
Rob Dixon wrote:
Along these lines, can someone explain to me why
use strict 'vars';
my $name = 'data';
print foreach @$name;
produces no error, when
use strict 'vars';
print foreach @data;
does?
Because in the first case, the variable you use had been declared, and
you hadn't
On Jan 23, 2008 10:07 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
> Along these lines, can someone explain to me why
>
>use strict 'vars';
>my $name = 'data';
>print foreach @$name;
>
> produces no error, when
>
>use strict 'vars';
>print foreach @data;
>
> does?
snip
Because us
Along these lines, can someone explain to me why
use strict 'vars';
my $name = 'data';
print foreach @$name;
produces no error, when
use strict 'vars';
print foreach @data;
does?
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED
On Jan 23, 2008 7:07 PM, Juan Luis Belmonte <[EMAIL PROTECTED]> wrote:
snip
> If you 'call' @{$y} you are using the array with the content of $y as
> name of the array.
snip
Yeah, that is a bad practice called symbolic references left over from
before we had real references. Modern Perl code use
Chas. Owens wrote:
>
On Jan 22, 2008 8:45 PM, bootleg86 bootleg86 <[EMAIL PROTECTED]>
wrote:
I came across this construct
foreach $i ( @{$y} ) {
#do something
}
Is @ referring to some default array that doesn't need to be declared?
Also it's using the associative version of an array?
I al
On Jan 22, 2008 9:33 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
snip
> > If the code works (and it isn't guarenteed to)
>
> I'm not sure what you mean here. It's as guaranteed to work as any other
> Perl code snippet I've seen.
snip
I mean that the following is an error.
my $foo = 5;
my @array = @{
Chas. Owens wrote:
>
On Jan 22, 2008 8:45 PM, bootleg86 bootleg86 <[EMAIL PROTECTED]> wrote:
I came across this construct
foreach $i ( @{$y} ) {
#do something
}
Is @ referring to some default array that doesn't need to be declared?
Also it's using the associative version of an array?
I alwa
On Jan 22, 2008 8:45 PM, bootleg86 bootleg86 <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I came across this construct
> foreach $i ( @{$y} ) {
> #do something
> }
>
> Is @ referring to some default array that doesn't need to be declared?
>
> Also it's using the associative version of an array?
> I alway
bootleg86 bootleg86 wrote:
Hi,
Hello,
I came across this construct
foreach $i ( @{$y} ) {
#do something
}
Is @ referring to some default array that doesn't need to be declared?
Also it's using the associative version of an array?
I always thought only hashes were associative.
$y is a re
16 matches
Mail list logo