RE: rack you brains

2003-07-29 Thread Murray

just for reference
http://www.bbc.co.uk/cgi-bin/search/results.pl?q=pie&tab=www

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Nicholas Clark
> Sent: 29 July 2003 21:58
> To: [EMAIL PROTECTED]
> Subject: Re: rack you brains
> 
> 
> On Tue, Jul 29, 2003 at 08:01:41PM +0100, Jody Belka wrote:
> > On Tue, 29 Jul 2003, Nicholas Clark wrote:
> > > No. Altavista is best, based on searching for pie.
> > >
> > > Weeble and Bob 4th (and the old URL, dammit)
> > > http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=pie
> 
> > No. Google is best, again based on searching for pie.
> > 
> > Weeble and Bob 1st (old URL) and 2nd (new URL)
> > 
> http://www.google.co.uk/search?hl=en&ie=UTF-8&oe=UTF-8&q=pie&meta=
> cr%3DcountryUK%7CcountryGB
> 
> But you're only searching the UK. This is london.pm - we're not about
> London, and we're not about perl :-)
> 
> Nicholas Clark
> 
> 
> 
> 
> 



Re: interactive tests

2003-07-29 Thread David H. Adler
On Wed, Jul 30, 2003 at 05:50:34AM +0100, Struan Donald wrote:
> Hi,
> 
> If you don't want to read about Perl look away now.
> 
> In cases 

AH!  MY EYES!!!

:-)

-- 
David H. Adler - <[EMAIL PROTECTED]> - http://www.panix.com/~dha/
Freedom ain't nothing but a word, ain't nothing but a word.  Let me
see your ID.  - Gil Scott-Heron, "Johannesburg"



interactive tests

2003-07-29 Thread Struan Donald
Hi,

If you don't want to read about Perl look away now.

In cases where you require some information to perform a test (say a
database name, or login information) is there an accepted way of doing
it? More specifically is there some way I can ask for the information
and if I don't get a response in x seconds assume either defaults or
SKIP the test?

Also, where should I even ask the questions? Some use prompt in the
(Makefile|Build).PL and others their own prompt style routine in the
test itself.

or should I go subscribe to perl-qa[0] and ask there? ;)

And, yes, I'm aware I should probably try and avoid interactive tests
altogether but in this case there's no other way to get the
information I need.

cheers

s

[0] the archive of which didn't have much to say about interactive
tests.



Re: rack you brains

2003-07-29 Thread Nicholas Clark
On Tue, Jul 29, 2003 at 08:01:41PM +0100, Jody Belka wrote:
> On Tue, 29 Jul 2003, Nicholas Clark wrote:
> > No. Altavista is best, based on searching for pie.
> >
> > Weeble and Bob 4th (and the old URL, dammit)
> > http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=pie

> No. Google is best, again based on searching for pie.
> 
> Weeble and Bob 1st (old URL) and 2nd (new URL)
> http://www.google.co.uk/search?hl=en&ie=UTF-8&oe=UTF-8&q=pie&meta=cr%3DcountryUK%7CcountryGB

But you're only searching the UK. This is london.pm - we're not about
London, and we're not about perl :-)

Nicholas Clark




Re: multi-module packaging question

2003-07-29 Thread David Cantrell
On Tuesday, July 29, 2003 10:07 am +0100 Jo Walsh <[EMAIL PROTECTED]> wrote:

 i have a packaging question...
 i want to make an RDF::Simple package that will eventually have both
 Serialiser.pm and Parser.pm in it, but i'm not sure how to make a
package   for more than one module - so a user can 'install RDF::Simple'
and get  everything in it, including some utility modules. 'perldoc
perlnewmod'  isn't really helping me out much here.
Don't use h2xs!
DON'T USE H2XS!
Instead, find some other fine module which is packaged like what you want 
yours, and shamelessly steal from the Makefile.PL :-)

--
David Cantrell


Re: rack you brains

2003-07-29 Thread Jody Belka
On Tue, 29 Jul 2003, Nicholas Clark wrote:
> No. Altavista is best, based on searching for pie.
>
> Weeble and Bob 4th (and the old URL, dammit)
> http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=pie
>
> Weeble and Bob 3rd (also old URL)
> http://uk.search.yahoo.com/search/ukie?p=pie&ei=UTF-8&vm=i&n=20&fl=0&x=wrt&y=y
>
> Weeble and Bob 2nd and 3rd (both new URL)
> http://altavista.com/web/results?q=pie&kgs=0&kls=1&avkw=aapt&stq=10
>

No. Google is best, again based on searching for pie.

Weeble and Bob 1st (old URL) and 2nd (new URL)
http://www.google.co.uk/search?hl=en&ie=UTF-8&oe=UTF-8&q=pie&meta=cr%3DcountryUK%7CcountryGB


Jody




Re: Avoiding $1, $2, ...

2003-07-29 Thread Matt Lawrence
Jasper McCrea wrote:

Matt Lawrence wrote:
 

Jasper McCrea wrote:

   

Paul Makepeace wrote:

 

I'd like to dump regex matches into an array without explicitly naming
$1, $2, ...
=head1 NOT WORKING CODE
  ($month, $day, $time, $host, $process, $pid, $message) =
  /^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)\[(\d+)\]: (.*)$/ ||
  /^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)():\s+(.*)$/;
=cut
I.e. if the first regex fails, try the other one.



   

not tried, but if the first one fails, and produces nothing, why not just @a =
(//,//) ?
 

That'll probably get parsed as one big list. 
   

Uh-huh. It sure does. Yes. Indeed. That's the idea.

I see that now. :-) See below

Maybe without parenthesis
the , operator will be parsed properly.
   

Can you define 'properly' for me? :)

The (//,//) method works (for I have ever so briefly tested it).

Ah. I get you now.

I thought you were using the property of the , operator where the right 
operand is returned and the left operand evaluated and discarded. But 
that really doesn't make any sense at all ;-) I also thought that this 
behaviour was distinct from the list delimiter behaviour and therefore 
woudn't work with parentheses, but that's just plain wrong. At least I 
know that now :-)

Note to self: think, then post. ;-)

It's only a useful method if there isn't much overhead in doing the matches (and
in Paul's examples there isn't) and you always want the same number of matches.
If you were populating an array, rather than assigning to a list of variables,
you'd have to make sure if the first regex matched, the second wouldn't, and
vice versa. That might be too much trouble.
Works perfectly for the original example.

Horses for courses. TMTOWTDI. etc.

Matt




Re: Avoiding $1, $2, ...

2003-07-29 Thread Jasper McCrea
Matt Lawrence wrote:
> 
> Jasper McCrea wrote:
> 
> >Paul Makepeace wrote:
> >
> >
> >>I'd like to dump regex matches into an array without explicitly naming
> >>$1, $2, ...
> >>
> >>=head1 NOT WORKING CODE
> >>($month, $day, $time, $host, $process, $pid, $message) =
> >>/^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)\[(\d+)\]: (.*)$/ ||
> >>/^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)():\s+(.*)$/;
> >>=cut
> >>
> >>I.e. if the first regex fails, try the other one.
> >>
> >>
> >>
> >
> >not tried, but if the first one fails, and produces nothing, why not just @a =
> >(//,//) ?
> >
> That'll probably get parsed as one big list. 

Uh-huh. It sure does. Yes. Indeed. That's the idea.

> Maybe without parenthesis
> the , operator will be parsed properly.

Can you define 'properly' for me? :)

The (//,//) method works (for I have ever so briefly tested it).

It's only a useful method if there isn't much overhead in doing the matches (and
in Paul's examples there isn't) and you always want the same number of matches.
If you were populating an array, rather than assigning to a list of variables,
you'd have to make sure if the first regex matched, the second wouldn't, and
vice versa. That might be too much trouble.

Jasper



Re: Avoiding $1, $2, ...

2003-07-29 Thread Matt Lawrence
Jasper McCrea wrote:

Paul Makepeace wrote:
 

I'd like to dump regex matches into an array without explicitly naming
$1, $2, ...
=head1 NOT WORKING CODE
   ($month, $day, $time, $host, $process, $pid, $message) =
   /^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)\[(\d+)\]: (.*)$/ ||
   /^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)():\s+(.*)$/;
=cut
I.e. if the first regex fails, try the other one.

   

not tried, but if the first one fails, and produces nothing, why not just @a =
(//,//) ?
That'll probably get parsed as one big list. Maybe without parenthesis 
the , operator will be parsed properly.

My 2c:

my @foo;
for my $r (qr//, qr//, ...) {
 last if @foo = /$r/;
}
AFAIK, the || operator imposes scalar context on lists, so

   @list = @first || @second;

will most likely set $list[0] the length of @first or the length of @second.

Matt





Re: rack you brains

2003-07-29 Thread Nicholas Clark
On Mon, Jul 28, 2003 at 12:00:21PM +0100, Simon Wistow wrote:
> Of the many cool features (well, I think they're cool. Please leave any
> "Google 0wnZ! Y4h00! is d4 sUXz" arguments firmly out of the way) one of

No. Altavista is best, based on searching for pie.

Weeble and Bob 4th (and the old URL, dammit)
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=pie

Weeble and Bob 3rd (also old URL)
http://uk.search.yahoo.com/search/ukie?p=pie&ei=UTF-8&vm=i&n=20&fl=0&x=wrt&y=y

Weeble and Bob 2nd and 3rd (both new URL)
http://altavista.com/web/results?q=pie&kgs=0&kls=1&avkw=aapt&stq=10

In other news, Gabor Szabo conclusively proved that london.pm is the
largest perl monger group (list size, number of messages, alcohol
consumption. He didn't show stats for Acme modules, but we're probably
winning there too)

Nicholas Clark



Re: Avoiding $1, $2, ...

2003-07-29 Thread Patrick Mulvany
On Tue, Jul 29, 2003 at 03:53:52PM +0200, Rafael Garcia-Suarez wrote:
> Paul Makepeace wrote:
> > I'd like to dump regex matches into an array without explicitly naming
> > $1, $2, ...
> > 
> > =head1 NOT WORKING CODE
> > ($month, $day, $time, $host, $process, $pid, $message) =
> > /^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)\[(\d+)\]: (.*)$/ ||
> > /^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)():\s+(.*)$/;
> > =cut
> > 
> > I.e. if the first regex fails, try the other one.
> 
> You can try to fiddle with $+ and/or $^N.
> Recent perl needed.
>

You can do something like :-

$data =~m/^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)\[(\d+)\]: (.*)$/;

my @data = map ((substr($data,$-[$_],$+[$_]-$-[$_])),(1..$#-));

see perlvar docs for an explaination of @+ and @- lastmatch start and end vars

Hope it helps

Paddy

 



Re: [ANNOUNCE] Happy 5th Birthday London.pm - Social Thurs 7th August

2003-07-29 Thread Bob Walker
On Tue, 29 Jul 2003, Alex McLintock wrote:

> At 14:17 29/07/03, Dave Cross wrote:
> >Actually, we _were_ in the downstairs bar for the first meeting.
> >
> >See  for photos
> >of fresh-faced youths.
> >
> >Dave..
>
> Goodness Me. Gidon Moont was a London Perl Monger? Gosh!

i certainly had an attack of small world syndrome when i saw that.

>
> He was ICSF chairman a few years after me. How many members of
> ICSF are in London.pm? must be loads adam, bob, me, gidon,
> phil, um, more I've forgotten.
>

we get everywhere. its a plot i tell you :)


-- 
Bob Walker
http://www.randomness.org.uk/
Alan Moore knows the score



Re: [ANNOUNCE] Happy 5th Birthday London.pm - Social Thurs 7th August

2003-07-29 Thread Alex McLintock
At 14:17 29/07/03, Dave Cross wrote:
Actually, we _were_ in the downstairs bar for the first meeting.

See  for photos
of fresh-faced youths.
Dave..
Goodness Me. Gidon Moont was a London Perl Monger? Gosh!

He was ICSF chairman a few years after me. How many members of
ICSF are in London.pm? must be loads adam, bob, me, gidon,
phil, um, more I've forgotten.
Alex

Available for java/perl/C++/web development in London, UK or nearby.
Apache FOP, Cocoon, Turbine, Struts,XSL:FO, XML, Tomcat, JSP
http://www.OWAL.co.uk/



Re: Avoiding $1, $2, ...

2003-07-29 Thread Dan Sugalski
At 14:52 +0100 7/29/03, Paul Makepeace wrote:
I'd like to dump regex matches into an array without explicitly naming
$1, $2, ...
Have you tried:

  (@foo = /.../) || (@foo = /.../)

to see if that works? It ought, as assignment in list context returns 
the number of elements assigned, but I can see the regex engine 
getting odd in there.
--
Dan

--"it's like this"---
Dan Sugalski  even samurai
[EMAIL PROTECTED] have teddy bears and even
  teddy bears get drunk


Re: Avoiding $1, $2, ...

2003-07-29 Thread Wechsler
On Tue, 29 Jul 2003, Paul Makepeace wrote:

> I'd like to dump regex matches into an array without explicitly naming
> $1, $2, ...
> 
> =head1 NOT WORKING CODE
> ($month, $day, $time, $host, $process, $pid, $message) =
> /^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)\[(\d+)\]: (.*)$/ ||
> /^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)():\s+(.*)$/;
> =cut
> I.e. if the first regex fails, try the other one.
> 
> Is this possible in Perl? I've tried a bunch of things
> with blocks and so on but no luck.

At the risk of some very rusty pseudoperl:

((( ...vars... ) = /regexp1/ ) ||
(( ...vars... ) = /regexp2/))  

- should only evaluate the latter if the former fails?

Consider this more an attempt on my part to start recalling some perl than 
a very convinced answer...

TTFN,
Wechsler
-- 
http://www.fromtheshadows.com/ Fingerprint: 542C ADA9 47CE 7AA8 2274
PGP Key http://www.fromtheshadows.com/gpg   496A FC43 312C 3D94 2CC8
I'm not the person your mother warned you about... 
her imagination isn't that good. -- Amy Gorin




Re: Avoiding $1, $2, ...

2003-07-29 Thread Rafael Garcia-Suarez
Paul Makepeace wrote:
> I'd like to dump regex matches into an array without explicitly naming
> $1, $2, ...
> 
> =head1 NOT WORKING CODE
> ($month, $day, $time, $host, $process, $pid, $message) =
> /^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)\[(\d+)\]: (.*)$/ ||
> /^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)():\s+(.*)$/;
> =cut
> 
> I.e. if the first regex fails, try the other one.

You can try to fiddle with $+ and/or $^N.
Recent perl needed.



Re: Avoiding $1, $2, ...

2003-07-29 Thread Jasper McCrea
Paul Makepeace wrote:
> 
> I'd like to dump regex matches into an array without explicitly naming
> $1, $2, ...
> 
> =head1 NOT WORKING CODE
> ($month, $day, $time, $host, $process, $pid, $message) =
> /^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)\[(\d+)\]: (.*)$/ ||
> /^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)():\s+(.*)$/;
> =cut
> 
> I.e. if the first regex fails, try the other one.

And far be it from me attempt to second-guess , too, but why not use:

   /^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)\[?(\d*)\]?: (.*)$/

?

Jasp



Re: Avoiding $1, $2, ...

2003-07-29 Thread Jasper McCrea
Paul Makepeace wrote:
> 
> I'd like to dump regex matches into an array without explicitly naming
> $1, $2, ...
> 
> =head1 NOT WORKING CODE
> ($month, $day, $time, $host, $process, $pid, $message) =
> /^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)\[(\d+)\]: (.*)$/ ||
> /^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)():\s+(.*)$/;
> =cut
> 
> I.e. if the first regex fails, try the other one.
> 

not tried, but if the first one fails, and produces nothing, why not just @a =
(//,//) ?

Jasper



Avoiding $1, $2, ...

2003-07-29 Thread Paul Makepeace
I'd like to dump regex matches into an array without explicitly naming
$1, $2, ...

=head1 NOT WORKING CODE
($month, $day, $time, $host, $process, $pid, $message) =
/^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)\[(\d+)\]: (.*)$/ ||
/^(\w+) (\d+) (\d\d+:\d\d:\d\d) (\w+) ([()\w\/]+)():\s+(.*)$/;
=cut

I.e. if the first regex fails, try the other one.

Is this possible in Perl? I've tried a bunch of things
with blocks and so on but no luck.

Paul

-- 
Paul Makepeace ... http://paulm.com/

"What is the secret of your success? Ladies and gentlemen, Elvis has
 left the building."
   -- http://paulm.com/toys/surrealism/



Re: [ANNOUNCE] Happy 5th Birthday London.pm - Social Thurs 7th August

2003-07-29 Thread Dave Cross

From: Mark Fowler <[EMAIL PROTECTED]>
Date: 7/29/03 1:00:08 PM

> we're going back to where it all started, the Cittie
> of Yourke pub on high Holborn (though to be fair we'll be 
> meeting in the downstairs bar now we've grown so much.) 

Actually, we _were_ in the downstairs bar for the first meeting.

See  for photos
of fresh-faced youths.

Dave...

-- 


"Let me see you make decisions, without your television"
   - Depeche Mode (Stripped)








[ANNOUNCE] Happy 5th Birthday London.pm - Social Thurs 7th August

2003-07-29 Thread Mark Fowler
Can you believe it?  We're five years old!

To celebrate this, on Thursday 7th August (that's a week on Thursday,
nine days from now) we're going back to where it all started, the Cittie
of Yourke pub on high Holborn (though to be fair we'll be meeting in the
downstairs bar now we've grown so much.)  Come along and celebrate with
us.  They'll be cake, and maybe some party hats.  And say the magic phrase
'It's our party and I'll drink if you want me to' and I'll buy you a
magic birthday pint[1].

 http://www.streetmap.co.uk/streetmap.dll?P2M?P=WC1V6BN&Z=1
 http://london.pm.org/meetings/locations/cittieofyorke.html
 http://openguides.org/london/index.cgi?Cittie_Of_Yorke,_WC1V_6BN

Full directions to the pub are at the end of this mail.  Social meetings
are a chance for people to meet up and see each other face to face, to
discuss Perl, or just for some random banter.  Everyone's free to attend,
from hard core Perl hackers to those that are simply vaguely associated
with London Perl Mongers - everyone always finds something to talk about,
even if it just about the beer.  Hopefully, it being our fifth birthday and
all, people who haven't been able to make every meeting will be able to
attend this one.

Directions: The pub is really easy to find...

 From Holborn Station: (Central & Piccadilly 38/19 Bus)
  You need to walk east down the north side of Holborn, and the pub
  will be on your left.

  Holborn station is on the corner of Kingsway and Holborn.  When you come
  out of the station, turn right down Holborn and walk east.  There's
  a pelican crossing by the Penderal's Oak.  Cross the road so you're on
  the north hand side, turn right and continue east.  The pub will be on
  your left.

 From Chancery Lane (Central Line):
  You need to get on the north side of Holborn and walk west, and the pub
  will be on your right.

I hope to see you there, if not before at the smaller meet tomorrow that
Nick Clarke just posted an announcement for.

Mark.

[1] One pint per attendee, with maximum limit of 50 pints in the evening.
Acceptable beverages to be decided solely by me.  Offer only valid in the
Cittie of Yorke between 7pm-10pm on 7th Aug 2003.  Purchases entirely at
my discretion.  My decision is final.  No cash alternative.  Pints may
not actually be magic.

-- 
#!/usr/bin/perl -T
use strict;
use warnings;
print q{Mark Fowler, [EMAIL PROTECTED], http://twoshortplanks.com/};






[ANNOUNCE] Emergency Social Wednesday (30th July) Pillars of Hercules

2003-07-29 Thread Nicholas Clark
(NB - details not as previously mooted on the list)

R. Geoffrey Avery and Claes Jacobson are in town. This calls for an
emergency social meeting before they leave.

We're going to meet up at the Pillars of Hercules on Wednesday (tomorrow)
at 6.30pm

  Address:
  7 Greek Street (that's in Soho, nearest tubes
 Tottenham Court Road / Leicester Square)

  Streetmap:
  http://www.streetmap.co.uk/streetmap.dll?P2M?P=W1V5LE&Z=1

  Openguide:
  http://openguides.org/london/index.cgi?Pillars_Of_Hercules,_W1D_4DJ


They have pie. And other food.

Nicholas Clark




Re: multi-module packaging question

2003-07-29 Thread Sam Vilain
On Tue, 29 Jul 2003 10:07, Jo Walsh wrote:
>  i want to make an RDF::Simple package that will eventually have both
>  Serialiser.pm and Parser.pm in it, but i'm not sure how to make a
> package for more than one module - so a user can 'install RDF::Simple'
> and get everything in it, including some utility modules. 'perldoc
> perlnewmod' isn't really helping me out much here.

Obviously you weren't at the ExtUtils::ModuleMaker talk!  It's a
souped up `h2xs' that handles this sort of case really well.

>  the little serialiser is TT based; if i need to stick a TT template
>  somewhere on the filesystem in a default INCLUDE_PATH, how would i do
>  that as part of the regular module install process, and where might be
>  the best place to put it?

If you're going to go down the ExtUtils::MakeMaker path, rather than
Module::Build, and you really want to put the file in the TT include
dirs (rightly so!), in your Makefile.PL:

  - load the Template::Config module to determine the local
INCLUDE_PATH
  - Create in the MY namespace;
 - a "postamble" sub that contains Makefile commands to install
   the files
 - an "install" sub that adds your new Makefile sections to the
   targets for the "make install" command
 - a "contants" sub that defines any variables that deserve to be
   in the Makefile

 eg, something like this:

use ExtUtils::MakeMaker;

use vars qw($template_dir $prefix);

# use eval so that dependancy processing works normally
eval 'use Template::Config;
  $template_dir = Template::Config->instdir("templates");';

use Config;
$prefix = $Config{"prefix"};

# Try to express the TT dir relative to the prefix, so that things
# like `dh-make-perl' and `cpanflute' still work
$template_dir =~ s{^\Q$prefix\E}{\$(PREFIX)}
if ($template_dir and $prefix);

package MY;

sub postamble {
return <<'EOF';
install_templates ::
# If you need a script, otherwise just use `cp'
#$(PERL) bin/install_templates "$(TT_TDIR)"
# another hack for the CPAN to package converters
[ -d $(TT_TDIR) ] || mkdir -p $(TT_TDIR)
cp template1 template2 $(TT_TDIR)
EOF
}

sub install {
my $class = shift;
my $basic = $class->SUPER::install(@_);
$basic =~ s/^(install\s+::\s+.*)$/$1 install_templates/m;
$basic;
}

sub constants {
my $class = shift;
my $basic = $class->SUPER::constants(@_);
$basic = "TT_TDIR = $main::template_dir\n$basic";
$basic;
}

package main;

WriteMakefile
(...)

Good luck,
-- 
Sam Vilain, [EMAIL PROTECTED]

(To Walter Cronkite):
Well Walter, I believe that the Good Lord gave us a finite number
of heartbeats and I'm damned if I'm going to use up mine running up
and down a street.
NEIL ARMSTRONG




Re: multi-module packaging question

2003-07-29 Thread Robin Berjon
Hi Jo,

Jo Walsh wrote:
 i want to make an RDF::Simple package that will eventually have both
 Serialiser.pm and Parser.pm in it, but i'm not sure how to make a package 
 for more than one module - so a user can 'install RDF::Simple' and get
 everything in it, including some utility modules. 'perldoc perlnewmod'
 isn't really helping me out much here.
There are several ways to do it, but what I do (and I believe it's more or less 
what most do) is to have a lib/ subdirectory in my distro in which I put the 
hierarchy of my module and update the MANIFEST to match. So you'd have:

RDF-Simple/
  lib/RDF/Simple.pm
  lib/RDF/Simple/Parser.pm
  ...
(provided it's RDF::Simple::Parser and not RDF::Parser, in which case change 
accordingly).

IIRC make ci updates your MANIFEST for you but I tend to update it by hand 
because I usually have lots of stuff I don't want to be automatically put in 
there, and it'd be too much work to add them to the skipped files.

 the little serialiser is TT based; if i need to stick a TT template
 somewhere on the filesystem in a default INCLUDE_PATH, how would i do
 that as part of the regular module install process, and where might be
 the best place to put it?
I guess INCLUDE_PATH is a TT thing so I don't know much about that. What make 
install does is copy INST_* to the matching INSTALL*. Maybe you just need the 
SCRIPT (INST_SCRIPT and INSTALLSCRIPT) variants. There are also ugly tricks to 
manipulate the Makefile before it gets written if you need more power. All of 
this is in ExtUtils::MakeMaker.

As a side question: are there nice tricks to write XML using TT in an error-free 
fashion? I'd be curious to look into them, new ways of writing XML being always 
of interest since it's such a painful task.

--
Robin Berjon <[EMAIL PROTECTED]>
Research Engineer, Expwayhttp://expway.fr/
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488



Re: multi-module packaging question

2003-07-29 Thread Steve Purkis
On Tuesday, July 29, 2003, at 10:07  am, Jo Walsh wrote:

 hello,

 i have a packaging question...
 i want to make an RDF::Simple package that will eventually have both
 Serialiser.pm and Parser.pm in it, but i'm not sure how to make a 
package
 for more than one module - so a user can 'install RDF::Simple' and get
 everything in it, including some utility modules. 'perldoc perlnewmod'
 isn't really helping me out much here.
Have you had a look at Moudle::Build?  I thing you'll find it does what 
you need:

	http://search.cpan.org/dist/Module-Build/

The other alternative is ExtUtils::MakeMaker, which can be a bit hairy, 
but is the current standard for CPAN.

If you're not sure how to layout your source tree, I'd recommend having 
a look at ExtUtils::ModuleMaker as an alternative to h2xs.


 the little serialiser is TT based; if i need to stick a TT template
 somewhere on the filesystem in a default INCLUDE_PATH, how would i do
 that as part of the regular module install process, and where might be
 the best place to put it?
Hmm - I've heard of people sticking them into the 'install libs' 
directory, along with the perl modules themselves.  So something like:

RDF-Simple/lib/RDF/Simple.pm
RDF-Simple/lib/RDF/Simple/a_template.tt2
Then you can add @INC to TT2's INCLUDE_PATH.  ymmv..

-Steve




Re: multi-module packaging question

2003-07-29 Thread Simon Wistow
On Tue, Jul 29, 2003 at 10:07:38AM +0100, Jo Walsh said:
>  i want to make an RDF::Simple package that will eventually have both
>  Serialiser.pm and Parser.pm in it, but i'm not sure how to make a package 
>  for more than one module - so a user can 'install RDF::Simple' and get
>  everything in it, including some utility modules. 'perldoc perlnewmod'
>  isn't really helping me out much here.


Have a look at something like 

http://search.cpan.org/src/SIMONW/Apache-Session-SharedMem-0.41/

basically, if I understand you correctly then you need 

lib/RDF/
Simple.pm
Simple/
   Serialiser.pm
   Parser.pm





  
>  the little serialiser is TT based; if i need to stick a TT template
>  somewhere on the filesystem in a default INCLUDE_PATH, how would i do
>  that as part of the regular module install process, and where might be
>  the best place to put it?

Inline it in the serialiser in the DATA section and then read that in 
pass it to TT?

I did something similar for Aaron and AutoDia 

http://search.cpan.org/src/TEEJAY/Autodia-1.7/Autodia/Diagram.pm

Simon

-- 
stay up late ... if we want to




multi-module packaging question

2003-07-29 Thread Jo Walsh
 hello,

 i have a packaging question... 
 i want to make an RDF::Simple package that will eventually have both
 Serialiser.pm and Parser.pm in it, but i'm not sure how to make a package 
 for more than one module - so a user can 'install RDF::Simple' and get
 everything in it, including some utility modules. 'perldoc perlnewmod'
 isn't really helping me out much here.
 
 the little serialiser is TT based; if i need to stick a TT template
 somewhere on the filesystem in a default INCLUDE_PATH, how would i do
 that as part of the regular module install process, and where might be
 the best place to put it?

 asked in the hope that others might find the answers enlightening also...

 p.s. it would be nice to drink with claes but thursday's out for me too

 
 zx
 --
 "Common sense won't tell you. We have to tell each other." -DNA
 



Re: rack you brains

2003-07-29 Thread Simon Wistow
On Tue, Jul 29, 2003 at 12:04:13AM +0100, Anthony Newman said:
> Avoirdupois weights and measures converter for non-UK resident perl mongers?

Not a bad idea. I shall suggest it to the lackeys, err, interns.