Re: MacPerl Script on OS X
Actually, if g5hd is a mounted (external) hard drive than the /Volumes/gh5d is required. If it's the root, than it's not. el on 8/23/08 5:33 PM Doug McNutt said the following: At 08:43 +0100 8/23/08, Eberhard Lisse wrote: [...] open (TRANS, /Volumes/g5hd/newScansImages/trans) or die Error can't open $!\n; Be really careful about that /Volumes/ directory. Apple uses it as a mount point for external and secondary disks and not for the root disk which can't have a name other than / in the world of UNIX. g5hd sounds a lot like a user inserted name for a main disk. The proper form in the UNIX - perl5 world would be more like /newScansImages/trans where the leading solidus is the root directory for the operating system. [...] But then the line ends didn't have any thing to do with it... el -- If you want to email me, replace nospam with el
Re: MacPerl Script on OS X
Ben, on 2/29/08 7:15 PM Jay Savage said the following: On Thu, Feb 28, 2008 at 7:13 PM, Ben Crane [EMAIL PROTECTED] wrote: Thanks for your response copied below. I really don't want to go to Perl 5.x and all that newfangled stuff. This can only be described as really shortsighted. Not only because this is the very issue you are having :-)-O Here's my code ending with the offending line 7 according to my BBEdit error msg also copied below. I think the problem must be something simple. BBEdit says the syntax is OK, and it does run OK under Classic. I've tried different path name conventions, ( / instead of : ) but that doesn't seem to help. All files have 777 permissions. 7 open (trans, g5hd:newScansImages:trans) or die Error, can't open; Assuming read only: open (TRANS, /Volumes/g5hd/newScansImages/trans) or die Error can't open $!\n; or open (TRANS, /newScansImages/trans) or die Error, can't open /newScansImages/trans, $!\n; greetings, el -- If you want to email me, replace nospam with el
Re: MacPerl Script on OS X
At 08:43 +0100 8/23/08, Eberhard Lisse wrote: 7 open (trans, g5hd:newScansImages:trans) or die Error, can't open; open (TRANS, /Volumes/g5hd/newScansImages/trans) or die Error can't open $!\n; Be really careful about that /Volumes/ directory. Apple uses it as a mount point for external and secondary disks and not for the root disk which can't have a name other than / in the world of UNIX. g5hd sounds a lot like a user inserted name for a main disk. The proper form in the UNIX - perl5 world would be more like /newScansImages/trans where the leading solidus is the root directory for the operating system. A sure way to get the right string is to open Terminal.app and use Finder to drag a file icon into the window. Terminal.app will display the POSIX path relative to the current working directory which you might want to set to / with a cd / command. -- -- From the U S of A, the only socialist country that refuses to admit it. --
Re: MacPerl Script on OS X
On 2008–02–28, at 22:52, Jay Savage wrote: On Thu, Feb 28, 2008 at 4:03 PM, Ben Crane [EMAIL PROTECTED] wrote: I have a Perl 4.X script that runs using MacPerl in Classic on my G5 Mac but I can't get it to run using Perl in 10.4.11. What do I need to do to make it run? Thanks for any suggestions. Upgrade it work with Perl 5.x ;) That's the way to go. Seriously. See below. Seriously, though: what errors are you seeing? Does it rely on any modules? There weren't modules in Perl 4. People wanting such things did things in their own mutually-incompatible ways with do(file), eval and such. (The way I did it with eval in one big application stopped working in Perl 5, which interpreted it as method invocation ...) Perhaps more importantly: is it set to be executable on 10.x? Remember that the permissions scheme is different on X, and if it was set to run under MacPerl on Classic, it won't be executable by default. Unfortunately, a *lot* has changed in the last 15 years (the last perl4 release was in 1993), so I don't think anyone is going to be able to give you a list of all the things that could be going wrong off the tops of their heads. There are about three pages on incompatibilities between Perl 4 and Perl 5 in Programming Perl (pages 590-593 in my 3rd edition). For the hell of it, I just tried building perl-4.036 under Mac OS 10.5.2, as that might be one way round your problem. I didn't get far (about as far as makedepend). There are antiquarians who like doing this sort of thing (see http://dev.perl.org/perl1/), but I don't number myself among them ... -- Dominic Dunlop
Re: MacPerl Script on OS X
On Thu, Feb 28, 2008 at 7:13 PM, Ben Crane [EMAIL PROTECTED] wrote: Jay, Thanks for your response copied below. I really don't want to go to Perl 5.x and all that newfangled stuff. Here's my code ending with the offending line 7 according to my BBEdit error msg also copied below. I think the problem must be something simple. BBEdit says the syntax is OK, and it does run OK under Classic. I've tried different path name conventions, ( / instead of : ) but that doesn't seem to help. All files have 777 permissions. 1 #!/usr/bin/perl 2 3 # This script converts the file names of scans and images formed from the scans from consignor IDs 4 # to lot IDs. The file g5hd:newScansImages:trans is formed by exporting from the filemakerPro records that 5 # describe the lots and contain the images 6 7 open (trans, g5hd:newScansImages:trans) or die Error, can't open; 8 Hi Ben, First, you rinstinct to convert to OS X/unix-style filenames was correct. Second, you'll want to add $! to your die messages. That will tell you *why* the operation failed: open (trans, g5hd:newScansImages:trans) or die Error, can't open: $!; In this case, it's probably because the file doesn't exist, or your script doesn't have read permissions for it, but you won't know for sure until you see what $! returns on your system. If the file does exist, make sure the user your script runs as can read the file. If the file doesn't exist, make sure you are opening the file in read/write mode see perldoc open for more information, but something like open(TRANS, , path); # or open(TRANS, , path); should do what you need, depending on whether you need to read or write. Also, keep in mind that filehandles should be barewords or variables, not double-quoted strings. That can bite you later. By convention, they're also usually uppercase. That makes it easier to tell the difference between filehandles and other things. HTH, -- jay -- This email and attachment(s): [ ] blogable; [ x ] ask first; [ ] private and confidential daggerquill [at] gmail [dot] com http://www.tuaw.com http://www.downloadsquad.com http://www.engatiki.org values of β will give rise to dom!
Re: MacPerl Script on OS X
At 15:03 -0600 28/2/08, Ben Crane wrote: I have a Perl 4.X script that runs using MacPerl in Classic on my G5 Mac but I can't get it to run using Perl in 10.4.11. What do I need to do to make it run? What errors do you get if you try to run it in BBEdit? JD
Re: MacPerl Script on OS X
On Thu, Feb 28, 2008 at 4:03 PM, Ben Crane [EMAIL PROTECTED] wrote: I have a Perl 4.X script that runs using MacPerl in Classic on my G5 Mac but I can't get it to run using Perl in 10.4.11. What do I need to do to make it run? Thanks for any suggestions. Upgrade it work with Perl 5.x ;) Seriously, though: what errors are you seeing? Does it rely on any modules? Perhaps more importantly: is it set to be executable on 10.x? Remember that the permissions scheme is different on X, and if it was set to run under MacPerl on Classic, it won't be executable by default. Unfortunately, a *lot* has changed in the last 15 years (the last perl4 release was in 1993), so I don't think anyone is going to be able to give you a list of all the things that could be going wrong off the tops of their heads. Post the errors, though, and if possible the problematic code, and we can help. HTH, -- jay -- This email and attachment(s): [ ] blogable; [ x ] ask first; [ ] private and confidential daggerquill [at] gmail [dot] com http://www.tuaw.com http://www.downloadsquad.com http://www.engatiki.org values of β will give rise to dom!
Re: MacPerl Script on OS X
At 16:52 -0500 2/28/08, Jay Savage wrote: On Thu, Feb 28, 2008 at 4:03 PM, Ben Crane [EMAIL PROTECTED] wrote: I have a Perl 4.X script that runs using MacPerl in Classic on my G5 Mac but I can't get it to run using Perl in 10.4.11. What do I need to do to make it run? Thanks for any suggestions. Upgrade it work with Perl 5.x ;) Seriously, though: what errors are you seeing? Does it rely on any modules? Perhaps mober that the permissions scheme is different on X, and if it was set to run under MacPerl on Classic, it won't be executable by default. Unfortunately, a *lot* has changed in the last 15 years (the last perl4 release was in 1993), so I don't think anyone is going to be able to give you a list of all the things that could be going wrong off the tops of their heads. Post the errors, though, and if possible the problematic code, and we can help. One very simple possibility is that the line ends in the code itself may need to be converted from Mac Classic 0D's to UNIX 0A's. ftp://ftp.macnauchtan.com/Software/LineEnds/FixEndsFolder.sit 52 kB is one way. Remember that in MacPerl the designator \n generates 0D and \r generates 0A. That's reversed from UNIX conventions which are used in OS neXt. -- -- From the U S of A, the only socialist country that refuses to admit it. --