need to print @INC in a remote machine

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shankarsk
    New Member
    • Oct 2006
    • 2

    need to print @INC in a remote machine

    perl
    print @INC;

    works in the local system , but i need to get the output in a remote system
    i wrote below code to get the same
    ---------------------
    perl
    $x = `ssh -l $userid $sysname 'perl;print @INC'`;
    print $x;

    ---------------------
    the above code is never ending , please help me in this regard

    thanks
  • miller
    Recognized Expert Top Contributor
    • Oct 2006
    • 1086

    #2
    The below code works for me from the command prompt. The only caveat is the fact that I do have to enter in the password of the user I'm SSH'ing into:

    ssh -l <userID> <sysname> "perl -e 'print join(\",\", @INC)'"

    Alternatively you can look into the Net::SSH and Net::SSH::Perl modules on CPAN for more clean solutions:

    http://search.cpan.org/search?query=Ne t::SSH
    http://search.cpan.org/search?query=Ne t::SSH::Perl

    Comment

    • shankarsk
      New Member
      • Oct 2006
      • 2

      #3
      thanks for the info

      Comment

      Working...