Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Let's see if I have this right:
  1. you have an AppleScript application, which does some stuff and sets some "AppleScript variables"
  2. then the AppleScript thing invokes a perl command-line ("one-liner") script, which must:
    1. accept some stuff from stdin (some other process invoked by AppleScript is feeding the perl one-liner)
    2. accept some additional command line args? (or maybe not, or maybe this doesn't matter)
    3. accept some additional data which cannot be mixed with the stdin stream, and is not safe to provide as command-line args (for @ARGV), and this data content involves (some of) those "AppleScript variables".

If AppleScript provides a way to open a file for output, write variables to that file, and close it, then the perl script could simply open a given file, and read from that instead of from __DATA__ -- or I suppose you could go to the trouble of writing the whole perl script to a file, including the runtime-determined __DATA__ content, then execute it.

Or maybe you could turn things around: have a perl script that invokes AppleScript (via the "osascript" shell command), and reads the data it needs from that? (Just guessing)


In reply to Re: 'perl -e' and '__DATA__' What's wrong? by graff
in thread 'perl -e' and '__DATA__' What's wrong? by Skeeve

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (10)
    As of 2014-09-22 09:08 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (185 votes), past polls