in reply to Sourcing another Scripts using perl script

system runs /bin/sh, which does not understand source. Use . (dot) instead.

To check the succes of a system command, compare its return value to zero:

if (0 == system 'ls') { print "Success\n"; } else { print "Error\n"; }

To call a Perl script from a Perl script, you can also use do.

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Sourcing another Scripts using perl script
by farha89 (Initiate) on Jan 21, 2014 at 13:09 UTC
    Hello! Thanks for your guidance , Actually this ini file will set some environment variables when i sourec it . Executing my ini file will not solve the problem, I used the dot run "./my.ini" it just executes the commands inside the ini file , . I want to use "Source my.ini", Can i do that with perl ?
      By using . instead of source, I meant
      . my.ini

      not ./my.ini.

      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
        ohh k , Now it's saying permission denied , I am not the Administrator of the PC , so is there any way to run thru that ?