I am working on a script that lists files in a directory with a few file attributes depending on what option the user specifies at the command prompt. The script uses Getopt::Std and takes two switches.
The first switch allows the user to specify a directory, the second switch gives a long listing of the specified directory. For the most part, the switches work, and I get the required output, but if either switch is used and no argument is given, I need the script to use the current directory for the script. I am not sure how to specify that in the code.
I am using a regular IF statment now, just looking for tips on how to implement what I need.
I am doing very basic like this for now:
if ($option_d) {
code
code
}