Monks,

I am trying to get a variable I have in PHP code to pass through to a perl script. I can execute the perl script from PHP using passthru() or system(), among others, however, I am unclear on how to get the variable from the PHP to be passed and interpreted in the executed Perl script.

I tried

passthru('/home/test.cgi';$var)

but although test.cgi runs, it does not interpret $var. I am not even sure if the placement of $var in the code above is appropriate. I have read the function instructions at php.net, but they did not appear to specify such an option. I only picked it up from searches on google and looking at other pieces of simplistic code.

Most Humbly,

Chris


In reply to Passing variables from PHP to Perl using passthru() by cdherold

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.