First, the first line in the script is the "shebang" line. Specifically, I am referring to this line:
The -w in the line tells perl to turn on warnings. I personally don't use the switch, I just specify it without it. On another note about it, that line is specific to a Unix/Linux system. Since you are on Windows, you don't really even need that line, but its good practice to stay in. You could specify your c:\ path to the perl interpreter if you wish. When I develop on Windows (if ever), I don't put it at all.
When starting a perl script, your script should always start as follows, using a unix example:
-
#!/usr/local/bin/perl
-
-
use strict;
-
use warnings;
-
You will find that a number of us on here will have you add those two lines after the shebang line and troubleshoot the issues it finds before we will look at your code.
The reason the window goes away so quickly is because the program exits that quickly. My recommendation is to run your scripts from the command line instead of double clicking on them. It will allow you to see all that is going on. Open the dos prompt, navigate to where the script is and run it as so:
You will notice that the script runs and outputs to the screen and goes back to a prompt.
Hope that helped.
Regards,
Jeff