Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: __DATA__ in XML::Simple and/or IO::Handle

by runrig (Abbot)
on Oct 03, 2006 at 17:20 UTC ( [id://576131]=note: print w/replies, xml ) Need Help??


in reply to __DATA__ in XML::Simple and/or IO::Handle

This works fine for me:
my $xml = XMLin(\*DATA);
update: My guess at what you were experiencing is that you are opening the file that the DATA handle is pointing to, which is the program file itself, which probably starts with '#!/usr/bin/perl' or somesuch, which is not valid XML.

Replies are listed 'Best First'.
Re^2: __DATA__ in XML::Simple and/or IO::Handle
by diotalevi (Canon) on Oct 03, 2006 at 18:45 UTC

    When you do an fdopen on the existing descriptor is it starting at offset 0 or wherever perl left the pointer (which is usually the start of the data right after __DATA__)? That'd be the key. If there's something special about this fdopen that I don't know about you could continue to use it as long as you seek the handle ahead to the location of the original *DATA handle.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://576131]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (7)
As of 2024-04-18 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found