in reply to Re^5: Why did @$ variable bite me in the ass?
in thread Why did @$ variable bite me in the ass?

use strict; use warnings; $5[$_] = 1 for 0..5; print "@5\n";

Replies are listed 'Best First'.
Re^7: Why did @$ variable bite me in the ass?
by LanX (Saint) on Mar 02, 2015 at 11:07 UTC
    Ehm ... does this demonstrate any diff between @1 and @5 ?

    The results are the same for me.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)

    PS: Je suis Charlie!

      Exactly! But there is no *main::5 on QM's list, as you already pointed out.

        I noticed this list in the past, when playing around with the debugger.

        But actually it's meaningless, cause all match vars are undeclared

        perl -e 'print ">",exists $main::{1},"<\n"' ><

        So most of these stash entries are just artifacts of the debugger's initialization and $5 was just never reached.

        Cheers Rolf
        (addicted to the Perl Programming Language and ☆☆☆☆ :)

        PS: Je suis Charlie!