Re: Net:DNS on Panther

2003-10-21 Thread Chris Reinhardt
On Mon, 20 Oct 2003, Lon Baker wrote:

 I get the following error:

 cc -c   -g -pipe -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp
 -fno-strict-aliasing -I/usr/local/include -Os   -DVERSION=\0.41\
 -DXS_VERSION=\0.41\
 -I/System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE   DNS.c
 DNS.xs: In function `XS_Net__DNS__Packet_dn_expand_XS':
 DNS.xs:58: error: `MAXDNAME' undeclared (first use in this function)
 DNS.xs:58: error: (Each undeclared identifier is reported only once
 DNS.xs:58: error: for each function it appears in.)
 make: *** [DNS.o] Error 1


Looks like panther has an odd resolv.h.  I'll take a look once I get a
copy of panther.  In the meantime, you can configure the package with:

  perl Makefile.PL --pm

and skip the XS bits.

Chris (the Net::DNS maintainer).

-- 
Chris Reinhardt -- [EMAIL PROTECTED] -- http://www.dyndns.org/
We had gay burglars the other night. They broke in and rearranged the
furniture.
--Robin Williams


Re: Cron Progress Bar in OSX

2003-10-21 Thread Alan Fry
On Monday, Oct 20, 2003, at 17:03 Europe/London, Chris Nandor wrote:

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Thane Norton) wrote:
One of my personal favorites is to use a here document to supply 
the code
for an applescript via osascript.  i.e.

my $script = 'APPLESCRIPT';
tell application Finder
display dialog Hello World
end tell
APPLESCRIPT

local *script_to;
local *script_from;
local *script_error;
my $pid = open3(*script_to, *script_from, *script_error,
/usr/bin/osascript) or die Couldn't open osascript;
print script_to $script;
close script_to;
A much more efficient method would be to use one of the XS AppleScript
methods, including MacPerl::DoAppleScript() in Mac::Carbon, 
applescript() in
Mac::OSA::Simple (requires Mac::Carbon), and RunAppleScript from
Mac::AppleScript.
Also system('open', applescript.app) seems to run a tad faster (?) 
than RunAppleScript although it is not AFAIK possible to take Perl 
variables into and out of AS that way.

In passing I suspect a minor bug with RunAppleScript: in the example 
given the Perl script dies even thought the AppleScript succeeds.

Coming back to the original question in this thread: CronniX is a 
very nice application which one would be hard pushed to better.

'CamelBones' looks attractive for the kind of GUI one used to be able 
to do so easily with MacPerl. I have not found any documentation apart 
from the three How To's on the CB site. Can anyone help?

Alan Fry



Re: Using on non-filehandles

2003-10-21 Thread Randal L. Schwartz
 Nicholas == Nicholas Thornton [EMAIL PROTECTED] writes:

Nicholas I've looked at various templating modules on CPAN. The
Nicholas reason I'm writing my own is because the templating
Nicholas modules I've seen on CPAN are either too robust (undue
Nicholas increase in loading time), or don't have the features
Nicholas I want, or both. I'm also writing it to try my hand at
Nicholas coding things I haven't done before, or in ways I
Nicholas haven't done before.

While that's an admirable goal, allow me to challenge that on
a few points.

If you cache the generated Perl code, Template-Toolkit is hard to
beat.  Will you be caching your parse of your templates?

Also, there's a feature-creep in all templating systems.  Initially,
you don't need nested loops.  But then, you do.  So you strap it on.
And then you want subroutines from others files, so you strap that on.
Oh yeah, and arrays would be nice, as would nested hashes.  More
hacking.

But it's worse than that.  *You* may not need those features, but you
upload *your* templating system to the CPAN, and then I download it
and use it, and I find that *I* do.

So, in the way that all internet apps eventually evolve to where they
can read email, similarly all templating systems evolve to where they
look a lot like Template Toolkit.

Finally, I'm already familiar with TT, and there's a lot of literature
on it (including a forthcoming book), and a very active support
community.  If you don't choose TT, you lose that leverage.  (I
could make the same argument for HTML::Mason as well.)

Please, carefully consider what you're giving up by starting from
scratch.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Apache::Scoreboard trouble

2003-10-21 Thread Ray Zimmerman
At 8:01 PM +0100 10/20/03, Michael Chamberlain wrote:
On Monday, October 20, 2003, at 07:47  pm, Ray Zimmerman wrote:

At 7:16 PM +0100 10/20/03, Michael Chamberlain wrote:
Which leads me to conclude you can't use Apache::Scoreboard 
outside of a modperl1/apache1 environment.

Try writing an apache handler using it, rather than a perl script.
That can't be the problem either ... the same script runs just fine 
on a Linux box with the same versions of everything.

It is. Linux doesn't attempt to resolve everything at link time, 
only when the function is actually used. Darwin attempts to resolve 
everything as the program links, causing the error.
You are right, of course. I was responding to the you can't use 
Apache::Scoreboard outside of a modperl1/apache1 environment. I 
guess this is true on some platforms, but it was working on Linux and 
I thought it was intended to work outside mod_perl since the SYNOPSIS 
section of the POD specifically says ...

 #outside httpd
 my $image = Apache::Scoreboard-fetch(http://localhost/scoreboard;);
Maybe you could try building it statically.
OK. How can I do this?

BTW, it does load fine in a mod_perl environment, but appears there 
are some byte ordering issues or something ... when I attempt to 
access it from a script on my Linux box I get something like ...

-1608318976 : _ 167772160 7214202.88 GET 
/admin/phpMyAdmin-2.5.4-rc1/left.php?lang=en-iso-8859-1ser
-1574764544 : K 50331648 671088.64 GET /icons/blank.gif HTTP/1.1
-1557987328 : K 33554432 0.00 GET /icons/back.gif HTTP/1.1
-1541210112 : _ 100663296 5536481.28 GET /scoreboard HTTP/1.1
-1524432896 : K 50331648 1342177.28 GET /icons/folder.gif HTTP/1.1
-1507655680 : W 33554432 4697620.48 GET /scoreboard HTTP/1.1
-1490878464 : _ 33554432 167772.16 GET 
/admin/phpMyAdmin-2.5.4-rc1/images/pma_logo.png HTTP/1.1

... as opposed to the following, which comes from fetching the image 
from the server on the Linux box.

 13802 : _  0 0.00
 13803 : _  0 0.00
 13804 : _ 44 0.23 GET /matpower/ HTTP/1.1
 13805 : _132 1.15 GET /robots.txt HTTP/1.1
 13806 : _129 2.41 GET /powerweb/papers/HICSS97.pdf HTTP/1.1
 19153 : _ 74 2.83 GET /powerweb/ HTTP/1.1
 19154 : _ 72 0.34 GET /tcc/pix/TCCalculator.gif HTTP/1.0
 19155 : _107 0.75 GET /default.css HTTP/1.1
 19184 : _ 63 2.61 GET /matpower HTTP/1.0
 19474 : W113 0.44 GET /scoreboard HTTP/1.1
 19544 : .  0 0.00
 19545 : .  0 0.00
 19546 : .  0 0.00
The script I'm using is ...

#!/usr/bin/perl -w

use strict;
use Apache::Scoreboard;
my $image = Apache::Scoreboard-fetch(http://localhost/scoreboard;);

for (my $parent = $image-parent; $parent; $parent = $parent-next) {
my $pid = $parent-pid; #pid of the child
my $server = $parent-server; #Apache::ServerScore object
printf(%6d : %s %6d %8f %s\n, $pid, $server-status,
$server-access_count, scalar $server-times, $server-request);
}
1;

--
 Ray Zimmerman  / e-mail: [EMAIL PROTECTED] / 428-B Phillips Hall
  Sr Research  /   phone: (607) 255-9645  /  Cornell University
   Associate  /  FAX: (815) 377-3932 /   Ithaca, NY  14853


iTunes and RMP

2003-10-21 Thread drieux


ok, here is the basic problem. myFascistHouseMate finally
broke down and installed a CD-Rom burner on his PC box, so
that he could have things like Mercedes Benz mixed down
with other Janis, CCR, et al music that he could load up
in his Merdeces 400 Series. He has also installed the
iTunes for his PC. But the CD rom he burned does not
have 'the play list' 'on it' to keep track of the
details about which track is from which artist from
the days of Governor Ronald Reagan.
He just sent me the RMP file that is an xml document
but there appears to be no simple and easy way to
co-locate that information with the tracks once I
import them off the CD. Is there an easy way to fix this?
ciao
drieux
---



Is Tk installed on Panther?

2003-10-21 Thread philippe
Hello,

does anyone know if Tk.pm is installed by default on Panther? 
Does Perl/Tk work smoothly with the new built-in X11 server? 

Cheers,

Philippe


Re: Using on non-filehandles

2003-10-21 Thread Nicholas Thornton
--- Thilo Planz [EMAIL PROTECTED] wrote:
 Okay, in that case you probably know what you are
 doing.

Sometimes I like to think so ;)  Yeah, If I'm looking
for how to do X the first place I look is usually
CPAN; If I know how to do it I'll sometimes still look
on CPAN. One of the things that's kept me from using
modules on CPAN is that until recently I've had a poor
grasp on OOP in Perl, and many OO modules are... ill
defined unless you're quite fammiliar with the jargon.

I'll take a look at Template-Toolkit to see if it
meets my needs. Right now the two biggest features I'm
looking for are (1) accepting functions for values
(i.e. accepting the return of get() as a valid thing
to interpolate); this way the actual variables etc are
hidden behind a black box in case I want to change
them, and (2) being able to parse a single file into
multiple sections (header, footer, etc) so that I can
do something akin to print header; for(){print
entry} print footer; as well as other combinations.
The module I've got so far takes text, and splits it
based on Begin/EndSection metalanguage and when
interpolating it runs eval on anything between
Begin/EndPerl metalanguage; so far this works well
enough.

cheers,
~wren

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


Re: Using on non-filehandles

2003-10-21 Thread Nicholas Thornton

--- Randal L. Schwartz [EMAIL PROTECTED]
wrote:
 While that's an admirable goal, allow me to
 challenge that on
 a few points.

will take a look at Template-Toolkit/

Does it change matters if I point out that I'm not
intending to publish the module, but rather just use
it for personal convenience? (There are a few programs
I'm going to write to generate different parts of my
website from databases, and they'll all be basically
the same xml2html interface. I'm not sure if I brought
this up in a previous mail or not.)

But yes, there definately is feature creep. That's
actually one of the reasons I'm flat out scratching
the old version of the program (which was much
ammended) and rewriting it from scratch with a new
approach. One part of this new approach is making it
so that all the calls for data run through the black
box get(); that way, if I decide to use a different
XML module, or decide to rearrange variables, or
rename them, or whatever, that doesn't affect the
templates at all, and doesn't affect many parts of the
program outside of that subroutine.

cheers,
~wren

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com