On Apr 12, 2015 8:06 AM, "Shawn H Corey" wrote:
>
> On Sat, 11 Apr 2015 21:20:22 -0700
> SSC_perl wrote:
>
> > Could someone please explain the difference between:
> >
> > %{$self->{'DATA'}} = () }
>
> %{ $self->{'DATA'} } = ();
>
> >
> > and
> >
> > $self->{'DATA'} = {}
> >
> > I w
On Sat, 11 Apr 2015 21:20:22 -0700
SSC_perl wrote:
> Could someone please explain the difference between:
>
> %{$self->{'DATA'}} = () }
%{ $self->{'DATA'} } = ();
>
> and
>
> $self->{'DATA'} = {}
>
> I was told that they are equivalent, but they're not. One
> works and the ot
Eeeks, Sorry Shlomi, I can't help thinking my German lessons have been
counter-productive...
A
On Sun, Apr 12, 2015 at 10:37 AM, Shlomi Fish
wrote:
> On Sun, 12 Apr 2015 09:36:00 +0100
> Andrew Solomon wrote:
>
> > Thank you very much Schlomi - I stand corrected!
> >
>
> You're welcome, Andrew
On Sun, 12 Apr 2015 09:36:00 +0100
Andrew Solomon wrote:
> Thank you very much Schlomi - I stand corrected!
>
You're welcome, Andrew! Just note that my name is spelled "Shlomi" - not
"Schlomi". See:
* http://www.shlomifish.org/meta/FAQ/#your_name
You can also call me "Rindolf":
http://www.sh
Thank you very much Schlomi - I stand corrected!
Frank, another way of putting what Schlomi has illustrated is that:
%{$self->{'DATA'}} = ( foo => 'bar' );
means "change the contents of the hash which $self->{'DATA'} refers to",
while
$self->{'DATA'} = { foo => 'bar' };
means "change $self->{'
Hi Andrew,
On Sun, 12 Apr 2015 07:25:55 +0100
Andrew Solomon wrote:
> Hi Frank
>
> I found the first one rather obscure, but they are equivalent.
No - they are not exactly the same. See below:
> To prove
> this, Data::Dumper is my friend:
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
On Sat, 11 Apr 2015 21:20:22 -0700
SSC_perl wrote:
> Could someone please explain the difference between:
>
> %{$self->{'DATA'}} = () }
>
> and
>
> $self->{'DATA'} = {}
The first line works on the physical reference $self->{'DATA'} and empties it.
The second one assigns a new empty refe
Hi Frank
I found the first one rather obscure, but they are equivalent. To prove
this, Data::Dumper is my friend:
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
{
my $self;
print "selfish self \n";
%{$self->{'DATA'}} = ( foo => 'bar' );
print Dumper $self;
}
{
my $self;
On Apr 12, 2015 12:23 AM, "SSC_perl" wrote:
>
> Could someone please explain the difference between:
>
> %{$self->{'DATA'}} = () }
>
The hashref of key "DATA" equals an empty list. The trailing bracket is the
end of the else block. $self is also probably blessed (an object).
ref($self->{
Could someone please explain the difference between:
%{$self->{'DATA'}} = () }
and
$self->{'DATA'} = {}
I was told that they are equivalent, but they're not. One works and
the other doesn't, so they must be different. Here's the context:
sub empty_db {
10 matches
Mail list logo