in reply to Checksum Help

@AGVB should be @ARGV. Then you could call the script with your filename as parameter. If you want to have a fixed filename in the script, just replace $file in the open statement with your file path and remove the loop and the line before the loop.

Replies are listed 'Best First'.
Re^2: Checksum Help
by TeamViterbi (Novice) on Jul 07, 2009 at 20:52 UTC
    Hi Jethro, Thanks for the quick response. When you say "remove the loop and the line before the loop" are you referring to the for loop and the line beginning with scalar? Sorry for the confusion, I am still very new to perl and programming in general, but I'm making headway in learning!

      Yes, the line before the loop checks whether the script got any parameters when it was called (the parameters are automatically stored in the array @ARGV when the script is started). If not, it gives a helpful message how to call the script and stops. If the script has parameters it loops through all the parameters and opens each one of them and prints the crc of each file

      So if you only want one fixed file checked, you obviously don't need the loop and don't need to check for any parameters. Otherwise just keep the script and call it with the file paths as parameter