Re: new to modules
On 28/8/02 at 22:52, [EMAIL PROTECTED] (Erik Price) wrote: I've used Perl here and there (on my OS X box) for basic stuff, but I haven't really played with modules. I feel like I'm really missing out on something cool here. Where do modules get stored by default in Darwin? What is a good way to see which ones I have installed? (I actually haven't installed any but I meant pre-installed on Darwin.) I use this quick hit: #!/usr/bin/perl -w use ExtUtils::Installed; my $instmod = ExtUtils::Installed-new(); foreach my $module ($instmod-modules()) { my $version = $instmod-version($module) || ???; print $module -- $version\n; } Paste it into vim, BBEdit or what ever your choice and run it and it'll return your installed modules. Once I hear back on this I plan to download some modules and use them. The LWP module has tempted me from the very beginning. Remember the issue with case insensitivity on Mac OS X when installing LWP. For more details see: http://david.wheeler.net/osx.html Scroll down right to the bottom and the details are there. Have fun, Regards, Phil.
the head problem in lwp - Re: new to modules
On Thursday, August 29, 2002, at 07:20 , Phil Dobbin wrote: [..] Once I hear back on this I plan to download some modules and use them. The LWP module has tempted me from the very beginning. Remember the issue with case insensitivity on Mac OS X when installing LWP. For more details see: http://david.wheeler.net/osx.html Scroll down right to the bottom and the details are there. My compliments on the documentation and the work around... my path was to download the ppt perl version of head http://www.perl.com/language/ppt/src/head/index.html and put the personal modification into it # Get the options. if ( $ARGV[0] =~ /-(\d+)/ ) { # # drieuxish hack to allow for the old school # head -12 file $ARGV[0] = -n$1; } this way I can still do head -12 file vice the standard bsd style: SYNOPSIS head [-n count | -c bytes] [file ...] ciao drieux ---
Fwd: new to modules
On Wednesday, August 28, 2002, at 07:52 , Erik Price wrote: Folks, I've used Perl here and there (on my OS X box) for basic stuff, but I haven't really played with modules. I feel like I'm really missing out on something cool here. Where do modules get stored by default in Darwin? What is a good way to see which ones I have installed? (I actually haven't installed any but I meant pre-installed on Darwin.) as an exercise with File::Find I put up http://www.wetware.com/drieux/pbl/misc/findModules.txt I hope it helps. ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: the head problem in lwp - Re: new to modules
On 29/8/02 at 07:31, [EMAIL PROTECTED] (drieux) wrote: On Thursday, August 29, 2002, at 07:20 , Phil Dobbin wrote: [..] Once I hear back on this I plan to download some modules and use them. The LWP module has tempted me from the very beginning. Remember the issue with case insensitivity on Mac OS X when installing LWP. For more details see: http://david.wheeler.net/osx.html Scroll down right to the bottom and the details are there. My compliments on the documentation and the work around... All kudos to David Wheeler. I just followed his instructions and it worked for me ;-) Regards, Phil.
build perl on HPFS+ was Re: the head problem in lwp - Re: new to modules
On Thursday, August 29, 2002, at 09:22 , Phil Dobbin wrote: On 29/8/02 at 07:31, [EMAIL PROTECTED] (drieux) wrote: [..] My compliments on the documentation and the work around... All kudos to David Wheeler. I just followed his instructions and it worked for me ;-) allow me to restructure then... Once I thought that the usual suspects of linux,emac,perl was clear proof that space aliens were taking over now I do perl on OSX so there are all these interesting sites where things align more to 'main stream apple way' or 'bsd-open-source' and it's not always clear which are the 'true believers' So thank you for extending that list... The problem I did not see directly on the page, or am I missing something, but does he do his builds on a ufs partition Since I get weirdness when I am on my apple directory, rather than building stuff on the NFS mounts... granted, under our regime, we do that as a part of the tao - since we want to have a single file server for all the OS supporting stuff for all of the OS's... So it was not until I downloaded something onto my mac and tried to do the usual perl Makefile.PL make make test make install that I ran into issues - I think it was with the 5.6.1 release... ciao drieux ---
Re: build perl on HPFS+ was Re: the head problem in lwp - Re: new to modules
On Thursday, August 29, 2002, at 09:43 AM, drieux wrote: The problem I did not see directly on the page, or am I missing something, but does he do his builds on a ufs partition No, I did it all on HFS+. There are a number of issues that I address on that page, a primary one being that you can't do make install until you mv INSTALL to INSTALL.txt. Since I get weirdness when I am on my apple directory, rather than building stuff on the NFS mounts... granted, under our regime, we do that as a part of the tao - since we want to have a single file server for all the OS supporting stuff for all of the OS's... I'm not sure I follow, here. You can do file sharing with all other OSen on HFS+, AFAIK. So it was not until I downloaded something onto my mac and tried to do the usual perl Makefile.PL make make test make install that I ran into issues - I think it was with the 5.6.1 release... What issues? BTW, I strongly recommend using Perl 5.8.0 now. Like I said, I need to update my page. Regards, David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://david.wheeler.net/ Yahoo!: dew7e Jabber: [EMAIL PROTECTED]
Re: [article] Installing 5.8.0 on Jaguar
On 8/29/02 1:11 PM, David Wheeler wrote: I should get an article done myself in the next few weeks that discusses compiling Apache with Perl 5.8.0 and mod_ssl. I had to install 5.8, apache, mod_perl, mod_ssl, and a ton of other stuff in 10.2. I got it all to work pretty easily (maybe because of how much I fought with it in 10.1 ;) but I didn't take notes, heh. Now I'm loathe to wipe it and try to methodically recreate what I did in a form that will be useful to other people, but I'm glad to hear that someone else will be doing it... :) -John
Re: What namespace are we using for OS X modules?
In article [EMAIL PROTECTED], Drieux [EMAIL PROTECTED] wrote: On Wednesday, August 28, 2002, at 08:34 , _brian_d_foy wrote: In article a05111b19b99346410832@[63.120.19.221], Dan Sugalski [EMAIL PROTECTED] wrote: I'm throwing one or two together. They going in MacOS, MacOSX, OSX Pudge suggested that I move my MacOSX stuff to Mac::*, which i'm going to do. i think Mac::* is fine. does this mean that they will need to be backward compatible to work in MacPerl on OS 9 and older? they don't have to do anything. living in the Mac::* namespace has no requirements. if you want things to work for MacPerl, then you have to make them work for MacPerl. :)
Re: [article] Installing 5.8.0 on Jaguar
John Siracusa writes: I had to install 5.8, apache, mod_perl, mod_ssl, and a ton of other stuff in 10.2. I got it all to work pretty easily (maybe because of how much I fought with it in 10.1 ;) but I didn't take notes, heh. Now I'm loathe to wipe it and try to methodically recreate what I did in a form that will be useful to other people, but I'm glad to hear that someone else will be doing it... :) How hard would it be to bundle a working 5.8+goodies into an installer package in a DMG file? Nat
Re: [article] Installing 5.8.0 on Jaguar
On 8/29/02 1:25 PM, Nathan Torkington wrote: John Siracusa writes: I had to install 5.8, apache, mod_perl, mod_ssl, and a ton of other stuff in 10.2. I got it all to work pretty easily (maybe because of how much I fought with it in 10.1 ;) but I didn't take notes, heh. Now I'm loathe to wipe it and try to methodically recreate what I did in a form that will be useful to other people, but I'm glad to hear that someone else will be doing it... :) How hard would it be to bundle a working 5.8+goodies into an installer package in a DMG file? I dunno, since I've never made a binary package of Unix-y stuff. The instructions for building from source shouldn't be that bad, and that's the better way to install it, IMO. I'm sure David will have the instructions ready soon... :) If you can't wait, it's pretty much just point and shoot if you follow the instructions on the relevant sites (perl.apache.org, modssl.org, etc.) Anyone with some Unix experience (you qualify ;) shouldn't have any problems. The only tricky bit is the mod_perl build which requires a visit to http://apache.org/~joes/ -John
Re: [article] Installing 5.8.0 on Jaguar
John Siracusa writes: I dunno, since I've never made a binary package of Unix-y stuff. The instructions for building from source shouldn't be that bad, and that's the better way to install it, IMO. Not for the vast majority of Apple users, IMO. If we want people to experiment with Perl and mod-perl and all that good stuff, we need to deliver it to them in as convenient a package as possible. (I've heard good things about the Unix Utilities installer from Daemon News, which is a one-click install of X server and a jillion Unix packages. I've got the CD on my desk and hope to find time to try it next week.) Nat
Re: [article] Installing 5.8.0 on Jaguar
On Thursday, August 29, 2002, at 10:46 AM, Nathan Torkington wrote: Not for the vast majority of Apple users, IMO. If we want people to experiment with Perl and mod-perl and all that good stuff, we need to deliver it to them in as convenient a package as possible. I think that will require a system update from Apple, really. I know that Dan has a task on his list to provide a Perl 5.8.0 build for OpenDarwin. I expect that would/might find its way into an Apple system update at some point. David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://david.wheeler.net/ Yahoo!: dew7e Jabber: [EMAIL PROTECTED]
Re: [article] Installing 5.8.0 on Jaguar
On 8/29/02 1:46 PM, Nathan Torkington wrote: John Siracusa writes: I dunno, since I've never made a binary package of Unix-y stuff. The instructions for building from source shouldn't be that bad, and that's the better way to install it, IMO. Not for the vast majority of Apple users, IMO. I don't think the vast majority of Apple users are Perl programmers... :) Anyway, I guess it'd be good to have a simple point-and-click upgrade to 5.8.0. Then, at least, you could tell novices how to use CPAN to install simple modules without any fuss. The Eternal 5.6.0 that seems welded into OS X makes even that simple task fraught with danger. (Oh no, it's downloading perl-5.6.1.tar.gz!) So even if I want to distribute a simple Perl script that happens to use one or two CPAN modules that do not come with 5.6.0, I'm stuck trying to explain to the recipient how to hack his way out of the semi-broken 5.6.0 environment in his default install of OS X. -John
Re: [article] Installing 5.8.0 on Jaguar
On Thu, Aug 29, 2002 at 11:46:58AM -0600, Nathan Torkington wrote: John Siracusa writes: I dunno, since I've never made a binary package of Unix-y stuff. The instructions for building from source shouldn't be that bad, and that's the better way to install it, IMO. Not for the vast majority of Apple users, IMO. If we want people to experiment with Perl and mod-perl and all that good stuff, we need to deliver it to them in as convenient a package as possible. For what it's worth, there is a 5.8.0 package at http://www.serverlogistics.com/downloads-osx.php#perl No idea if it's any good or not, but it's there... :-) dha -- David H. Adler - [EMAIL PROTECTED] - http://www.panix.com/~dha/ What kind of marathon crack binge would cause you believe this? - Mark Rogaski
Re: [article] Installing 5.8.0 on Jaguar
Apple updated their own copy in an update. Would you use your copy and perhaps some of its libraries? This is the main reason I've decided to keep my entire Perl installation in /usr/local, including all of its modules. Apple's Perl can stay right where it is, Apple can do what it wants to it via its OS upgrades, and I don't worry about it. True. If Apple updated their Perl in the same way as in the past, /usr/bin/perl (which, per the article, is a copy of the same Perl installed in /usr/local/bin/perl) would be wiped out. That new binary would also reenable /System/Library/Perl support. If the Apple install is wipe/replace, then it would also trash your installed modules under /Library/Perl. One other thing I noticed is that you use XML::Parser as an example CPAN module to install. If you are indeed installing Perl on a clean Jaguar install, this will likely fail, as you haven't installed Expat yet. Also, if and when you *do* install Expat, and you install it in /usr/local Perl won't be able to find it, because the /usr/local/lib and /usr/local/include directories didn't exist when you installed Perl. I found this out the hard way myself. Argh. I coulda swore I used HTML::Parser as an example instead of XML::Parser for the exact same reason you mention here. I *know* there's extra magick needed for an XML::Parser install, and I'm surprised I used such a bum example as this. I'll see if I can get it fixed. And finally, in the final section, you discuss CGI. I think it would be important to remind users that, if they're running Apple's Apache, then their CGI scripts will be run under Perl 5.6.0, not 5.8.0. Although you mention earlier that Apache will need to be recompiled, the CGI section should be more explicit about this, IMO. That'd only be the case if the user was running the scripts under mod_perl - normal CGI scripts won't be affected. -- Morbus Iff ( i'm the droid you're looking for ) Culture: http://www.disobey.com/ and http://www.gamegrene.com/ Please Me: http://www.amazon.com/exec/obidos/wishlist/25USVJDH68554 icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
Re: [article] Installing 5.8.0 on Jaguar
On Thursday, August 29, 2002, at 11:19 AM, Morbus Iff wrote: True. If Apple updated their Perl in the same way as in the past, /usr/bin/perl (which, per the article, is a copy of the same Perl installed in /usr/local/bin/perl) would be wiped out. That new binary would also reenable /System/Library/Perl support. If the Apple install is wipe/replace, then it would also trash your installed modules under /Library/Perl. Hm, actually, I think it should leave /Library/Perl alone. But it can and will foul up any modules installed by the Perl 5.8.0 installer in /System/Library/Perl. That'd only be the case if the user was running the scripts under mod_perl - normal CGI scripts won't be affected. Duh, oh yeah. I always forget about CGI, since I always either use mod_perl or, in a pinch, Apache::Registry. But you're right, CGI will invoke your command-line Perl. David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://david.wheeler.net/ Yahoo!: dew7e Jabber: [EMAIL PROTECTED]
Re: [article] Installing 5.8.0 on Jaguar
On Thursday, August 29, 2002, at 11:51 AM, Morbus Iff wrote: The article, as written, will create a Perl that totally ignores the /System/Library/Perl directory, so that no new modules will be installed into there during a CPAN or four-command-salute. Doesn't the Perl installer put stuff there itself? # Where to put modules. privlib='/System/Library/Perl'; sitelib='/Library/Perl'; vendorlib='/Network/Library/Perl'; IIRC, Perl will install the modules that it comes with in privlib. Check the version number of ExtUtils::MakeMaker or something in /System/Library/Perl to see which Perl it belongs to. David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://david.wheeler.net/ Yahoo!: dew7e Jabber: [EMAIL PROTECTED]
Re: [article] Installing 5.8.0 on Jaguar
Doesn't the Perl installer put stuff there itself? # Where to put modules. privlib='/System/Library/Perl'; sitelib='/Library/Perl'; vendorlib='/Network/Library/Perl'; IIRC, Perl will install the modules that it comes with in privlib. Check the version number of ExtUtils::MakeMaker or something in /System/Library/Perl to see which Perl it belongs to. That's only if you use a prefix of /usr. Check your hints/ darwin.sh file, which I snippet in the article: # Default install; use non-system directories prefix='/usr/local'; # Built-in perl uses /usr siteprefix='/usr/local'; vendorprefix='/usr/local'; usevendorprefix='define'; # Where to put modules. privlib='/Library/Perl'; # Built-in perl uses /System/Library/Perl sitelib='/Library/Perl'; vendorlib='/Network/Library/Perl'; Or, with the /usr prefix: # I'm building/replacing the built-in perl siteprefix='/usr/local'; vendorprefix='/usr/local'; usevendorprefix='define'; # Where to put modules. privlib='/System/Library/Perl'; sitelib='/Library/Perl'; vendorlib='/Network/Library/Perl'; -- Morbus Iff ( i'm the droid you're looking for ) Culture: http://www.disobey.com/ and http://www.gamegrene.com/ Please Me: http://www.amazon.com/exec/obidos/wishlist/25USVJDH68554 icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
Re: Accessing USB Port
I've asked this Accessing USB Port question a couple of times here and so have a few others. Well, thanks to Joe Zobkiw I've finally been able to access my Garmin GPS data output with my Indigo iBook using the USB port with a KeySpan USB PDA Adapter. Joe has a script called Perl GPSx that he provides at: http://home.earthlink.net/~zobkiw/ It looks as this method will work with other devices as well. I should also send a Thanks to Curt Mills and Peter N. Lewis whom Joe mentions in his script. Thanks again! -- Bill Stephenson www.SecureShopper.com 1-417-546-5593 From: Bill Stephenson [EMAIL PROTECTED] Date: Tue, 25 Jun 2002 11:12:31 -0500 To: [EMAIL PROTECTED] Subject: Accessing USB Port Does anyone know how to access a Garmin GPS (eMap) through a USB port on an indigo iBook running OS X? Or for that matter, anything on a USB port?
Bundle::Xmms
I have installed Bundle:Xmms, and I'm pretty sure it went okay. Going to read n/sources/modules/03modlist.data.gz Term::ReadKey is up to date. Term::ReadLine::Perl is up to date. Term::ANSIColor is up to date. MPEG::MP3Info is up to date. Xmms is up to date. But, when I try to use it, I get error messages like this: Perl error: Can't locate auto/Xmms/Remote/get_playlis.al in INC(INC contain: /sw/lib/perl5/darwin /sw/lib/perl5 /sw/lib/perl5/darwin /sw/lib/perl5 /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin /Library/Perl /Library/Perl /Network/Library/Perl/darwin /Network/Library/Perl /Network/Library/Perl .) at (eval 59) line 13 [hildrum:~/] tor% cd /Library/Perl/darwin/auto/Xmms/Remote [hildrum:auto/Xmms/Remote] tor% ls Remote.bs Remote.bundle Here is the code: $xmms_remote = Xmms::Remote-new(); sub xmms { $title = $xmms_remote-get_playlist_title; $artist = $xmms_remote-get_playlist_artist; $song = $xmms_remote-get_playlist_song; $time = $xmms_remote-get_playlist_time; print ...; } Anyone used this module, or have any answers/hints? Tor
Error returns?
(dammit, I *will* get this address right some day) Is there a generally accepted spot to return error codes from XS modules? If this were VMS I'd just stick 'em in $^E, but that's a no go for OS X. -- Dan --it's like this--- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk
Re: Error returns?
On Thursday, August 29, 2002, at 01:40 PM, Dan Sugalski wrote: (dammit, I *will* get this address right some day) Is there a generally accepted spot to return error codes from XS modules? If this were VMS I'd just stick 'em in $^E, but that's a no go for OS X. I'm no p5p, but wouldn't it simply be the same as for any other Unix, esp. FreeBSD? David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://david.wheeler.net/ Yahoo!: dew7e Jabber: [EMAIL PROTECTED]
Re: [article] Installing 5.8.0 on Jaguar
On Thursday, August 29, 2002, at 01:46 PM, Nathan Torkington wrote: Not for the vast majority of Apple users, IMO. If we want people to experiment with Perl and mod-perl and all that good stuff, we need to deliver it to them in as convenient a package as possible. and this is where linux has failed! There does ned to be a concerted effort to make things simple. ActiveState made Perl easy on Windows, and I learned things from there. I am all for everyone knowing how to configure, make, make test, install but maybe they can learn that AFTER they've been able to do some useful things... -- The price of freedom is eternal vigilance. -- Thomas Jefferson [EMAIL PROTECTED] (OS X)
Applescript execution
Folks, I just threw together a quick module to directly execute Applescript code from within perl without shelling out or anything nasty like that. It should be on its way to CPAN now, and show soonish as $CPAN/authors/id/D/DS/DSUGAL/Mac-AppleScript-0.01.tar.gz. Or, if you're really impatient, ftp://ftp.sidhe.org/Mac-AppleScript-0.01.tar.gz. (Be kind, I'm behind a slowish link) Note that this is really alpha code--it's all compile and go, with no precompilation, caching, or good error handling. Maybe for tomorrow. -- Dan --it's like this--- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk
Re: [article] Installing 5.8.0 on Jaguar
On Friday, August 30, 2002, at 03:56 AM, John Siracusa wrote: Anyway, I guess it'd be good to have a simple point-and-click upgrade to 5.8.0. I think there are a couple different things that would be good. One is a fink package, another is the Apple installable bundle. I myself would probably prefer a fink package, so I could have the benefits of a package manager tracking things. I think many people wouldn't even want to bother with that, though, and they'd prefer a mousey thing. I've been meaning to create a fink package myself, but I haven't found the time yet. -Ken
Scrooched the pooch :(
I installed Fink awhile back and I think I did something weird in the process. Fink works fine, but I don't know where it's putting stuff when it installs it. I did a fink install gd and it did install it, but when I run gd_example.cgi I get the error Can't locate GD.pm in INC. I had thought I messed up by not doing the install from the root user account so I tried su root and then fink install gd again, but this just returned a message of No packages to install. I figure that GD must be there and ready to work for me, but I don't know how to tell the gd_example.cgi where to find it. Could someone please help me overcome this blunder? -- Bill Stephenson
Re: Mac::AppleScript fixed
On Thursday, August 29, 2002, at 06:40 PM, Dan Sugalski wrote: Okay, now we properly return undef on error and set $@ to the error code. Chattiness has been removed, and there's a proper export of the sub that does the Applescript call. At some point I'll add the separate compile and run subs, but until then... Um, now that I think about this, why not croak with the error, and let folks eval their calls. Better exception handling, that way. David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://david.wheeler.net/ Yahoo!: dew7e Jabber: [EMAIL PROTECTED]
Re: mac X+ perl where is the web folder
I am working on MAC OS X and Perl + Apache2.0. I used to use Asp + IIS. Would you please help me. 1)Where is web folder of apache2.0 under os X? Apache 2.0? Has Jaguar moved that far ahead? It seems related with /usr/local/apache2.0 /usr/local? Is Apple using that now? I'm thinking I'm remembering apache (1.?) in one of those Library directories, so you could look at the executable with the GUI, even though you can't look at the configuration with the GUI. ,but I cannot copy a file into it or construct a folder using mkdir. Well, that's probably because you are smart and not loggin in as root. Now, all you need to do is enable root login just long enough to edit the sudoers file (Wasn't that in /etc somewhere?) and that kind of thing. 2)Should I copy .pl file into /usr/local/apache2.0/ cgi-bin in order to use cgi in perl? I have the idea that the default httpd.conf actually allows you to have cgi-bins for each user. Am I off base on that? 3) Can you give me some documents or hypertext link about web-publishing using apache and perl ? It's been a while since I looked that sort of stuff up. Try google: http://www.google.com Maybe plug in something like web-publishing apache perl example. -- Joel Rees [EMAIL PROTECTED]
Re: mac X+ perl where is the web folder
On Thursday, August 29, 2002, at 02:53 PM, liming zhao wrote: I am working on MAC OS X and Perl + Apache2.0. I used to use Asp + IIS. If you have Apache 2 that means you (or someone else on that machine) installed it. Apache 2 does not come with OS X. If you installed it you probably know where you installed it. Would you please help me. 1)Where is web folder of apache2.0 under os X? It seems related with /usr/local/apache2.0 yup... that is where it is installed. Except it depends on many other parts that are scattered here and there. For example, /etc/httpd/ contains the conf files, at least in the stock apache install. Search for httpd.conf. Open it in a text editor and you will see where everything is installed. Alternatively, find httpd (the actual program, the http daemon) and do a 'httpd -V' on it get all manner of info on your apache. ,but I cannot copy a file into it or construct a folder using mkdir. use sudo... for example, % sudo mkdir somedir sudo will prompt you for your password, and will remain valid for a few minutes. 2)Should I copy .pl file into /usr/local/apache2.0/ cgi-bin in order to use cgi in perl? yes, but you will have to activate .pl extension for cgi in your httpd.conf file. 3) Can you give me some documents or hypertext link about web-publishing using apache and perl ? yes, go to www.macdevcenter.org and read all 5 or so excellent articles by Kevin Hemenway on this subject. He goes by the name Morbus, so the author may be listed as Morbus. Also, read the articles on developer.apple.com/internet
Re: Mac::AppleScript fixed
On Friday, August 30, 2002, at 12:42 PM, Dan Sugalski wrote: Yech. Potentially fatal errors should be thrown only for potentially fatal things. Failure to compile a script doesn't strike me as a life or death kinda thing. (But, then, I'm not really a 'wrap it in an eval' kind of programmer. It looks nasty in perl 5. Maybe in perl 6...) Speaking from the point of view of a wrap it in an eval programmer: the point behind exceptions is that the code itself can't know what's fatal and what's not fatal. That kind of decision is dependent on the context. All the code can do is determine whether a function/method can properly do its job. Anyway, that's why I prefer using exceptions, and why if Mac::AppleScript were my code I'd probably make it die(). Otherwise all the programs that use it are probably going to do compile_function() or die Couldn't compile: $; anyway, and that seems poorly Huffman coded (to steal a metaphor). -Ken
Re: Mac::AppleScript fixed
On Thursday, August 29, 2002, at 09:48 PM, Dan Sugalski wrote: Right, which is why I'd call it like: if (!do_script_thingie()) { print $some_error_message_or_other, $@, \n; next; } Over and over again for every function call? Sheesh, kids these days with their newfangled exceptions, and objects, and whatnots. I just don't know what the world's coming to. What's next? The Polka Dot Design Pattern? :) That's in Perl 6, too. It's called the C... operator. ;-) Anyway, I threw this together as much because Nat wanted it as anything else. Since it's likely to languish in Maintenance Purgatory once I'm done fiddling, you're welcome to take the thing on. Heh. I suppose we deserved that :-) David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 http://david.wheeler.net/ Yahoo!: dew7e Jabber: [EMAIL PROTECTED]
Re: Mac::AppleScript fixed
In article [EMAIL PROTECTED], David Wheeler [EMAIL PROTECTED] wrote: On Thursday, August 29, 2002, at 09:48 PM, Dan Sugalski wrote: Right, which is why I'd call it like: if (!do_script_thingie()) { print $some_error_message_or_other, $@, \n; next; } Over and over again for every function call? shouldn't the application programmer get to decide that? the module doesn't know enough about what the programmer is doing to make those sorts of decisions.