Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Perl?

Perl?
Thread Tools
manfreds
Junior Member
Join Date: Oct 2002
Status: Offline
Reply With Quote
Apr 25, 2003, 07:14 PM
 
I need to run Perl on OS X. Is this possible somehow?
Turn your web browser into a great PDF viewer � with PDF Browser Plugin
     
philzilla
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Apr 25, 2003, 07:25 PM
 
it's already running, when you boot the machine up
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
holygoat
Dedicated MacNNer
Join Date: Mar 2003
Location: UK
Status: Offline
Reply With Quote
Apr 25, 2003, 07:27 PM
 
Doesn't a version come with it?
     
manfreds  (op)
Junior Member
Join Date: Oct 2002
Status: Offline
Reply With Quote
Apr 25, 2003, 07:50 PM
 
Originally posted by philzilla:
it's already running, when you boot the machine up
So what do I have to do?
Turn your web browser into a great PDF viewer � with PDF Browser Plugin
     
Millennium
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Apr 25, 2003, 08:47 PM
 
Um... it's Perl. Granted, it's the command-line version (though you can also get a Carbon version from the Web and Cocoa bindings are in the works). But it works basically the same as it does everywhere else.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Gul Banana
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
Apr 25, 2003, 10:00 PM
 
In other words,
a) Write a perl script
b) Run it with, for example, "./scriptname" or "perl script.pl"
[vash:~] banana% killall killall
Terminated
     
philzilla
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Apr 25, 2003, 10:30 PM
 
Originally posted by manfreds:
So what do I have to do?
apply your finger to the Power button
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
manfreds  (op)
Junior Member
Join Date: Oct 2002
Status: Offline
Reply With Quote
Apr 27, 2003, 12:32 PM
 
Originally posted by Gul Banana:
In other words,
a) Write a perl script
b) Run it with, for example, "./scriptname" or "perl script.pl"
Thanks. Unfortunately it doesn't do anything. If I type perl xxxx.pl nothing happens, not even an error message. Where does the output go?
Turn your web browser into a great PDF viewer � with PDF Browser Plugin
     
Phoenix1701
Senior User
Join Date: Jun 2001
Location: Massachusetts, USA
Status: Offline
Reply With Quote
Apr 27, 2003, 01:14 PM
 
Well, assuming you put some print statements in there somewhere, it should go to standard output... if you want to make sure you're getting the right interpreter, type:

which perl

And then use the path that's generated by that as the first line of your script:

#!/usr/bin/perl -w

(In my opinion, you should always use the -w flag -- it enables warnings and debuggings and things of that nature that may very well not be reported otherwise. In fact, an error of that sort might be why your script isn't working.)
     
manfreds  (op)
Junior Member
Join Date: Oct 2002
Status: Offline
Reply With Quote
Apr 27, 2003, 01:38 PM
 
Thanks, Phoenix!

It turned out it were the Macintosh line breaks. It appears to work with Unix line breaks only.
Turn your web browser into a great PDF viewer � with PDF Browser Plugin
     
manfreds  (op)
Junior Member
Join Date: Oct 2002
Status: Offline
Reply With Quote
Apr 27, 2003, 02:58 PM
 
Allow me another question please: I'm supposed to do chmod 755 on the file and put it into a cgi-bin directory. I made a cgi-bin folder in my Web-Sites folder, but Safari doesn't execute the script. It just loads it as text.
Where is this cgi-bin folder so that Safari can execute the script?

------

Never mind. I found it. The script belongs into Library/WebServer/CGI-Executables
( Last edited by manfreds; Apr 27, 2003 at 03:48 PM. )
Turn your web browser into a great PDF viewer � with PDF Browser Plugin
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 06:08 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,