From perlvar, $$ is the process ID of the perl running your script.

With regards to \@ and \$: I'm assuming that you're talking about something like:

my $array_ref = \@array; my $hash_ref = \%hash;
Is that the case?

What's happening there is that you're taking a reference to an array and a hash. References are described in perlref. They're kind of like C pointers, but also kind of not. :)

References are scalars that "point" to other variables--the other variables can be arrays, hashes, scalars, etc. To use the variable pointed to by a reference, you have to dereference the reference. This could also be what you were referring to by $$, because if we had a reference to a scalar, like this:

my $string = "foo bar"; my $ref = \$string;
then we could get access to the value "foo bar" by dereferencing $ref, like this:
my $original = $$ref;
$original now contains "foo bar".

So take a look at perlref and also at perlreftut, which might actually be a better place to start than perlref, depending on your experience.


In reply to Re: A few questions by btrott
in thread A few questions by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.