Women in Technology

Hear us Roar



Article:
  Learning the Mac OS X Terminal, Part 4
Subject:   Perl Scripts
Date:   2006-01-09 14:52:13
From:   Cruzapete
I dont know if this is too late that it wont be answered. I will so much appreciate it if it can be treated and my problem solved.


I was a windows user but moved to Mac OS X. I have some perl scripts I run on MS-DOS cmd.exe but have been having problems running those scripts on Mac OS X terminal.


Is there any command used for running perl scripts or how do I go about it.


Thanks for responding.
Cruzapete

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Perl Scripts
    2006-05-26 01:30:22  samueljenningshughes@yahoo.com [View]

    The best method to use is, at the top of the scripts, write "#!/usr/bin/perl", which tells a terminal to execute this script using perl.

    Next, you should open Terminal.app, which is in /Applications/Utilities.

    Type "cd location-of-perl-script".

    Then type "chmod a+x perl-script-filename" to make it executable.

    lastly, to run the script, either type "perl perl-script-filename" or "./perl-script-filename", the latter if you added "#!/usr/bin/perl" to the top of the script. this is done of course in the Terminal.app, and in the directory of which the script is located.