in reply to Predeclaration

Background: If you call the value of a segment of memory,
I'm thinking C/C++ here, then the value returned is the
value that already exitst in that memory space. For example:
if 12345 existed at a specific segment of memory that was
then assigned to $var, the value of $var would be 12345.
Unless you predeclare that $var is to be a specific value
That is a well known security problem, I believe that is
how stack exploites work.

Abigail says that the variable is assigned an empty list
either way you choose to assign it (my $var or my $var = ()).

If that is true then there should be no security differences
between either way. Sound correct?

Replies are listed 'Best First'.
Re: Predeclaration
by Abigail-II (Bishop) on Jul 16, 2002 at 13:59 UTC
    Perl isn't C, nor C++. In pure Perl there is absolutely no way of directly accessing the content of the (virtual) memory. There are no pointers in Perl - just references. You cannot take an integer, and treat it like a pointer or a reference. You cannot add something to a reference and get a new reference.

    Abigail

      In pure Perl there is absolutely no way of directly accessing the content of the (virtual) memory... You cannot take an integer, and treat it like a pointer or a reference.

      It is impossible with pure Perl and no XS modules. But Devel::Pointer can turn Perl code into C pointers nightmare :)

      --
      Ilya Martynov (http://martynov.org/)