They are kind of like a C "cast", but only superficially,
as they really don't allow you to convert between types.
I would tend to call them "dereferences", which is more
like C's pointer '*', only in this case you are specifying
the type of thing that you are dereferencing explicitly.
I would imagine that people who have not been exposed to
C are more likely to be unfamiliar with pointers.
Don't forget that there is also
${ } for
scalar references, though this is less frequently used.
The "spoken" version of Perl would be something like:
my $x = \$z;
# "$x is a reference to scalar $z"
my $y = $$x;
# "$y is a copy of the scalar referenced by $x"
my $w = $row{b};
# "$w is assigned the value of %row's 'b' entry"
my @v = @{$row{b}};
# "@v is a copy of the array referenced by %row's b entry"
Note that when you assign something, you might have to
further dereference it to make any use out of it. That is,
$y might actually be another reference.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.