in reply to getopt::std to pass arguments to command line help

I have been told that this is possible but I don't quite understand how to implement that with getopt::std.
That's because you should use Getopt::Long. Also
open STDOUT, ">> $log_dir/$log_file
Don't open files like this if you don't know what Perl does with two-argument open. Especially if $log_dir and $log_file come from user input. Do it like this:
open STDOUT, '>>', $log_dir/$log_file
Consider using File::Spec::Functions for manupilating file names.
&filesize;
Don't call functions like this if you don't know what it actually does. Call them like this:
filesize();

use warnings; instead of -w. Also use strict;

Replies are listed 'Best First'.
Re^2: getopt::std to pass arguments to command line help
by Anonymous Monk on Jan 20, 2015 at 17:45 UTC
    open STDOUT, '>>', "$log_dir/$log_file", but really
    use File::Spec::Functions; ... open STDOUT, '>>', catfile( $log_dir, $log_file ) or die "Can't open $log_file - $!\n";
Re^2: getopt::std to pass arguments to command line help
by Anonymous Monk on Jan 20, 2015 at 18:03 UTC
    That makes sense. I see how that works better, thank you. The log file is created if it doesn't exist, however is there a way to specify permissions when the file is being created? Example, what if I wanted to the file to have 755 perms? I know it's not recommended, but for the sake of the question, what would you recommend?
        Thank you for your suggestion. I will look into that as well.