Sphinxter
Says What?
netbsd said:Well, you are already familiar with pointers in Perl, although they are called references there (perldoc perlref). A straightforward (naive) translation from a hash reference in Perlrealyst said:Thanks again for all the feedback
I'm actually now looking at how pointers work and am loving the possibilities! (does that make me a sick man?)
my %h = (a=>1, b=>2);
my $p = \%h;
printf "%d\n", $p->{a};
to a struct pointer in C would be:
struct {int a; int b;} h = {1, 2}, *p = &h;
printf("%d\n", p->a);
The dereference operator (->) is even the same.
Unless of course you mean with possibilities (potentially unsafe) type casts and dangling pointers :lol:
So nice to see another Perl fan.
Last edited by a moderator: