Re: Getting DBD-Sybase to work
I got DBD-Sybase working OK, but did need to set additional environment variables - both when compiling and when running the script. Here is the block I have at the beginning of my Perl script that seems to work just fine: BEGIN { $ENV{SYBASE}= '/Applications/Sybase/System'; $ENV{SYBASE_OCS}= 'OCS-12_5'; $ENV{SYBASE_ASE}= 'ASE-12_5'; $ENV{SYBASE_SYSAM} = 'SYSAM-1_0'; } ISTR that I set these prior to compiling from the command line and it compiled OK. Good luck! Dan At 10:59 PM -0500 1/14/04, gohaku wrote: Hi everyone, I just installed Sybase ASE 12.5.1 on OS X v10.3.2 and am trying to Install the DBD-Sybase-1.02 module. When I tried to install said module, I got back the following: Please set SYBASE in CONFIG, or set the $SYBASE environment variable at Makefile.PL line 93, IN line 44. I then tried: setenv SYBASE /Applications/Sybase/System/ASE-12_5/ perl Makefile.PL and got back the following: Can't find the lib or include directories under /Applications/Sybase/System/ASE-12_5/! at Makefile.PL line 102, IN line 44. I also read the article: Sybase for Mac OS X (http://www.oreillynet.com/pub/wlg/1693) to see if that could help me but I couldn't even login as Superuser. Does anybody know what I'm doing wrong? Thanks in advance. -Gohaku
Perl calling AppleScript
I just saw this on the AppleScript mailing list. John is probably not a member of this list but I'll bet someone here can help off list. Isn't there a module available? To: [EMAIL PROTECTED] From: John DeYoung [EMAIL PROTECTED] Begin copy Apologies for being a little off-topic... I've inherited a Perl script with a few routines invoking AS commands which, being written a couple of years ago, expects to make the calls through MacPerl. Needless to say, it breaks under OS X, but the client still wants to use it. As you'll soon figure out, my Perl is pretty much limited to spelling its name correctly, so I may be up against something trivial, but does anyone know how I can rewrite the MacPerl calls to run straight through the included Perl under OS X? The operative sections all look like this: { MacPerl::DoAppleScript(END_SCRIPT); tell application $myApp [...] end tell END_SCRIPT } Thanks in advance, -John DeYoung End copy -- -- There are 10 kinds of people: those who understand binary, and those who don't --
Re: perl in /usr/bin
At 12:57 +0100 1/15/04, Stephan Hochhaus wrote: ps: How can I find out if a file is just a link from this: -rwxr-xr-x 2 root wheel 19944 24 Sep 09:00 perl try cd /usr/bin file perl or man file -- -- There are 10 kinds of people: those who understand binary, and those who don't --
perl tags in vim/vi?
Hello, I'd like to start using tags in vim. Google shows that there is a ptags and a perltags script for creating the tags file and the vim docs indicate that tags are supported. It doesn't appear to be too difficult to create the tags file. QUESTION: What do vim-tag-users use? Or is there a better vi/vim tool? (I don't want to switch to a different editor - sorry) Thanks, Warren
Re: Perl calling AppleScript
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Doug McNutt) wrote: I just saw this on the AppleScript mailing list. John is probably not a member of this list but I'll bet someone here can help off list. Isn't there a module available? Yep. A few. I've inherited a Perl script with a few routines invoking AS commands which, being written a couple of years ago, expects to make the calls through MacPerl. Needless to say, it breaks under OS X, but the client still wants to use it. As you'll soon figure out, my Perl is pretty much limited to spelling its name correctly, so I may be up against something trivial, but does anyone know how I can rewrite the MacPerl calls to run straight through the included Perl under OS X? The operative sections all look like this: { MacPerl::DoAppleScript(END_SCRIPT); tell application $myApp [...] end tell END_SCRIPT } Thanks in advance, -John DeYoung The module you want is MacPerl. Yes, really. :-) It is included as part of the Mac-Carbon distribution for Mac OS X, which includes the MacPerl.pm module, and others that were formerly for Mac OS only. Other options include Mac::AppleScript with its RunAppleScript() function (that module was written before MacPerl.pm was ported to Mac OS X); and Mac::OSA::Simple, which is a more generic interface to OSA languages, and had an applescript() function. It also provides a way to compile an AppleScript for executing multiple times, or saving to disk, and can load compiled scripts from disk to execute. All three functions -- DoAppleScript(), RunAppleScript(), and applescript() -- function in essentially the same way. DoAppleScript() allows the most compatibility with MacPerl scripts. applescript() doesn't have significant advantages in its basic form, as it requires Mac-Carbon anyway, but offers some extra control. RunAppleScript()'s only real advantage, that I know of, is that it takes less to install, as Mac-Carbon is a fairly large and powerful distribution, and Mac-AppleScript just does this one thing. There is also calling osascript directly using ``, but that is more error prone and has no benefits of its own, apart from not needing to install additional modules. I personally don't consider that a significant benefit. If you are concerned about performance, all are suitable for most tasks, except for `osascript`. I ran some Jaguar benchmarks once (http://www.nntp.perl.org/group/perl.macperl/2748), and here's the result under Panther: #!/usr/bin/perl use strict; use warnings; use Benchmark qw(timethese cmpthese); use Mac::AppleScript 'RunAppleScript'; use MacPerl 'DoAppleScript'; use Mac::OSA::Simple 'applescript'; my $script = 'tell application Finder to get name of startup disk'; my %tests = ( applescpt = sub { applescript($script) }, doscript = sub { DoAppleScript($script) }, runscript = sub { RunAppleScript($script) }, osascript = sub { `osascript -ss -e '$script'` } ); my $results = timethese(500, \%tests); cmpthese($results); = Benchmark: timing 500 iterations of applescpt, doscript, osascript, runscript... applescpt: 4 wallclock secs ( 1.70 usr + 0.29 sys = 1.99 CPU) @ 251.26/s (n=500) doscript: 2 wallclock secs ( 1.11 usr + 0.18 sys = 1.29 CPU) @ 387.60/s (n=500) osascript: 240 wallclock secs ( 0.17 usr 2.34 sys + 108.88 cusr 48.57 csys = 159.96 CPU) @ 199.20/s (n=500) runscript: 21 wallclock secs ( 6.22 usr + 6.91 sys = 13.13 CPU) @ 38.08/s (n=500) Rate runscript osascript applescpt doscript runscript 38.1/s-- -81% -85% -90% osascript 199/s 423%-- -21% -49% applescpt 251/s 560% 26%-- -35% doscript 388/s 918% 95% 54%-- = As noted previously: I don't know why RunAppleScript is a bit slower, and osascript is slower because it needs to call out to the shell. The comparison table is deceptive for osascript because it only shows usr+sys, not the rest. Summary: I recommend installing Mac-Carbon, adding use MacPerl; to the script, and using it as-is. If you don't want to install all of Mac-Carbon, Mac-AppleScript is your best bet. Stay away from osascript. Cheers, -- Chris Nandor [EMAIL PROTECTED]http://pudge.net/ Open Source Development Network[EMAIL PROTECTED] http://osdn.com/
Re: perl in /usr/bin
At 12:57 pm +0100 15/1/04, Stephan Hochhaus wrote: is the file /usr/bin/perl just a link to /usr/bin/perl5.8.1 and could therefore easily replaced by /usr/local/bin/perl5.8.2 (as an example)? Or would that break anything? Provided you install the later version in Apple's default location, /usr/bin/perl will be overwritten with perl 5.8.2, 5.8.3 or whatever and will be identical to the latest installation. This is how things look in my directory: -rwxr-xr-x 2 root wheel987340 8 Jan 19:47 perl -rwxr-xr-x 1 root wheel987076 9 Nov 13:56 perl5.8.1 -rwxr-xr-x 1 root wheel 21924 18 Nov 10:14 perl5.8.2 -rwxr-xr-x 2 root wheel987340 8 Jan 19:47 perl5.8.3 I have upgraded always using the instructions here, opting always to replace the previous installation. Other people may have different preferences, but this has worked fine for me. http://developer.apple.com/internet/macosx/perl.html JD
Re: perl tags in vim/vi?
On Thu, 15 Jan 2004, Warren Pollans wrote: QUESTION: What do vim-tag-users use? Or is there a better vi/vim tool? (I don't want to switch to a different editor - sorry) I forwarded this to a Perl/Vim using friend. This was his response: On Thu, 15 Jan 2004, darren chamberlain wrote: * Chris Devers cdevers at pobox.com [2004/01/15 15:21]: You don't have an opinion on this, do you? Sure I do. Both ctags and etags have perl related options, so either should be usable. vim can handle the output of both (tags and TAGS), so it comes down to, basically, whichever the user prefers. I think exuberant ctags is the better of the two; see http://ctags.sourceforge.net/. Helpful? -- Chris Devers
Re: perl tags in vim/vi?
At 10:29 AM -0500 1/15/04, Warren Pollans wrote: Hello, I'd like to start using tags in vim. Google shows that there is a ptags and a perltags script for creating the tags file and the vim docs indicate that tags are supported. It doesn't appear to be too difficult to create the tags file. QUESTION: What do vim-tag-users use? Or is there a better vi/vim tool? (I don't want to switch to a different editor - sorry) I have this running in my crontab. I use vim. 0 3 * * * zsh -c 'cd ~;~/bin/pltags.pl (list of wildcards)' My pltags is a slightly modified version of the original (with Embperl support added). # pltags - create a tags file for Perl code, for use by vi(m) # # Distributed with Vim http://www.vim.org/, latest version always available # at http://www.mscha.com/mscha.html?pltags#tools # -- Kee Hinckley http://www.messagefire.com/ Next Generation Spam Defense http://commons.somewhere.com/buzz/ Writings on Technology and Society I'm not sure which upsets me more: that people are so unwilling to accept responsibility for their own actions, or that they are so eager to regulate everyone else's.
Problem with PDL isntallation
If just installed PDL::Core and am getting this error when I try to use it. The Core directory and Core.pm module are in the path and yet Im getting this error. What am I doing wrong? use PDL; Can't locate PDL::Core in @INC (@INC contains print join $/, @INC ; /System/Library/Perl/5.8.3/darwin-2level /System/Library/Perl/5.8.3 /Library/Perl/5.8.3/darwin-2level /Library/Perl/5.8.3 /Library/Perl/5.8.2/darwin-2level /Library/Perl/5.8.2 /Library/Perl/5.8.1/darwin-2level /Library/Perl/5.8.1 /Library/Perl /Network/Library/Perl/5.8.3/darwin-2level /Network/Library/Perl/5.8.3 /Network/Library/Perl . eremita:/Library/Perl/5.8.3/darwin-2level/PDL jd$ ls -l | grep Core drwxr-xr-x 10 root admin 340 15 Jan 20:49 Core -r--r--r-- 1 root admin 72064 15 Jan 20:28 Core.pm eremita:/Library/Perl/5.8.3/darwin-2level/PDL jd$
Perl/MacPerl on MacOS X
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
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
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
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
Subject: Re: Problems compiling Data::Dumper - `UTF8_ALLOW_ANY' undeclared
Hi, Thanks for the replies, but I'm still having problems. On Friday, January 9, 2004, at 08:55 PM, Ken Williams wrote: On Friday, January 9, 2004, at 04:24 PM, Doug Weathers wrote: This is annoying, because this is the problem that made me decide to reinitialize the laptop! Yow! Maybe if you had posted here first, we could have spared you that inconvenience. Reinitializing the laptop wasn't necessary (as I'm sure is clear with the benefit of hindsight!). Well, it wasn't the only problem, and I didn't yet know about this list. This particular laptop has been upgraded from OS 9 to X 10.0 to X 10.1 to X 10.2 without ever being reinitialized, so I figured it was about time :) I can't upgrade CPAN, because it depends on an up-to-date Data::Dumper. Hmm? CPAN.pm depends only on File::Spec and Test::More, and will accept any version of them. Hmm indeed. My system seems to want all sorts of stuff to do an install Bundle::CPAN. I just tried to do an install Bundle::CPAN, and the following happened. I have a full transcript for anyone who is interested. 1) it downloaded and unpacked CPAN-1.76.tar.gz 2) it downloaded and unpacked Digest-MD5-2.33.tar.gz 3) it tried to build Digest-MD5-2.33.tar.gz and found a dependency (Digest::base), so it didn't install 4) it downloaded and expanded Compress-Zlib-1.32.tar.gz 5) it tried to build Compress-Zlib-1.32.tar.gz and failed 6 out of 23 tests (gzdopen), so it didn't install 6) it downloaded and unpacked Archive-Tar-1.08.tar.gz 7) this appeared to install correctly. Hooray! 8) it downloaded and unpacked Data-Dumper-2.121.tar.gz 9) it failed to compile, giving the UTF8_ALLOW_ANY undeclared error as described before 10) it started to build libnet-1.17 (I didn't see where this got downloaded) 11) I told it to use my previous settings for libnet 12) it detected a libnet dependency on Socket and failed to install 13) The bundle summary said that there were problems installing Data::Dumper 14) It downloaded and unpacked and installed TermReadKey-2.21.tar.gz (yay) 15) it downloaded, unpacked, and installed Term-ReadLine-Perl-1.0203.tar.gz (yay) 16) it started to build CPAN-1.76.tar.gz 17) bundle summary: Bundle::CPAN had problems with Digest::MD5 and Compress:Zlib 18) it started to build perl-5.8.2 (where did THAT come from?) At this point I gave up and wrote this message. I have another Mac where this command works just fine. The options for the cc command look rather different than the above. What does it look like on the one where it works? Maybe different versions of ExtUtils::MakeMaker or something? Here's what installing Data::Dumper looks like on the two computers. The bad one: /usr/bin/perl -I/System/Library/Perl/darwin -I/System/Library/Perl /System/Library/Perl/ExtUtils/xsubpp -typemap /System/Library/Perl/ExtUtils/typemap Dumper.xs Dumper.xsc mv Dumper.xsc Dumper.c cc -c -g -pipe -pipe -fno-common -no-cpp-precomp -flat_namespace -DHAS_TELLDIR_PROTOTYPE -fno-strict-aliasing -Os -DVERSION=\2.121\ -DXS_VERSION=\2.121\ -I/System/Library/Perl/darwin/CORE Dumper.c Dumper.xs: In function `Perl_utf8_to_uvchr': Dumper.xs:29: `UTF8_ALLOW_ANY' undeclared (first use in this function) Dumper.xs:29: (Each undeclared identifier is reported only once Dumper.xs:29: for each function it appears in.) Dumper.xs:29: warning: passing arg 2 of `Perl_utf8_to_uv' makes pointer from integer without a cast Dumper.xs:29: too many arguments to function `Perl_utf8_to_uv' make: *** [Dumper.o] Error 1 /usr/bin/make -- NOT OK Running make test Can't test without successful make Running make install make had returned bad status, install seems impossible cpan === The good one: === /usr/bin/perl /System/Library/Perl/ExtUtils/xsubpp -typemap /System/Library/Perl/ExtUtils/typemap Dumper.xs Dumper.xsc mv Dumper.xsc Dumper.c cc -c -pipe -fno-common -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -O3 -DVERSION=\2.121\ -DXS_VERSION=\2.121\ -I/System/Library/Perl/darwin/CORE Dumper.c cc1: warning: changing search order for system directory /usr/local/include cc1: warning: as it has already been specified as a non-system directory Running Mkbootstrap for Data::Dumper () chmod 644 Dumper.bs rm -f blib/arch/auto/Data/Dumper/Dumper.bundle LD_RUN_PATH= cc -flat_namespace -bundle -undefined suppress -L/usr/local/lib Dumper.o -o blib/arch/auto/Data/Dumper/Dumper.bundle chmod 755 blib/arch/auto/Data/Dumper/Dumper.bundle cp Dumper.bs blib/arch/auto/Data/Dumper/Dumper.bs chmod 644 blib/arch/auto/Data/Dumper/Dumper.bs /usr/bin/make -- OK Running make test PERL_DL_NONLAZY=1 /usr/bin/perl -MExtUtils::Command::MM -e test_harness(0, 'blib/lib', 'blib/arch') t/*.t t/dumper..ok t/overloadok t/pairok All tests successful. Files=3, Tests=373, 6 wallclock secs ( 1.95 cusr + 0.31 csys = 2.26 CPU) /usr/bin/make test -- OK Running make install Files found in blib/arch: installing files in