Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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

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, 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
  • 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.
  • Log In?

    What's my password?
    Create A New User
    [hippo]: See also Getting Started with Perl for some gentle introductory tutorials.
    [thao4]: I don't see where I can post my question. I am french so not good in English
    [erix]: go to the bottom of this page: Seekers of Perl Wisdom

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (9)
    As of 2018-02-21 09:59 GMT
    Find Nodes?
      Voting Booth?
      When it is dark outside I am happiest to see ...

      Results (276 votes). Check out past polls.