akrrs7 has asked for the wisdom of the Perl Monks concerning the following question:
However, it does log in fine but does not execute the rest of the perl script. Also how can I use perl to get the permissions on a file and print the same to a text file. This is my code:system("plink $server"); rest of my perl script
I would like to add the permissions on the file - whether write or read etc. also to the theOutputFile. Any suggestions ?chdir ($pathToCheck); open theInputFile, $inputFile or die "Could not read from $inputFi +le, program halting. \n"; open (theOutputFile, '>', $outputFile) or die "Could not open $out +putFile. \n"; while (<theInputFile>) { chomp; my $fileBeingChecked = "$_"; if (-e $fileBeingChecked) { #my $fileSize = -s $fileBeingChecked; my $fileSize = stat($fileBeingChecked)->size; my $date_string = ctime(stat($fileBeingChecked)->mtime); print theOutputFile "Yes, $fileSize, $date_string \n"; } else { print theOutputFile "No \n"; } } close (theOutputFile); close (theInputFile);
|
|---|