RSS Forums RSS
Please support our Perl advertiser: Programming Forums

problem in running perl script

Join Date: Jan 2006
Posts: 223
Reputation: katharnakh is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 20
katharnakh's Avatar
katharnakh katharnakh is offline Offline
Posting Whiz in Training

Re: problem in running perl script

  #4  
Jul 18th, 2007
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.
  1. #!C:\Perl\bin\perl.exe #shebang line
  2.  
  3. # some code follows
  4. ...

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.
Last edited by katharnakh : Jul 18th, 2007 at 10:54 am.
challenge the limits
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 5:26 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC