also, while we're at it, whenever you find yourself doing a whole bunch of print statements I like to use what's called a unix 'here document'. (google it).
So that something like this:
print " $0 -l <log_file> -u <userlist_file> -r <report_file>\n\n" +; print " -l <log_file> The relative or absolute path t +o the webserver logfile.\n" ; print " -u <userlist_file> The relative or absolute path t +o the user list file.\n" ; print " -r <report_file> The relative or absolute path t +o the generated report file.\n\n" ;
looks like this:
print <<EOUsage; $0 -l <log_file> -u <userlist_file> -r <report_file> -l <log_file> The relative or absolute path to the webse +rver logfile. -u <userlist_file> The relative or absolute path to the user +list file. -r <report_file> The relative or absolute path to the gener +ated report file. EOUsage
You don't have to worry about sticking in '\n's wherever and no need to backslash protect a lot of special characters, you can stick your variables in it, and you can see what your output will look like because it is exactly as you typed it... like magic.
Ain't perl cool? :) Good luck, --Ray
In reply to Re^2: Script Help!
by raybies
in thread Script Help!
by blackice69
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |