The code I used - my $dir = "/home/code"; $f->cwd($dir) or die "Can't cwd to $dir\n"; $, = "\n"; my $fileto_get = "sample.sh"; $f->get($fileto_get) or die "Can't get $fileto_get from $dir\n";