Hi,
so, u want me to write the code and save it in a text file and type perl -e and the file name on command line?
Depends,
1. you can write perl code and save it as .pl (for eg. program1.pl) and run.
2. make it executable by inluding shebang* line(in case of UNIX). To run on windows make sure you have set the path to perl interpreter correctly. Then you can run your program like,
>perl program1.pl
The shebang* line, nothing but path to interpreter in your machine, for eg:
in windows( the path may be different on your machine. Depends on where you have installed Perl.
#!C:\Perl\bin\perl.exe #shebang line
# some code follows
...
You can save the file with .pl extension.
Note: You can use -e option/switch only when you want to work under interpreter mode. i.e, when you want to check some piece of code,
eg. You can check above, KevinADC's post for that... how it goes... or check or check the piece of code.
For big programs you can write it in any editor(for eg. notepad or any suitable editor) and follow the instructions mentioned above.
kath.