Re: Perl/MacPerl on MacOS X

2004-01-23 Thread AWLeverenz

 do shell script perl /tmp/junk.pl
 -- = Hello
 
I'm afraid I don't have a handle on the Mac OS Extended file system. When you 
make the do shell call in Script Editor, as you demonstrated, where is the 
origin of the filepath? I'm not successful with SE locating my perl file, 
which located on my Macintosh HD. Will that be the same filepath if called from 
Terminal?

Thanks for your help,
Alan


Re: Perl/MacPerl on MacOS X

2004-01-23 Thread Doug McNutt
At 16:59 -0500 1/23/04, [EMAIL PROTECTED] wrote:
  do shell script perl /tmp/junk.pl
 -- = Hello

I'm afraid I don't have a handle on the Mac OS Extended file system. When you
make the do shell call in Script Editor, as you demonstrated, where is the
origin of the filepath? I'm not successful with SE locating my perl file,
which located on my Macintosh HD. Will that be the same filepath if called from
Terminal?

http://developer.apple.com/technotes/tn2002/tn2065.html

Will be helpful. HFS+ starts with a disk name and uses colons for file separators. 
There is no root except perhaps for the name of the startup disk.

Also AppleScript will not honor your .login or .profile definition of $PATH and it 
defaults to the bash shell regardless of your choice as a user. One pretty much needs 
full paths for everything but POSIX path of HFS+ file path helps a lot. See also 
quoted form of to get the escapes escaped.

If you really get involved learn about $HOME/.MacOSX/environment.plist where you can 
set up a default $PATH.

Forget about using MacPerl with AppleScript on OS neXt.

I find it easier to prepare perl scripts in an editor, make them executable with a #! 
line and an x permission bit. Use AppleScript only to create a Finder-executable 
application with a do shell script that just points to your executable.

-- 
--  There are 10 kinds of people:  those who understand binary, and those who don't 
--


Re: Perl/MacPerl on MacOS X

2004-01-23 Thread John Delacour
At 4:59 pm -0500 23/1/04, [EMAIL PROTECTED] wrote:

  do shell script perl /tmp/junk.pl
 -- = Hello

I'm afraid I don't have a handle on the Mac OS Extended file system. When you
make the do shell call in Script Editor, as you demonstrated, where is the
origin of the filepath? I'm not successful with SE locating my perl file,
which located on my Macintosh HD. Will that be the same filepath 
if called from Terminal?


do shell script ls -al will list the items at the level of the startup disk.

By contrast a new Terminal window will open with your user directory 
as the current working directory.

This AS script will change directory to your user dir, change to 
desktop, create a perl script there and run it:

do shell script cd ;
cd desktop ; echo 'print qq~Hello ! $/~'  junk.pl ; perl junk.pl


Perl/MacPerl on MacOS X

2004-01-15 Thread Ingo Weiss
Hi,

as a long time MacPerl user who just made the transition to MacOS X I am
a little confused: What is the difference between using MacPerl on MacOS
X and using Perl on MacOS X? I guess I am looking for help with using
Perl on MacOS X - am I in the right place at all?

Thanks!
Ingo


Re: Perl/MacPerl on MacOS X

2004-01-15 Thread John Delacour
At 4:24 pm -0500 15/1/04, Ingo Weiss wrote:

as a long time MacPerl user who just made the transition to MacOS X I am
a little confused: What is the difference between using MacPerl on MacOS
X and using Perl on MacOS X? I guess I am looking for help with using
Perl on MacOS X - am I in the right place at all?
You're in the right place.

You can still use MacPerl running in Classic but that limits you to 
v. 5.6.0 and on MacOSX you can run the latest versions (Panther 
installs 5.8.1 but you can install 5.8.2).

The difference is that you work in a different way in OSX.  Suppose 
you have a file saved at /tmp/junk.pl with the content

   print Hello\n

Then you can a) compose, check syntax and run it in BBEdit;  b) do 
the same in some other Perl editor; c) work in the Terminal as 
follows:

% cd /tmp
% perl junk.pl
hello
%
or d) send an Apple event from Script Editor etc. and get the result 
in the SE results pane.

do shell script perl /tmp/junk.pl
-- = Hello
There are dozens of different options and combinations of ways to do things.

At the moment BBEdit is more or less Hobson's choice as an editor and 
it's not everyone's cup of tea, but other things are in the pipeline. 
You might be interested to look at 
http://www.maths.mq.edu.au/~steffen/Alpha/AlphaX/ as an 
alternative.  I haven't tried it yet, so this is not a 
recommendation, but Alpha was once a very strong programmers' editor 
for MacOS.

Just ask away here.  It's not very long ago that I was as perplexed 
as you.  Luckily I'd done a bit of perling on Windows as well. so 
that eased the transition from the cosy world of MacPerl.

JD






Re: Perl/MacPerl on MacOS X

2004-01-15 Thread Chris Nandor
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (John Delacour) 
wrote:

 You can still use MacPerl running in Classic but that limits you to 
 v. 5.6.0

Technically, 5.6.1.  Actually, it is 5.6.1 plus about a year's worth of 
patches ... it is closer to 5.6.2 than 5.6.1.

John gave a good summary, and yes, this is where you want to be.  Here's the 
logical breakdown:

* Mac OS is Mac OS 7.5-9.x
* Mac OS X is Mac OS X 10+
* MacPerl is for Mac OS, or Classic under Mac OS X
* perl is for Mac OS X (or any Unix :-)

As the maintainer of MacPerl, I can say there is very little reason to use 
MacPerl on Mac OS X, unless you need to use GUI-based MacPerl programs (like 
ones that use Mac::Windows), as those modules have not been ported to Mac OS 
X.  Regular perl on Mac OS X is superior in every other way.

Some people do prefer the MacPerl environment, but as John said, there are 
other options.

Cheers,

-- 
Chris Nandor  [EMAIL PROTECTED]http://pudge.net/
Open Source Development Network[EMAIL PROTECTED] http://osdn.com/


Re: Perl/MacPerl on MacOS X

2004-01-15 Thread John Delacour
At 11:18 pm + 15/1/04, John Delacour wrote:

...You might be interested to look at 
http://www.maths.mq.edu.au/~steffen/Alpha/AlphaX/ as an 
alternative.  I haven't tried it yet, so this is not a 
recommendation, but Alpha was once a very strong programmers' editor 
for MacOS.
I was actually unable to connect to the download link provided, so I 
wrote to Daniel Steffen asking what the problem was:



At 10:41 am +1100 16/1/04, Daniel A. Steffen wrote:

Is this a temporary problem or has the URI changed?
temporary, the server in question is down for maintenance, should be 
back up later today, apologies