in reply to Processing data from SSH stream

Just an idea, to maybe come closer to the problem, try to
use Data::Dumper;
somewhere early in your script and add some debugging aids into the problematic sub, like
sub get_remote_file { print "Retrieving data file..."; my @site_data; print Dumper( $conx ); chomp( @site_data = `$conx` ); print Dumper( @site_data ); if ( $? >> 8 ) { print "Failed!\n"; } else{ print "Success!\n"; } for $line( @site_data ) { ( $name, $filepath, $mod, $md5 ) = split( "\,", $line ); $site_data{$name} = ["$filepath", "$mod", "$md5"]; } @site_data = (); }
Maybe that reveals something that would explain the different behavior of the first run compared with the subsequent ones.

Replies are listed 'Best First'.
Re^2: Processing data from SSH stream
by Spasticus (Initiate) on May 11, 2007 at 01:00 UTC
    Thanks for all your help people :)
    I eventually found the problem - totally unrelated to SSH file properties. It turns out that in processing the retrieved data from the stream that in some instances I had to undef $/. Unfortunately I forgot to redefine it afterwards. This explains why it was working for the first file processed and failing for each one after.
    Again, thanks for your help :)
      Btw, it's a good habit to use local to restrict the scope of modifications to special variables such as $\.

      An example from the perlvar doco:

      my $content = ''; open my $fh, "foo" or die $!; { local $/; $content = <$fh>; } close $fh;