in reply to Re^3: Comparing an array against another array
in thread Comparing an array against another array

diff seems to be just what I need, thanks a lot. Is my only option perl5i to use the diff method? Or does anyone know why I'm getting this error? Can't call method "diff" without a package or object reference at backtick.pl line 8.

my $hostname = $ARGV[0]; my @hostFiles = ("filecheck.pl", "hostscript.pl"); my @output =`ssh $hostname "cd Desktop; ls -a"`; my @diff = @hostFiles->diff(\@output); . . .

Replies are listed 'Best First'.
Re^5: Comparing an array against another array
by CountZero (Bishop) on Jan 18, 2012 at 07:16 UTC
    use perl5i::latest; should do the trick.

    However, check your install log to see this module installed correctly. I finally had to force install it, due to an error in respect of the child method.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James