I am writing PERL script on window and willing to do same thing on MAC terminal (MacBook). I have confirmed that PERL is pre-installed in my macbook. I would appreciate if any one could help me in this regards
Thank you very much. Its working now as I have executed few script successfully. Would you also help in if this terminal can be used for writing script and how ?
If you are familiar with Linux console editors (e.g. vim, emacs, etc.), I strongly suggest you to have a look to the MacPorts Project (https://www.macports.org/) for installing and using them on your Mac.
The Mac already provides both vi and emacs in the Terminal. You can also use an excellent free text editor named TextWrangler that runs as a native Mac application.
1. Install a good text editor. I wold suggest TextWrangler (on the App Store), TextMate 2.0 (http://macromates.com/download), or Sublime Text (probably overkill for your needs).
2. Write/edit the Perl script using the editor and save it in a directory of your choice (e.g., "Development" in your home directory)
3. Launch the Terminal application, cd to the directory where your Perl script is located and run the script "my_perl_script" with the command:
$ perl my_perl_script
If you wish, you can make the script directly executable from the Terminal by adding a shebang line "#!/usr/bin/perl" (it must be the first line of the script, written without quotes) and changing the file permissions
Once you get to a mac terminal, you are accessing the underlying Unix and all your normal Unix commands will work. Mac OS X tries to hide the underlying Unix (BSD) OS from the typical user, but once you expose it - you have full access.
You could enable sshd (allow remote access), also su'ing to root, if you so choose.