Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hõla monks, I am new to perl and have so far only done a few cgi scripts on my website and now I want to do some Perl programming on my apple computer running tiger. The problem is that all of the programs I make are automatically saved as "classic applications" and when they are clicked they just bounce in the dock and don't do anything. I have tried multiple sh-bang lines and file extensions (though the example program in the perl folder is just a .app and it doesn't work either, so I have almost no hope of this method working) and nothing works. Sorry for the bother, it seems as if I probably made a gross oversight, but any help would be appreciated. humbly yours, senõr_biggles

Replies are listed 'Best First'.
Re: Perl Problems in Tiger
by adrianh (Chancellor) on Jul 23, 2005 at 08:48 UTC
    I am new to perl and have so far only done a few cgi scripts on my website and now I want to do some Perl programming on my apple computer running tiger. The problem is that all of the programs I make are automatically saved as "classic applications" and when they are clicked they just bounce in the dock and don't do anything.

    I'm not 100% but it sounds like you're using MacPerl - the Classic port of Perl, rather than the built in Perl on Tiger.

    Try this. Save this file using your text editor of choice as "hello.pl":

    #! /usr/bin/perl print "hello world\n";

    Then start up the Terminal.app and type:

    perl hello.pl

    The should then run. If it doesn't let us know what happens and what error messages you get.

Re: Perl Problems in Tiger
by Fang (Pilgrim) on Jul 23, 2005 at 10:36 UTC

    Perl comes bundled with OS X, I just don't know what that "example program in the perl folder" you're talking about is. Where is it located? Did you install something? Like MacPerl as the previous poster suggested.

    You shouldn't have to install anything at all to write Perl scripts. To use them, you'll have to go with the Terminal.app located in /Applications/Utilities. If you want to create double-clickable program with an OS X GUI, you could use something like Pashua.

Re: Perl Problems in Tiger
by JSchmitz (Canon) on Jul 23, 2005 at 12:52 UTC
    cpe-67-10-93-76:~ jschmitz$ uname -a Darwin cpe-67-10-93-76.houston.res.rr.com 8.2.0 Darwin Kernel Version +8.2.0: Fri Jun 24 17:46:54 PDT 2005; root:xnu-792.2.4.obj~3/RELEASE_P +PC Power Macintosh powerpc cpe-67-10-93-76:~ jschmitz$ which perl /usr/bin/perl
    As you can see above Perl is in your path by default with Tiger I have been using the new Activestate port myself just because the package manager is slicker and to compile modules on OSX you need to install the xcode tools because Tiger does not come with make.

    All you should have to do by default is write a little test script save it and run it. It sounds like you are trying to kick off this script by clicking on an icon?

    Write your test script ..save it ..then run it ./test.pl
    Cheers -

    Jeffery
Re: Perl Problems in Tiger
by senõr_biggles (Novice) on Jul 23, 2005 at 17:33 UTC
    Yes, the problem was that I was clicking it like an icon. I got this idea because the example program I was talking about is saved in system/library/perl/extras/applications/wxPerl and the extension is .app. Opening it in the terminal with the perl command worked, though, so thank you all for your help.
Re: Perl Problems in Tiger
by senõr_biggles (Novice) on Jul 23, 2005 at 07:56 UTC
    Oops, I wasn't logged on. The post is by me. As the end implies.