in reply to Re^3: Tell me how it works!
in thread Tell me how it works!

Dear monks,

Now, I have another question, how can I clear the *b when undef the *a, in the above scenario?

That is, when doing

*b = *a; undef *a;
The contents of *b is not cleared. Is it possible to clear that too with the help of glob?

Yes, ofcourse without using undef *b; And also, it is understood that undef $a; or undef @a will affect $b and @b.

Replies are listed 'Best First'.
Re^5: Tell me how it works!
by ikegami (Patriarch) on Jan 29, 2009 at 15:36 UTC

    undef @a; would do it. @a = (); is better
    undef @b; would do it. @b = (); is better

    @$glob = (); if you have a glob.