Including a shell script file in Perl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • looza
    New Member
    • Jul 2008
    • 4

    Including a shell script file in Perl

    Hi All,

    I have a bunch of shell script files that use a common shell script file that contains certain global variables that are declared and initialized or derived by some arithmatic.

    I have to now convert one of the shell script file to a perl file so I can use the in-built functions.

    Is the a way I can import the file with the globals and use them in my perl script?

    Thanks!
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Shell script is not Perl code. Granted, you can use the system() function to call a shell script or execute system commands / scripts, but to actually use the code in your script in the manner you describe, you would have to re-write it in Perl instead.

    If you want, you can try to do this, and if you get stuck, post your code here. I would also, at that time, suggest you post the original shell script you are trying to convert as well so we can see what your reference point is.

    Regards,

    Jeff

    Comment

    Working...