I used to do it like this:
print getData('ThisScript'); print getData('ls-l'); sub getData { my($name)= '[' . (shift) . ']'; my($data, $hit); seek(DATA,0,0); while (<DATA>) { chomp; if ($hit= ($name eq $_) ... /^\[/) { next if $hit<2; last if $hit=~ /e0/i; $data.=unpack('u',$_); } } return $data; } # to create data do # cat FILE | perl -e 'print pack ("u",join("",<>))' >> SCRIPT __DATA__ [ThisScript] M<')I;G0@9V5T1&%T82@G5&AI<U-C<FEP="<I.PIP<FEN="!G971$871A*"=L M<RUL)RD["G!R:6YT(&=E=$1A=&$H)U1H:7-38W)I<'0G*3L*<')I;G0@9V5T M1&%T82@G;',M;"<I.PH*<W5B(&=E=$1A=&$@>PH@(&UY*"1N86UE*3T@)ULG M("X@*'-H:69T*2`N("==)SL*("!M>2@D9&%T82P@)&AI="D["B`@<V5E:RA$ M051!+#`L,"D["B`@=VAI;&4@*#Q$051!/BD@>PH@("`@8VAO;7`["B`@("!I M9B`H)&AI=#T@*"1N86UE(&5Q("1?*2`N+BX@+UY<6R\I('L*("`@("`@;F5X M="!I9B`D:&ET/#(["B`@("`@(&QA<W0@:68@)&AI=#U^("]E,"]I.PH@("`@ M("`D9&%T82X]=6YP86-K*"=U)RPD7RD["B`@("!]"B`@?0H@(')E='5R;B`D M9&%T83L*?0H*(R!T;R!C<F5A=&4@9&%T82!D;PHC(&-A="!&24Q%('P@<&5R M;"`M92`G<')I;G0@<&%C:R`H(G4B+&IO:6XH(B(L/#XI*2<@/CX@4T-225!4 +"@I?7T1!5$%?7PH` [ls-l] M=&]T86P@,CDS,@HM<G<M+2TM+2TM("`@,2!U<V5R('-T869F("`@("`@("`U M-C@@4V5P("`S(#$S.C`Y(&1E860N;&5T=&5R"F1R=W@M+7@M+7@@("`V('5S M97(@<W1A9F8@("`@("`@(#4Q,B!397`@(#,@,3$Z-#$@9&]W;FQO860*+7)W M+2TM+2TM+2`@(#$@=7-E<B!S=&%F9B`@("`@-CDQ-S4P(%-E<"`@,B`P-SHU M,2!D<V-F,C<R-2YJ<&<*9')W>"TM+2TM+2`@(#,@=7-E<B!S=&%F9B`@("`@ M("`@-3$R(%-E<"`@,R`Q,SHR-2!-86EL"F1R=RTM+2TM+2T@("`R('5S97(@ M<W1A9F8@("`@("`@(#4Q,B!!=6<@,3$@,3`Z,SD@;G-M86EL"BUR=RTM+2TM M+2T@("`Q('5S97(@<W1A9F8@("`@("`@(#$W.2!397`@(#(@,3(Z,C$@;W!E M;E]Q=65S=&EO;G,*+7)W+7(M+7(M+2`@(#$@=7-E<B!S=&%F9B`@("`@("`@ M.3`P(%-E<"`@,B`P.3HS,R!P<F]F:6QE"F1R=RTM+2TM+2T@("`S('5S97(@ M<W1A9F8@("`@("`@(#4Q,B!*=6P@,C@@,3$Z,C0@<'5B;&EC7VAT;6P*9')W M>'(M>'(M>"`@(#(@=7-E<B!S=&%F9B`@("`@("`Q,#(T(%-E<"`@,B`Q,3HT M-"!354X*+7)W+2TM+2TM+2`@(#$@=7-E<B!S=&%F9B`@("`@("`Q,3`W(%-E M<"`@,R`@,C`P,R!X"BUR=RTM+2TM+2T@("`Q('5S97(@<W1A9F8@("`@(#<W 8,S0W-B!397`@(#,@,3(Z-#0@>"YS=V8* [END]

In reply to Re: CGI script bringing its own data by Skeeve
in thread CGI script bringing its own data by hacmac

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.