On Mon, 18 Aug 2003, Alex Brewer wrote:

> The real question was why the STDOUT doesn't appear in the terminal
> window, so the famous 'hello world' script runs OK but puts the output
> somewhere else. I can pipe it to a second script to put the output in a
> file but that's no use if I want to build an interactive script.

This is just not correct. I haven't seen or read anything to suggest that
STDOUT, STDIN, and STDERR behave any differently on an OSX console than
they do on Linux, BSD, Solaris, or Irix. (I haven't tried any other Unix
variants, but that's enough to satisfy my curiosity :).

What results are you seeing that suggest OSX & Perl behave at all strange
as far as the standard file streams? Can you provide sample code?

> A related question. I have chmod 755'ed the file (called foo.command)
> so that it is executable, but when I type the command name in the
> terminal (have checked the path), the response is 'Command not found',
> so I have to type 'perl foo.command' then the script runs. I have the
> '#!/usr/bin/perl -w' as line one.

Are you using the default shell, tcsh? What do you get from

    echo $PATH

? Chances are, the current working directory (" . ") isn't on the list.
You can change this by editing your dotfiles (~/.tcshrc or ~/.bashrc,
depending on your poison of choice), but a lot of people will argue that
having CWD in your path is questionable from a security point of view.

One way around this, regardless of your $PATH settings, is to explicitly
add the current directory to the command you're invoking with './', as

    ./foo.command

This will work no matter what $PATH is, because your shell will expand
that dot into the full path, as if you had typed (say)

    /Users/abrewer/bin/foo.command

or whatever.

This isn't an OSX issue; it comes up on pretty much all POSIX shells.

> The other stuff was how I get hold of perl 5.8 (do I need compilers?),
> and thanks for the cpan url.

If you have specific functionality you need from 5.8, then yes it can be
built & installed, and yes doing so generally means getting a compiler.
For the latter, Apple provides a full suite of development tools that
generally gets updated a couple of times per year. The development tools
are a free (and huge) download after you sign up for a free developer's
account at <http://connect.apple.com/>. Those will provide you with the
standard GNU command line tools (gcc, make, etc) as well as graphical
applications for building OSX gui software.

Once you've got the developer's tools installed, you have everything you
need to upgrade Perl. However, you may want to try the Fink package
manager, which is based on Debian's dpkg/apt-get/dselect toolkit. If you
install Fink, then installing Perl 5.8.0 is just a matter of running

    sudo fink install perl580

and waiting half an hour or so for it to compile.

Alternatively, you may prefer to just follow David Wheeler's instructions
for this kind of thing at <http://david.wheeler.net/osx.html>.

Alternatively, if you don't *need* 5.8.x just yet, and you can make do
with 5.6.0 for now, then the next version of OSX is planned to come with a
copy of Perl 5.8.1; it should be out by the end of the year.

More questions? Send 'em here, or feel free to sign up for the OSX Perl
list at <http://lists.perl.org/showlist.cgi?name=macosx>.


HTH :)


-- 
Chris Devers [EMAIL PROTECTED]
http://devers.homeip.net:8080/

version, latest, n.
That VERSION which most exceeds the DEADLINE for completion.

    -- from _The Computer Contradictionary_, Stan Kelly-Bootle, 1995

Reply via email to