in reply to Re: Parsing XML in a __DATA__ Block
in thread Parsing XML in a __DATA__ Block

Funny, I always use \*DATA, but plain *DATA works equally well. Is there any difference between the 2?

Replies are listed 'Best First'.
Re^3: Parsing XML in a __DATA__ Block
by PodMaster (Abbot) on Jun 01, 2005 at 09:25 UTC
    \*DATA is a real reference (typeglob reference), *DATA is not (bare typeglob).

    Those definitions extracted from `perldoc perlsub' (look for \*).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re^3: Parsing XML in a __DATA__ Block
by runrig (Abbot) on Jun 01, 2005 at 17:25 UTC
    In most cases it doesn't matter, but it causes extra pain when you want to write a function that accurately needs to know "do I have a filehandle", like in File::Copy:
    my $from_a_handle = (ref($from) ? (ref($from) eq 'GLOB' || UNIVERSAL::isa($from, 'GLOB') || UNIVERSAL::isa($from, 'IO::Handle')) : (ref(\$from) eq 'GLOB'));