Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi MidLifeXis, Thanks.Correct Exactely.

1)Share the script to the remote machine and execute it from that shared location.

--> I can't do that. may be the script given as a patch,that can't put into server that is dynamic

2)Copy the script.pl to the remote machine and run it from there. There are potential race conditions between the copy / execute and the execute /

--> Same above said reason, i cant do that

3)Embed the command line arguments into the top of your script.pl, perhaps as you are sending it across the wire to perl. This would require some pre-processing of the script and some assumptions of where you can embed the code - if I were to do it this way, I would probably have a token of some sort in the script that I would replace with my parameters

--> The cmd line argumetns are also dynamic in nature..but i dont understand this entire statment correctely. can you give an example ?

4)Run the command remotely using the -e or -E flag to perl, and embedding the script on the remote command invocation. This would be my last choice for something that is any more complex than dead simple unless I could ensure that quotes were properly escaped, newlines handled, length of the command line accounted for, and so on. --> I think this will work out may be..i will give it a try and also i am trying with sed cmd as well


In reply to Re^2: run perl script with cmd line in shell by Anonymous Monk
in thread run perl script with cmd line in shell by Anonymous Monk

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-24 19:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found