in reply to multiple __DATA__ && __END__

Hello michaelg, did you forget to log in before you posted? If so, maybe now is the time to change your default theme to something that looks different, like i do (i use the Dark Theme). Also, you (and anyone else who reads this who is "guilty" of such) should stop using so many <br> tags. I used to be the same way until someone made me realize that this is a complete waste of your time. Remember, folks use different screen resolutions and application sizes ... when you use <br> tags to make line breaks, you are assuming that the folks who read your post are using the same resolution and application size as you. We don't! So please, stop using <br> tags to make line breaks: let the browser make the desicion,

unless you prefer
to write your posts like haikus
please use the <p> tag
;)

Now then, as for the question ... do as gjb says and look into Inline::Files. It's very easy to grasp, but i wonder if you are missing a better, more maintable solution? Why do you need two DATA sections in one file? I like to use Inline::Files for quick and dirty tests or examples that i post here at the Monastery, but i never use it in production. Sometimes doing it the "old way" is better - in this case, just store them as text files and open them up.

UPDATE:
I guess i'll have to explicitly add that when i say use <p> tags instead of <br/> tags ... i don't mean replace all of the <br/> tags in you post with <p> tags! I mean write a full paragraph and enclose that paragraph in a <p></p> tag pair.

And for the record, i write one sentance paragraphs when they are appropriate. ;)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: Re: multiple __DATA__ && __END__
by michaelg (Beadle) on Nov 20, 2003 at 15:59 UTC

    hi jeffa

    Thanks for your answer, well I have 2 problems I work for a company with only so little respect to perl that meens that most of CPAN modules arn't installed here include inline. The second problem is that the app I'm writing should be deliver to customers as one binary file with no installation tree what so ever , just download it and use it. so I don't have any file that I can open, so I keep all my text in a .pm __DATA__ segment .

    well now I need to write help for the app and I 8 the thought that I have to create about 10 packages for that.

    So do you have something else in mind? :)

    Michael
    no theam yet ,SIR !!

      Ah. Without using modules you are restricted to a single __DATA__ per source file. You could store a Storable serialized object there though and that would give you arbitrary complexity. Storable is in the core perl distribution so your customers should have it.

      Or... if you need to package up a binary you should check out PAR to create the executable. Just keep in mind that you can't prevent (ever) your customers from being able to read your code.