When I was checking processes of perl using ps aux | grep perl the list of perl pid's got listed where its waiting in queue. so i started investigating how this processes got initiated /usr/local/bin/processLogs. I wanted to know what does -w meant in this process execution /usr/bin/perl -w /usr/local/bin/processLogs.
[root@test]# ps aux | grep perl
root 4223 1.6 0.0 132560 4576 ? R 03:11 1:06 /usr/bin/perl -w /usr/local/bin/processLogs
root 4233 1.3 0.0 132560 4552 ? R 03:11 0:55 /usr/bin/perl -w /usr/local/bin/processLogs
root 4246 1.1 0.0 132560 4552 ? R 03:11 0:49 /usr/bin/perl -w /usr/local/bin/processLogs
root 4259 1.0 0.0 132560 4548 ? R 03:11 0:44 /usr/bin/perl -w /usr/local/bin/processLogs
root 4272 0.8 0.0 132560 4544 ? R 03:11 0:33 /usr/bin/perl -w /usr/local/bin/processLogs
root 4288 0.6 0.0 132560 4580 ? R 03:11 0:28 /usr/bin/perl -w /usr/local/bin/processLogs
If you run
perl -hyou will get the help menu, where it says for-w:This simply enables warnings. If this program is run in an automatic process, the warnings may be redirected to a log where you can read them. Assuming there are any warnings. You will need to refer to the program file
processLogsto see what the program does.Typically, an experienced user will not use
-w, but prefer to use the lexically scopeduse warningsinstead.The full output: