Re: Webcasting the tech meets?

2011-03-11 Thread Richard Clamp
On Fri, Mar 11, 2011 at 10:40:04AM +, Dave Hodgkinson wrote:
> I had enough people saying they wished they could have been there to lead
> me to believe the audience would have been much larger.

People will generally do this, it's called being nice.

A: "I'm performing tomorrow, you should come"
B: "Oh, erm, I'd love to but I can't, maybe you could record it"

-- 
Richard Clamp 


Re: London.pm Dim sum Wednesday 1pm: Leong's Legend Continues

2008-12-24 Thread Richard Clamp

On Wed, Dec 24, 2008 at 09:18:10AM +, L?on Brocard wrote:
> This is today. Who's coming? Leon

Me.  I even came into work specially so it's just a walk across the square.

-- 
Richard Clamp 


Re: nice part of San Francisco and hotel?

2003-09-18 Thread Richard Clamp
On Thu, Sep 18, 2003 at 02:06:36PM +0100, Mark Fowler wrote:
> Dude, this is London.pm.  I think you want SanFrancisco.pm.

Are you sure?  Remember how the typical hotel conversation goes with a
local?

Tourist:  Say, where would I find a hotel here.
Local:Sorry, I can't help - I {rent,buy,squat in} a {flat,house,elephant}

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Database setup

2003-09-17 Thread Richard Clamp
On Wed, Sep 17, 2003 at 02:51:28PM +0100, alex wrote:
> I know it isn't exactly what you want - it being java and not perl, but it 
> might help. I can't remember if anyone directed me to a perl version.

Seems like it went through the typical sourceforge lifecycle.

 Mailing list post:
 http://www.mail-archive.com/[EMAIL PROTECTED]/msg00691.html

 Sourceforge project:
 http://sourceforge.net/projects/perl-torque/

 Conclusion:
 file:///dev/zero

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Database setup

2003-09-17 Thread Richard Clamp
On Wed, Sep 17, 2003 at 02:10:49PM +0100, Kate L Pugh wrote:
> Now I hate doing things over and over again.  I just found myself
> copying and pasting this code for the second time this month, and it
> makes me feel dirty.  Surely there is a simple module on CPAN that I
> can pass a big pile of CREATE TABLE statements to, and it'll check
> whether the tables exist, set them up if not, be silent or not as I
> require, force clearing of existing tables at my whim.  What is this
> module called?

I think maybe it's Alzabo, which I used to write a very simple diffing
tool[0] with passing reference to the documentation, but it's very
very large.

[0] http://unixbeard.net/svn/richardc/misc/alz_diff

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: [OT] accessors pragma

2003-09-17 Thread Richard Clamp
On Wed, Sep 17, 2003 at 09:47:43AM +0100, Tom Insam wrote:
> At 17:59 +0100 2003/09/16, Steve Purkis wrote:
> >
> >Secondly, with the current implementation an 'undef' argument will 
> >trigger a set for both 'classic' and 'chained' accessors:
> >
> > $book->author($a); # still sets when $a = undef
> >
> 
> How? I can't see how that would work..

@_ will still have an element in it after shifting off $self, so the
old favourite:

 sub foo {
 my $self = shift;
 if (@_) {
 $self->{foo} = shift;
 }
 $self->{foo}; # or $self;
 }

Will still have something to assign.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: return gotcha

2003-09-11 Thread Richard Clamp
On Thu, Sep 11, 2003 at 11:27:15AM +0100, Jasper McCrea wrote:
> Richard Clamp wrote:
> > 
> > On Thu, Sep 11, 2003 at 11:02:32AM +0100, Paul Makepeace wrote:
> > >   Is there a standard
> > > efficient, clear way of saying "...or function 'return;'s."?
> > 
> > Returns false.
> 
> return 0 / undef / '';
> 
> all return false, and none of these have the same list behaviour as 'return;'

No, they return a false scalar.  That's not good enough when you're
dealing with an array.

 while (my @row = $get->some_thing) {
   ...
 }

only return (); and it's terser equivalent return; will be false
enough for the loop to exit.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: return gotcha

2003-09-11 Thread Richard Clamp
On Thu, Sep 11, 2003 at 11:02:32AM +0100, Paul Makepeace wrote:
>   Is there a standard
> efficient, clear way of saying "...or function 'return;'s."?

Returns false.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Factory Classes

2003-09-02 Thread Richard Clamp
On Tue, Sep 02, 2003 at 12:31:03PM +0100, Mark Fowler wrote:
> On Tue, 2 Sep 2003, Simon Wistow wrote:
> 
> > http://siesta.unixbeard.net/svn/trunk/siesta/lib/Siesta.pm
> > under available_plugins
> 
> 1) Does that code work on platforms that don't use '/' as a directory
> seperator?  Ooh, maybe I should patch that.

Yes, because File::Find always deals in things separated by /
regardless of the local idiom.

This is sometimes referred to as Rubbish, but hey, it's File::Find.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Programming Email Filters

2003-09-02 Thread Richard Clamp
On Mon, Sep 01, 2003 at 02:09:58PM -0700, Dave Cross wrote:
> 
> I'm using the Email::* modules but there doesn't seem to be a
> way to extract the actual deliverable email address from the
> headers. For example, from
> 
> "Dave Cross" <[EMAIL PROTECTED]>
[snip]
> Email parsing is listed as "for a future release" in Regexp::Common.
> I could use Mail::Address, but I don't really want to install
> Mail-Tools given that Email::* replaces most of it.

Bite the bullet.  It's good enough that we use it for Siesta, and
we've had to be picky about choice of address extractors in the past.


-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Programming Email Filters

2003-09-02 Thread Richard Clamp
On Tue, Sep 02, 2003 at 09:27:34AM +0100, Peter Sergeant wrote:
> http://grou.ch/bounce.txt is very effective. But if you're using
> fetchmail or similar, remember the Email::Simple team chose correctness
> over usefulness,

I typically find correct things very useful.  For the cases where not,
we have this wonderful thing called documentation which explains why
you shouldn't expect deliberate brokenness in order to be useful.

http://search.cpan.org/dist/Email-Simple/Simple.pm#CAVEATS

>   and not to write the emails back to mail folders,
> unless you want all kinds of pain.

Or you use the tool for the job, which is Email::Filter.

http://search.cpan.org/dist/Email-Filter/lib/Email/Filter.pm

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: [OT] SQL woes

2003-08-22 Thread Richard Clamp
On Fri, Aug 22, 2003 at 06:20:39AM -0700, Dave Cross wrote:
> MySQL is just a file-based storage system with a pseudo-SQL interface.
> It doesn't support many of the things that you'd expect in a
> real SQL implementation, for example:
> 
> * Transactions
> * Referential integrity

Innodb tables give you these in modern mysqls.

> * Subselects

Not yet, scheduled for 4.1 though.

Besides, people really don't expect those things.  It's just the
people who've used other RDBMSs before and enjoyed the bondage and
discipline that expect them.


Not that I'm against hating software, but I do have this preference
for informed hate.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Siesta party

2003-08-14 Thread Richard Clamp
On Thu, Aug 14, 2003 at 11:08:13AM +0100, Nigel Rantor wrote:
> 
> Oooh, where do I sign up?
> 
> *search*

Top posting.  Undertrimming.  Oneliners.  Abuse of asterisks.

Please God, make it stop.  I promise I'll eat all of my greens.


As to the wider question of another Siesta party, take that over to
siesta-dev where I may sneer properly.  It would help if you remember
that we managed a launch party in the middle of a respectable
building, during a talk that was been given about it.  

We don't need no steenking venues.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: [ANNOUNCE] YAPC::Europe Auction

2003-07-28 Thread Richard Clamp
On Mon, Jul 28, 2003 at 12:42:38PM +0200, Philip Newton wrote:
> On the other hand, given that the sum raised was so substantial (an 
> also in light of how search.cpan.org went to orange for a bit even 
> though the "orange" group lost, in honour of the substantial bid, as I 
> understood), wouldn't it be a nice gesture to offer a full year?
> 
> I mean, if 200 euros would have made the page French until the end of 
> the year, surely 1372 euros can do so for an entire year?

Based upon my understanding of auctions it would have required 1372
euros to make it French, for the agreed time period.

If anything by your logic we could expect to see both sites being
English for a period of time as a gesture towards the losing side, but
that would still be up to the respective leaders of Paris and
London.pm.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: [ANNOUNCE] YAPC::Europe Auction

2003-07-27 Thread Richard Clamp
On Sun, Jul 27, 2003 at 05:21:03PM +0100, Michael Chamberlain wrote:
> >So, in conclusion both London.pm and Paris.pm will have their homepage
> >in Esperanto until the end of the year.
> >
> >
> 
> You mean for the next 12 months, not until december ;)

No, until the end of the year.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: [OT] nasty mod_perl build problem

2003-07-25 Thread Richard Clamp
On Fri, Jul 25, 2003 at 11:24:47AM +0100, Ben wrote:
> [1] Don't say "Why don't you just use the debian-supplied ones" to me unless you 
> actually want
> to hear the answer. Yes, apt / dpkg gets a lot of things right. Two of the things it 
> doesn't
> get right IMNSHO are Apache and Perl. 

I don't think it gets perl right at all, or at least not the way I use
it.  That's why I typically install into /usr/local/perl*[0] and if I
need it, I build mod_perl against the debian apache as a dso.

[0] 
% ls -d /usr/local/perl* | wc -l
 14

No, really.


-- 
Richard Clamp <[EMAIL PROTECTED]>



DEA Slides

2003-07-18 Thread Richard Clamp
My slides for last nights talk on Device::Ericsson::AccessoryMenu are
now online:
  http://unixbeard.net/~richardc/cgi/blog.cgi/dea.pod/

I'm afraid you'll have to arrange for Evil to phone you personally.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Expletives (was Eurocracy sucks)

2003-07-15 Thread Richard Clamp
On Tue, Jul 15, 2003 at 11:18:27AM +0200, Mark Overmeer wrote:
> You probably mean
> 
>  grep -c 'f.ck' london.pm.mbox

You trim too much.

>> Obviously they weren't starred in the grep query. That would be 
>> silly.)

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Treating strings like file handles?

2003-07-11 Thread Richard Clamp
On Fri, Jul 11, 2003 at 12:19:52PM +0100, Ali Young wrote:
> This came up when I was playing with a module that expected to read some 
> text from a file when I was actually trying to make it use the text in a 
> string. This seemed simple but I've not yet found a way to do.
> 
> My question is whether it is possible to make a string act enough like a 
> filehandle so that you can read from it and print to it? If it is 
> possible, could someone point me in the right direction please?

IO::Scalar -
http://search.cpan.org/author/ERYQ/IO-stringy-2.108/lib/IO/Scalar.pm

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Is dynamic inheritance bad?

2003-07-10 Thread Richard Clamp
On Thu, Jul 10, 2003 at 04:14:21PM +0100, Shevek wrote:
> But if this were the case (for a general system of this type), then the 
> type of storage now becomes a matter for the code, rather than just a 
> configuration variable, and
> 
> my $obj = Factory->new($type, ...)
> 
> becomes in every piece of code:
> 
> my $obj;
> if ($type eq 'a') {
>   $obj = Factory->a(...);
> }
> elsif ($type eq 'b') {
>   $obj = Factory->b(...);
> }

Or, if you're familiar with the fun of perls OO it remains the much
more similar:

 my $obj = Factory->$type(...);

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: archives (was Re: YAPC hotels)

2003-07-09 Thread Richard Clamp
On Wed, Jul 09, 2003 at 01:32:00PM +0100, Paul Mison wrote:
> However, while it's all very pretty, it takes a while even to do 
> incremental updates: about half an hour total. That's with all the 
> bells and whistles, and with a slightly old copy of the code. (Sadly 
> penderel doesn't have svn, so I can't keep it up to date as easily as 
> I'd like.) This means that the mariachi archive won't be kept up to 
> date with cron for the moment.

The current CPAN release, 0.41, reflects the current state of the
subversion copy.  Most of my current Siesta-related tuits are going on
getting a release out the door for YAPC::Europe so that I can give a
slightly different talk to the one London.pm and Birmingham.pm got at
their last technical meetings.

This is why I was only slightly muttering.  When we've licked the
speed issues and got some kind of migration guide, expect full-on
pulpit-thumping fury!

If anyone wants to have a go at the speed issues, these posts may
help:

http://siesta.unixbeard.net/siesta/archive/siesta-dev/2003/06/26/ff3af786.html
http://siesta.unixbeard.net/siesta/archive/siesta-dev/2003/06/26/4be5d913.html

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: YAPC hotels

2003-07-09 Thread Richard Clamp
On Wed, Jul 09, 2003 at 11:19:35AM +0100, R.Dobson wrote:
> Hi,
> 
> i've made a late decision to do YAPC::EU but haven't been paying attention 
> when people have been discussing accomodation.
> Could anyone recommend anywhere?

Handily we have archives for that.

http://london.pm.org/pipermail/london.pm/Week-of-Mon-20030707/020112.html

*slight mumblings about pipermail*

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Class::DBI

2003-06-28 Thread Richard Clamp
On Sat, Jun 28, 2003 at 11:11:43AM +0100, Alex McLintock wrote:
> I'm trying to understand Class::DBI
> 
> I'm reading the perldoc and TOny Bowden's article on perl.com
> 
> The problem I have is that I can't see how to build up more complicated 
> queries such as
> 
> give me the first one hundred book titles

There's the C method

  my @books = Book->retrieve_from_sql("id > $lastid ORDER BY id LIMIT 100");

Or, documented really nearby to that, C

  __PACKAGE__->add_constructor( top100 => "id > ? ORDER BY id LIMIT 100" );
  my @books = Book->top100(0);

Of course ordering by id probably isn't correct, but I'm sure you know
which column you really want to order on

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Making perl modules for CPAN

2003-06-09 Thread Richard Clamp
On Mon, Jun 09, 2003 at 01:55:41PM +0100, Jason Clifford wrote:
> On Mon, 9 Jun 2003, Nicholas Clark wrote:
> 
> > cheaper than free?
> > 
> > I think you've missed an important point of the case he's describing
> > With existing hardware and "free" minutes that would otherwise go to waste
> > at the end of the month, there's no cost in using the 9.6 modem.
> > The other options you describe, although faster, involve spending money.
> 
> Then it comes down to the usual "how valuable is your time" question.

 Not valuable enough to stay out of spiralling discussions on
mailing lists? 

Help help.  I'm being sucked back into the vortex.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Making perl modules for CPAN

2003-06-05 Thread Richard Clamp
On Thu, Jun 05, 2003 at 02:25:53PM +0100, Jonathan Stowe wrote:
> As the perlmod manpage says (with my emphasis) :
> 
> 
>  START WITH H2XS!

And as I often find myself saying

Urgh, the little swine created a whole pile of junk,
riddled with 5.6ism that just don't reflect the rest of my code.

It's worth doing it once, to see what files you're expected to ship
with a CPAN dist, but personally, I don't have the right attachments
for my bargepole.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Making perl modules for CPAN

2003-06-05 Thread Richard Clamp
On Thu, Jun 05, 2003 at 01:47:31PM +0100, Steve Purkis wrote:
> I prefer (2) because I can use the CVS revision number in each file:
>   our $VERSION = (split(/ /, '$Revision: 1.6 $'))[1];

I think both 1 and 2 cause more pain than it's worth when you're
releasing one distribution with many files, so I go with 3)

3) Only put a version number in the file/package which you intend to
be the handle for your distribution.

 package WWW::CIA;
 our $VERSION = 0.03;
 package WWW::CIA::Parser;

Put the rcs header in the others if you must, but I'd
advocate not using it to derive a version number, since that tesnd you
bit your ass in many ways.

* You may want to move across VCS systems.
* You have a disaster which results in your number reverting to
  1.1 when you check in the CPAN release it being the only known copy.

If you really want to make it programatically available I'd suggest
you take a page from Andy Wardleys book and put that in a variable
called $REVISION


> Other things you should do:
>   *   set VERSION_FROM and ABSTRACT_FROM => 'lib/WWW/CIA.pm' in 
> Makefile.PL
>   *   create a MANIFEST with 'make manifest'
>   *   read http://www.cpan.org/misc/cpan-faq.html#How_contribute_modules

* Throw ExtUtils::MakeMaker away, and rejoice in the cleanliness
  of Module::Build (create_makefile_pl if you must, just to keep the
  CPAN.pm users from lynching you.)

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Local Boy Makes Good

2003-06-05 Thread Richard Clamp
On Thu, Jun 05, 2003 at 06:15:46AM +0100, Dave Cross wrote:
> (Well, local-ish - he's from Birmingham really you konw)
> 
> One of the finalists in the ActiveState "ActiveAwards" Perl category
> is our very own Richard Clamp.

Well blow me down.

Thanks to whoever put me up for this, I think.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Mariachi enhancement (was Re: Siesta talk slides)

2003-06-01 Thread Richard Clamp
On Fri, May 23, 2003 at 09:06:55AM +0100, Richard Clamp wrote:
> Lo all, these are the slides for the talk(s) I gave last night:
>  http://unixbeard.net/~richardc/cgi/blog.cgi/siesta-timeline.pod/
>  http://unixbeard.net/~richardc/cgi/blog.cgi/siesta.pod/
>  http://unixbeard.net/~richardc/cgi/blog.cgi/mariachi.pod/

I remember from the questions about Mariachi that people were
interested in a way of seeing something of a message from the thread
summary, to account for thread drift.  You find yourself in
opinionated company:

 http://weblog.infoworld.com/udell/misc/oscom/zopeDevBefore.html

(Though I think he may be also advocating using a form of the Lurker
thread idiom on the next slide)

Now we liked that idea, so much so that it's taken 3 of us intending to
work on it for the best part of a week to get it done.

Then today, Simon actually did the unthinkable and wrote it.  It's in
the repository, and since we run the siesta lists on the bleeding edge
you can see it in action here:

 http://siesta.unixbeard.net/siesta/archive/siesta-dev/

Comments and contributions through the usual channels.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Installing Files

2003-04-09 Thread Richard Clamp
On Wed, Apr 09, 2003 at 03:54:54PM +0100, Mark Fowler wrote:
> Hi.
> 
> I'm writing a custom Module::Build script to copy the templates that my
> module uses from the module dir to a location where they'll be used by the
> module while it's running.

Don't put it in a script, use a subclass, and read the code you're
subclassing from first.  The rest is trivial:

  https://siesta.unixbeard.net/svn/trunk/siesta/lib/Siesta/Build.pm

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: use warnings and 5.005

2003-03-31 Thread Richard Clamp
On Mon, Mar 31, 2003 at 05:04:10PM +0100, Shevek wrote:
> On 31 Mar 2003, Randal L. Schwartz wrote:
> > Wrong.  I can't get this to shuttup in Perl 5.5:
> > 
> >   my @punctuation = qw(. , ! ?);
> 
> I would argue for:
> 
> my @punct = do { no warnings; qw(. , ! ?); };

But you're missing the stipulation that this is perl5.005, which
doesn't have the warnings pragma.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: crackfuelled idea / nntp / message boards / bl*gs / mailing lists

2003-03-28 Thread Richard Clamp
On Fri, Mar 28, 2003 at 09:59:12PM +, Simon Wistow wrote:
> Yes, we moved to a local subversion tree last night due to continuing SF 
> crapness. 
> 
> http://siesta.unixbeard.net/svn/ is the new repository.

I'm sure I did this last night too, but the actual url you want to use
is:

https://siesta.unixbeard.net/svn/trunk/

> I'm trying to persuade Richard to run a nightly make dist and whack it 
> up some where.

Nick is overbuilding it for us currently, for which I'm eternally
grateful as it saves me some hassle. 

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: crackfuelled idea / nntp / message boards / bl*gs / mailing lists

2003-03-28 Thread Richard Clamp
On Fri, Mar 28, 2003 at 08:09:27PM +, David Cantrell wrote:
> On Friday, March 28, 2003 11:35 -0500 darren chamberlain 
> <[EMAIL PROTECTED]> wrote:
> >* Simon Wistow  [2003-03-27 20:34]:
> >>Write a NNTP plugin for Siesta. Posting mail to Usenet would be easy.
> >Attached.  (The preferences stuff isn't in there, though it's obvious
> >where to put it.)
> 
> So does this work both ways? 

No, for that you'd need some kind of watcher/injector.  I think such a
thing would be fairly easy given Net:NNTP and a stateful/smart enough
script, since that's how I read all my perl.org mailing lists.

http://mirth.unixbeard.net/~richardc/nntp_deliver

If anyone wants to adapt that, then we can think about including it
with the Siesta-Plugin-NNTP distribution.  I'd do it myself but my
brain is fried.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: crackfuelled idea / nntp / message boards / bl*gs / mailing lists

2003-03-28 Thread Richard Clamp
On Fri, Mar 28, 2003 at 11:35:31AM -0500, darren chamberlain wrote:
> * Simon Wistow  [2003-03-27 20:34]:
> > Write a NNTP plugin for Siesta. Posting mail to Usenet would be easy.
> 
> Attached.  (The preferences stuff isn't in there, though it's obvious
> where to put it.)

Nifty, applied as revision 546

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: crackfuelled idea / nntp / message boards / bl*gs / mailing lists

2003-03-27 Thread Richard Clamp
On Fri, Mar 28, 2003 at 01:35:09AM +, Simon Wistow wrote:
> *cough* Siesta
> 
> http://siesta.unixbeard.net/svn/

*cough* https, not http.  

Before people ask, it's tuit-related.  I have some mod_perl related
stuff that I've not even started to port to apache2, so apache 1.3
sits on :80, apache2 on :443.  Oh and I don't have multiple exposed
IPs addresses, and I don't care enough to debug a redirecting proxy.

Oh, and while I remember I feel it's worth stressing;  Siesta is still
just a MLM, rather than the floor wax and dessert topping it sometimes
appears through Simons fevered dreams.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: c email libraries

2003-03-19 Thread Richard Clamp
On Wed, Mar 19, 2003 at 08:00:37AM +, Simon Wistow wrote:
> On Tue, Mar 18, 2003 at 06:44:43PM +, Marty Pauley said:
> > > and another one that implements jwz's threading algorith,
> > 
> > Dunno about that.  I thought he provided the C code himself.
> 
> There's a link to the Java source of Grendel but that's pretty app
> specific.
> 
> Anyway, just for a bit of context -
> 
> One of the things that Siesta needs is a decent mail archiver. I have

No, no it doesn't.  What it could do with is intelligent use of an
existing one, which means one less wheel to reinvent.

What we're currently using is delivery into maildirs (take two, watch
your locking headaches melt away) which are then webified periodically
using mhonarc.  Folks can see results of that process here:

http://siesta.unixbeard.net/siesta/archive/siesta-dev
http://siesta.unixbeard.net/siesta/archive/siesta-commit

"But!" I hear you say, "there's no easy searching of that", to which
I'll hypothetically answer "google +site:siesta.unixbeard.net" and
then someone will say something like "google doesn't reindex quite as
often as I want it to."  To which I'll probably mumble something about
webglimpse, or whatever it is that the perl5-porters web archive uses.

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/

See, I don't need you puny humans, I can preempt the whole thing in my
head.

> JWZ's code ia able to thread 10,000 messages in less than half a second
> on a low-end (90 MHz) Pentium. The other two cannot. 

So just use that code, or the hardware hammer.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: referenced types

2003-03-09 Thread Richard Clamp
On Mon, Mar 10, 2003 at 01:33:32AM +, Paul Makepeace wrote:
> On Mon, Mar 10, 2003 at 01:24:06AM +0000, Richard Clamp wrote:
> > I really can't tell, meta pedantary is so exhausting.
> 
> ObPedantry: ITYM "pedantry"

Great, now I need to defur my spell checker... :)

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: referenced types

2003-03-09 Thread Richard Clamp
On Mon, Mar 10, 2003 at 12:24:21AM +, Mark Fowler wrote:
>   sub print_string_reversed
>   {
> my $string = shift;
> die "Can only reverse strings" unless ref($string) eq "SCALAR";
> 
> print reverse $string;
>   }
> 
> Of course, that code will fail horribly if I pass it an overloaded object
> that it should just be treat as a string (for example a Math::BigInt
> object)

I think it fails horribly to do what you mean anyway, because you
checked that $string was a ref to a scalar, and then tried to reverse
a list of just that reference, and print that.  

My hunch is that you wanted:

   print scalar reverse $$string;

But it might be that you meant

  sub print_string_reversed {
  my $string = shift;

  # ref will be false for scalars or undef, oh and things blessed
  # into the 0 package (blessing to "" gets you to main)
  die "Can only reverse strings" if ref $string;
  
  print scalar reverse $string;
  }

I really can't tell, meta pedantary is so exhausting.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: iCal Re: website update needed

2003-03-07 Thread Richard Clamp
On Fri, Mar 07, 2003 at 03:13:14PM +, Mark Fowler wrote:
> > There's an utterly unofficial .ics that I intermittently hit with iCal at
> >
> > http://husk.org/misc/irc/london.pm.ics
> 
> So how do I parse these files from Perl then?

Net::ICal looks to be the hammer for this walnut:
http://search.cpan.org/author/SRL/Net-ICal/

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: [OT] RH Perl 5.8.0

2003-01-09 Thread Richard Clamp
On Thu, Jan 09, 2003 at 11:53:42AM +, Dirk Koopman wrote:
> perl 5.6.1 vanilla compile
> Compile-time options: USE_LARGE_FILES
> 
> real4m6.743s
> user3m33.732s
> sys 0m1.348s
> 
> (BTW I couldn't build a perl 5.6.1 on RH 8.0 as an ordinary user, I got
> the following on typing 'make' after the Configure:
> 
> make: *** No rule to make target `', needed by
> `miniperlmain.o'.  Stop.
> 
> I had to go to a RH7.3 machine, do it there and tar it back to my RH8.0
> machine)

Then you've got an unfair benchmark already - one perl build on gcc3,
the other on gcc2.something.  Try this after ./Configure to clean up
the extra fluff that ggc3 put there during make depend (5.8.0 already
has an equivalent of this):

perl -ni~ -we 'print unless /:  rh 5.8.0
> Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
> PERL_IMPLICIT_CONTEXT
> 
> real5m54.853s
> user5m24.873s
> sys 0m0.535s

Now, again, what was LANG set to?  If it's something utf8y, then
that's where all your speed disappeared to.

> How do I complain?

You seem to do it as a side-effect of posting.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: NetMD::libomd created

2002-12-04 Thread Richard Clamp
On Wednesday, Dec 4, 2002, at 10:42 Europe/London, Mark Fowler wrote:

Toby wrote:

Can you think of a better name?

If it's a Tied interface, how about putting it in the Tie:: namespace.


How about not?  I have an old niggle, but I've come to treat it with 
some respect over time, and that's that modules should be named for 
what they do, not how they do it.  It's why I changed the name of 
Attribute::Parameters to Sub::Parameters, since that's more in keeping 
with what it does.

Don't call it 'libomd', as lower case module names are normally 
reserved
for pragmatic modules (modules that change the way perl behaves like
'strict', 'warnings', 'base' and 'vars').  In fact, why not gloss over 
that
bit entirely and just call it Tie::NetMD.

All-lower case, one-word package names are reserved for 
pragmas.  When you get past the first :: it's a regular 
namespace.

As an example, threads is a pragma, but threads::shared is a utility 
module.  See also DBD::mysql.

Of course the definitive place to ask for advice for module names is on
the modules list : http://lists.perl.org/showlist.cgi?name=modules


I've also found module-authors useful in the past: 
http://lists.perl.org/showlist.cgi?name=module-authors

--
Richard Clamp <[EMAIL PROTECTED]>




Re: books

2002-11-29 Thread Richard Clamp
On Fri, Nov 29, 2002 at 03:03:14PM +, David Cantrell wrote:
> The following are avaialbe now or over the next month or so if anyone who's
> not on the naughty list fancies taking a stab at reviewing them.  All from
> O'Reilly, and I've cut out a few I didn't think were particularly relevant:
> > Oracle in a Nutshell
> > http://www.oreilly.com/catalog/oracleian/

Zang!  Yes please.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: REVIEW: Extending and Embedding Perl

2002-11-28 Thread Richard Clamp
On Thu, Nov 28, 2002 at 04:30:41PM +, Shevek wrote:
> On Thu, 28 Nov 2002, Nicholas Clark wrote:
> 
> > On Thu, Nov 28, 2002 at 11:45:13AM +0000, Richard Clamp wrote:
> > 
> > [someone check this, please:]
> > 3: so this means if you're returning a reference to an array or hash from
> >your XS code, you only need to mark the top level reference as mortal; when
> >that things reference count drops to zero, everything it owns is dropped
> >by one. (I believe that this means the example on page 366 of Advanced
> >Perl Programming is wrong - it makes everything it pushes into an array
> >mortal)
> 
> IANAL, but doesn't making it mortal mean that it does not have a reference 
> "for you", as it were, i.e. it will be freed at the next FREETMPS, which 
> is correct, since if you're pushing it into an array, you don't want a 
> reference to it. Presumably (IANAL again) the push operation will add a 
> reference, so it now has 1, which is correct.

What's L in this case?

I can however say that your presumptions are wrong.  When you add
things to an AV by pushing it nothing ups up the refcount of them for
you.  av_push is implemented in terms of av_store, which has the
following note in perlapi.

 av_store
   Stores an SV in an array.  The array index is specified as
   "key".  The return value will be NULL if the operation failed
   or if the value did not need to be actually stored within the
   array (as in the case of tied arrays). Otherwise it can be
   dereferenced to get the original "SV*".  Note that the caller
   is responsible for suitably incrementing the reference count of
   "val" before the call, and decrementing it if the function
   returned NULL.

The last sentence is the kicker.

I guess that maybe you're thinking of returning things on the stack,
whereby you want to mortalise them, then your caller will up the
refcount when it takes the copies of the values[1] if it assigns the
values to something.

So that
my_sub(); # the mortalised SVs die
 @foo = my_sub(); # they live on within @foo;

[1] Unsurprisingly for perl it actually cheats and takes the entire SV
if it sees that it's mortal and about to disappear rather than copying
the structure about.  Yet another Cunning Optimisation.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: REVIEW: Extending and Embedding Perl

2002-11-28 Thread Richard Clamp
On Wed, Nov 27, 2002 at 10:36:04PM +, Mark Fowler wrote:
[reference counting] 
> Could you, or anyone else, give me a pointer to where this kind of thing
> is documented?

L, plus, if you're writing
some XS and think that you're leaking something, you can always try
Devel::LeakTrace (if the something is SVs) or valgrind (if the
something is regular malloced blocks). 

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: mod_perl2 (was) Re: [JOB]

2002-11-27 Thread Richard Clamp
On Wed, Nov 27, 2002 at 11:29:39AM +, Chris Ball wrote:
> There are a couple of things (not allowing a release to be deleted and
> re-uploaded, not allowing another maintainer to take over a namespace)
> that seem silly, but are security features.  It would be all too easy to
> upload a CPAN module that just ran `rm -rf /` in the test portion of its
> Makefile.  :(

It's all too easy even if you are the author:
   http://search.cpan.org/src/MJD/Memoize-1.01/Makefile.PL

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Candidates' attitudes

2002-11-25 Thread Richard Clamp
On Monday, Nov 25, 2002, at 14:30 Europe/London, S. Joel Bernstein 
wrote:

Do the candidates for leader feel that their attitudes and behaviour 
to new people in the irc channel are in line with the office of 
leader? Today we were visited by a new face, who has been active 
recently on the mailing list. Perhaps by virtue of some fault of their 
own, but probably due to the prevailing attitudes on the channel, some 
people were pretty rude to the new person.

One of those people is standing for leader of London.PM. My question 
is this: Is such rudeness appropriate, and is such an attitude what we 
are looking for in a leader?

I must say that I would find it extremely difficult to vote for 
somebody with such an abrasive personality, regardless of their 
technical skills. We aren't looking for a project manager, we're 
looking for somebody who will arrange social events and be (where 
necessary) the public face of the London Perl M[ou]ngers.

Just my tuppence.


Since your tuppence seems awfully unclear I'm going to paraphrase what 
I think you're really trying to say in several ways, each of them in my 
own completely biased way, and then answer those questions.

*/ What is the role of the groups leader when it comes to irc?

*/ (Could|should) there be a set of guidelines for the #london.pm, as 
there already are for the mailing list?

*/ I think $candidate is a rude bastard on irc.  I won't be voting for 
him, and neither should you.


Now that I've stacked the deck, here are my answers (they may fit the 
questions rather well, but I can't quite put my finger on why...)


*/ What is the role of the groups leader when it comes to irc?

I think pretty much the same as on the mailing list, to listen and ask 
the right questions (and yes, I do believe that the right question is 
sometimes "would you kindly shut the fuck up")

It's worth bearing in mind that #london.pm is only one aspect of the 
Dancing Monkey Machine which is London.pm, and that the leader is a 
member too and as such gets to be as irrational as the rest of the 
monkeys.


*/ (Could|should) there be a set of guidelines for the #london.pm, as 
there already are for the mailing list?

This depends largely on the existing users of the channel.  Certainly 
the pages on london.pm.org could stand to have a few general pointers 
to irc behaviour likely to annoy, what passes for top-posting in irc 
for example, to enable smoother integration of the new with the 
existing users of the channel (who at last count seem to account for 
40-odd connected users).

Oh, I just thought of a sub-question.  Who plays channel-admin to 
enforce any guidelines?  It's a much different role from list-admin, or 
even list-mom, since there's no subscription system;  plus there seems 
to be less encouragement for people to lurk before contributing to the 
channel often resulting in culture-clash.

*/ I think $candidate is a rude bastard on irc.  I won't be voting for 
him, and neither should you.

I think you might have someone in mind here :)

Of course it's entirely your vote, to spend as you wish.  I must say 
though, if you're hoping for a candidate who can't possibly insult 
anyone in any circumstance, I think you're best off voting for RON.

Before I finish I want to pull out one particularly odd statement:

I must say that I would find it extremely difficult to vote for 
somebody with such an abrasive personality, regardless of their 
technical skills. We aren't looking for a project manager, we're 
looking for somebody who will arrange social events and be (where 
necessary) the public face of the London Perl M[ou]ngers.

Appointing a project manager as leader would be a fine idea, and I 
think you're doing many project managers a big disservice if you think 
they're low on interpersonal skills.

--
Richard Clamp <[EMAIL PROTECTED]>




Re: Perl GUI Development

2002-11-25 Thread Richard Clamp
On Mon, Nov 25, 2002 at 04:05:47PM +, [EMAIL PROTECTED] wrote:
> > > On a slightly serious note: has anyone successfully used any GUI
> > > framework on both Unix and Windows with perl? I have a very simple
> > > little terminal type prog that I want to have work on both. 
> 
> Jarko did an excellent talk at YAPC::Europe 2002 about WxPerl and if

*cough* Jouke *cough*

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: The Peon's Guide To Secure System Development

2002-11-21 Thread Richard Clamp
On Thu, Nov 21, 2002 at 02:39:39PM +, Paul Makepeace wrote:
> On Wed, Nov 20, 2002 at 05:06:02PM +, Dominic Mitchell wrote:
> > Hands up all those on this list who've found a bug in perl at some 
> > point?  ;-)
> 
> I just found this while trying to be mildly evil on FWP,
> 
> my @test = ('a')x3;
> 
> for (my ($str, @tmp) = @test) {
> shift @tmp;
> }
> 
> SEGVs on 5.6.1 and 5.8.0. Is this already known?
> 
> Paul, not one of the porterscenti

Well you may be able to answer your own question by consulting the
perl5 rt queue at http://rt.perl.org/perlbug/.  Failing that you could
mail p5p directly and see if they mark it as a duplicate/fix it.

-- 
Richard Clamp <[EMAIL PROTECTED]>




the dog ate my manifesto

2002-11-17 Thread Richard Clamp
Dear voter, you may have noticed by now that I've not turned in a 
manifesto.  You may take this to mean any of:

* If elected I don't intend to change anything really
* This pseudo political stuff is too complicated for me to follow
* BRANES

Happy Voting

--
Richard Clamp <[EMAIL PROTECTED]>




Re: Weird Syntax

2002-11-14 Thread Richard Clamp
On Thu, Nov 14, 2002 at 09:33:30AM +, Dave Cross wrote:
> use strict qw($x);

> I may have missed something obvious. It was early when I ran these
> tests :)

It didn't turn strict on at all.  It called strict->import('$x'),
'$x' is not any form of stricture it knows about.

See also Acme::USIG.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Announce: Devel::LeakTrace

2002-11-13 Thread Richard Clamp
On Wednesday, Nov 13, 2002, at 17:00 Europe/London, Ben wrote:

I hacked this slightly to use stderr instead of stdout, in an attempt
to make it play nicely with mod_perl, but I'm getting this error:

Can't locate auto/Devel/LeakTrace/show_used.al in @INC (@INC contains: 

@INC path> ) at 
/usr/lib/perl5/site_perl/5.6.0/i386-linux/Devel/LeakTrace.pm line 14
END failed--call queue aborted.

It works fine if called from a normal script.

Any ideas?

My hunch is that the END block is getting triggered before INIT 
somehow, so the show_used symbol isn't getting bootstrapped - see if 
this helps:

Index: LeakTrace.pm
===
--- LeakTrace.pm(revision 910)
+++ LeakTrace.pm(working copy)
@@ -3,9 +3,12 @@
 require 5.006;
 use base 'DynaLoader';

-INIT {
+BEGIN {
 our $VERSION = 0.01;
 bootstrap Devel::LeakTrace $VERSION;
+}
+
+INIT {
 start_up();
 }


Though we should probably take this off list about now...

--
Richard Clamp <[EMAIL PROTECTED]>




Announce: Devel::LeakTrace

2002-11-12 Thread Richard Clamp
I just allowed this to escape to CPAN, more information in my use.perl
journal, and of course the original source.

Version 0.02 will probably have better docs, but I figure there's no
better way to see where the docs suck than to release it and see where
people don't get it.

http://use.perl.org/~richardc/journal/8901
http://mirth.unixbeard.net/svn/richardc/perl/Devel-LeakTrace-0.01/

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: My First CPAN Module... but comments first, please?

2002-11-12 Thread Richard Clamp
On Tue, Nov 12, 2002 at 11:08:41AM +, Dave Hinton at home wrote:
> 
> 
> I've written a module which I intend to release onto CPAN.  I've never done 
> this before, I haven't even registered on PAUSE yet.  So before I do that, 
> I'd appreciate it if people would have a quick glance at what I've written, 
> and let me know what major boo-boos my inexperience has caused :-)
> 
> The module is called Tie::Deref, but I'm having second thoughts and wondering 
> whether Alias::Lexical might not be a better name.

If you transpose those you hit Lexical::Alias, which does things at a
lower level than tying, and so is much quicker.

http://search.cpan.org/author/PINYAN/Lexical-Alias-0.03/Alias.pm

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: (no subject)

2002-11-08 Thread Richard Clamp
On Fri, Nov 08, 2002 at 05:54:32PM +, Richard Clamp wrote:
> On Fri, Nov 08, 2002 at 05:42:33PM +, Jasper McCrea wrote:
> > Ifin they ain't too big, try
> > 
> > "@array1" eq "@array2"
> 
> @array1 = qw( foo bar );
> @array2 = qw( foob ar );
> 
> They're not big, but they are still wrong :)

Or would be, if I'd remembered the default value for  $" correctly.

My apologies, I think I'm due a nap now.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: (no subject)

2002-11-08 Thread Richard Clamp
On Fri, Nov 08, 2002 at 05:42:33PM +, Jasper McCrea wrote:
> Ifin they ain't too big, try
> 
> "@array1" eq "@array2"

@array1 = qw( foo bar );
@array2 = qw( foob ar );

They're not big, but they are still wrong :)

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Books on london.pm.org (was Re: applying patterns)

2002-10-16 Thread Richard Clamp

On Fri, Oct 11, 2002 at 06:01:54PM +0200, Paul Johnson wrote:
> Simon Wistow said:
> 
> > Where would we be if we'd not bothered writing some Matt's Scripts
> > replacments on the assumption that nobody would pick them up. Or
> > written an extensible MLM in Perl on the assumption that despite having
> > whinged about it for ages nobody would actually care.
> 
> 
> Oooh, did I miss something?  Has someone (plural?) written (present
> tense?) a new MLM.

Yes indeedy. Plural, present (and mostly past), and new:
http://siesta.sourceforge.net/

I announced in the week before YAPC::Europe here, so maybe people just
didn't pick up on it.

It needs a few things pulling together for its first release, but it's
all self hosting and stuff.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Module Tests

2002-07-17 Thread Richard Clamp

On Wed, Jul 17, 2002 at 10:05:51AM +0100, Barbie wrote:
> Are there any decent tutorials or guides to writing tests for modules, apart
> from Schwern's Test::Tutorial?

His older talks are online here

http://magnonel.guild.net/~schwern/talks/

> If anyone is going to Schwern's "Writing a Test Library " talk next week I'd
> be very interested in knowing where his slides will be online.

I imagine that the writing a test library slides will eventually end
up there, but from the synopsis[1], this might not be the testing
guide you're looking for.

[1] http://magnonel.guild.net/~schwern/2002_Talks/Writing_A_Test_Library

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: more mailman

2002-07-07 Thread Richard Clamp

On Sun, Jul 07, 2002 at 11:48:29AM +0100, Simon Wistow wrote:
> On Sun, Jul 07, 2002 at 11:07:37AM +0100, Rob Partington said:
> > Perl people as insular protectionist loonies?
> 
> But it's *true*!

Maybe it is, but we needn't make it worse by acting like it's the only
way to be.

> 
> Seriously, there's some features missing in Mailman that I'd really like
> (see above mail(s)) and which other people would like. I'd patch Mailman
> if I could code Python but I think, actually, in the long run, it would
> be quicker to code up a replacement in Perl than to learn Python and the
> structure of Mailman and then start hacking in the stuff I want.

So suggest them to the people who actually know enough python and
mailman to do it.  If your idea also happens to scratch one of their
itches it'll might get done - stranger things have happened.

The only thing I can think of as worse than seeing a bunch of
programmers write a clone of mailman just so it's in their pet
language, is to then see them fill it with random crap that the
mailman people didn't even want.

> Speaking of which (but not really related to this thing) for the Perl6
> version of CPAN (both the repository and the installation module) I'd
> really like a better way to get applications installed - for example a
> Webmail app : I'd like to install the Modules, the templates, the
> images the docs and the example CGI script somewhere. True it can sort
> of be done at the moment but it should be easier.

This is surely just a case of the app developer simply writing a
Makefile.PL that has the right fields filled in to indicate which
extra things to install where.

If it's not right yet, well just improve it now.

> I'd also like to be able to search for functions on CPAN - for example
> when I was doing the Aronsons Sequence script trying to find a module
> that happened to have a function that took a number and turned it into
> its textual represention. It would have better if functions were marked
> in the module and you could search in that.

Why wait for perl6 for this too?

If these CPAN ideas really are useful, do them for perl5.  I don't
know what you expect perl6 to buy you, but I think trying to get new
untested ideas actually accepted by the people who implement 6PAN will
be harder than just saying "wouldn't it be cool if".

If they do just agree to every new suggestion they'll be ridiculous
spec creep.  If that happens my money is on recycling the existing
code "in the meantime" which'll never get replaced.

-- 
Richard Clamp <[EMAIL PROTECTED]>




meeting today, at the anchor

2002-06-06 Thread Richard Clamp

Since the weather seems not to be supporting our aims to clutter up
the benches outside the Anchor I'm going to have to suggest we
colonise upstairs, in the new part[0].  To get there head left as you
go in, then go up some stairs until you find a bar.

Pass it on.

[0] Yes I know it's the new part, and as such evil, but the old part
has no rooms big enough for everyone to fit in.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: [josette@oreilly.co.uk: Newsletter issue 02-9]

2002-05-29 Thread Richard Clamp

On Wed, May 29, 2002 at 07:26:11PM +0100, David Cantrell wrote:
> On Wed, May 29, 2002 at 03:33:49PM +0100, Paul Mison wrote:
> > London.pm have done lots of reviews too: http://london.pm.org/reviews/
> 
> I would find it useful to have the authors and publishers on the index
> page.  Or at least the authors, if there isn't room for both.

Dumb Question: Authors of the reviews, or the books?

Give me the info and I'll look at working up patches.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: [ANNOUNCE] Emergency pub reconnaissance, Tuesday 21 May

2002-05-03 Thread Richard Clamp

On Fri, May 03, 2002 at 08:20:10PM +0100, David Cantrell wrote:
> Founders Arms gets my vote.

Sorry, you don't count because you're not voting for the Anchor.

Only the old bits or outside though.

-- 
Richard Clamp <[EMAIL PROTECTED]>




ANNOUNCE: Acme::Magpie 0.01 released

2002-04-30 Thread Richard Clamp

We came up with the notion for this last social meeting, but I've only
got around to writing the code.

Winging it's way to your nearest CPAN mirror, or available here:
  http://unixbeard.net/~richardc/lab/Acme-Magpie/

-- 
Richard Clamp <[EMAIL PROTECTED]>


NAME
Acme::Magpie - steals shiny things

SYNOPSIS
 use Acme::Magpie;
 # oh no, some of the shiny methods have gone away

 no Acme::Magpie;
 # phew, they're back now

DISCUSSION
The Magpie is a bird know for stealing shiny things to build its nest
from, Acme::Magpie attempts to be a software emulation of this
behaviour.

When invoked Acme::Magpie scans the symbol tables of your program and
stores attractive (shiny) methods in the %Acme::Magpie::Nest hash.

Shinyness is determined by the return value of the shiny method this can
be redefined by child classes:

 package Acme::Magpie::l33t;
 use strict;
 use base qw(Acme::Magpie);

 sub shiny {
 ($_) = $_[1] =~ /.*::(.*)/;
 return tr/[0-9]// > tr/[a-z][A-Z]//;;
 }
 1;
 __END__

This magpie considers identifiers with more numbers than letters as
shiny. The code is installed with this distribution.

BUGS
Acme::Magpie will cause most of the code you use it in to die because
the subroutines it tries to execute just won't be there. This is
considered a feature.

AUTHOR
Richard Clamp <[EMAIL PROTECTED]>, original idea by Tom Hukins

COPYRIGHT
       Copyright (C) 2002 Richard Clamp.
   All Rights Reserved.

   This module is free software; you can redistribute it
   and/or modify it under the same terms as Perl itself.




Re: Website mirroring

2002-04-25 Thread Richard Clamp

On Thu, Apr 25, 2002 at 05:49:23PM +0100, Alex McLintock wrote:
> Any ideas or alternative web downloading programs?

wget seems to do what you want:

   wget --mirror --convert-links --backup-converted \
--html-extension -o /home/me/weeklog\
http://www.gnu.org/

   Or, with less typing:

   wget -m -k -K -E http://www.gnu.org/ -o
   /home/me/weeklog

--- From wget(1)

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: YAPC::E Auction (was Re: Advert : Apple Base Station)

2002-04-10 Thread Richard Clamp

On Wed, Apr 10, 2002 at 01:17:02PM +0100, [EMAIL PROTECTED] wrote:
>  There's an auction? Auctioning things to drunk people really isn't
> fair, you know...

No it happens during the day, when people could have hangovers.  This
could be more inhumane.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: penderel

2002-04-03 Thread Richard Clamp

On Wed, Apr 03, 2002 at 01:37:24PM +0200, Newton, Philip wrote:
> not). I was thinking of maybe installing a new perl of my own anyway (it's
> 5.7.2 or something like that at the moment), or perhaps I'll just use the
> system perl (which will be, what -- 5.6.1? 5.8.0? something else?)

I'd suggest that the system perl (/usr/bin/perl) be left to the mercy
of the distribution, and that multiple /usr/local/perl5.* installs are
probably going to scratch the widest selection of itches[1].

Of course then there's still the question of which perl to link
mod_perl against, if that's deemed desirable.


[1] I'll cough to a slight amount of bias since this is typically how
I run my machines.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Blade 2 ...

2002-03-29 Thread Richard Clamp

On Fri, Mar 29, 2002 at 03:34:54PM -0500, anathema wrote:
> YMMV, but if you have a brain, you may be disappointed.

Excellent.  I use my brain too much as it is, an excuse to completely
turn it off for an hour or so is often welcomed.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: C speed

2002-03-27 Thread Richard Clamp

On Wed, Mar 27, 2002 at 01:58:59PM +, Simon Wilcox wrote:
> use constant DEBUG => 1;
> my $debug = 0;

Spot the difference.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Just pondering

2002-03-27 Thread Richard Clamp

On Wed, Mar 27, 2002 at 01:36:56PM +, Richard Clamp wrote:
> On Wed, Mar 27, 2002 at 05:19:30AM -0800, Dave Cross wrote:
> > From: "iwilliams" <[EMAIL PROTECTED]>
> > > What's the performance hit? Probably worth a benchmark - 
> > > being careful about judging the effects of optimisation.
> > 
> > Having tried it, I find the results a bit hard to believe. Am
> > I doing something stupid?
> 
> Yes.  Time them as subs.

As subs (where perl gets to do constant folding)

richardc@mirth:~/lab/tsc% perl5.6.1 test
Benchmark: running Constant, constant, scalar, each for at least 3 CPU seconds...
  Constant:  3 wallclock secs ( 3.22 usr +  0.00 sys =  3.22 CPU) @   74025.78/s 
(n=238363)
  constant:  4 wallclock secs ( 3.47 usr +  0.01 sys =  3.48 CPU) @ 2191933.33/s 
(n=7627928)
scalar:  4 wallclock secs ( 3.08 usr +  0.01 sys =  3.09 CPU) @ 1697149.19/s 
(n=5244191)


so that's tying at a factor of several squillion times slower.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Just pondering

2002-03-27 Thread Richard Clamp

On Wed, Mar 27, 2002 at 05:19:30AM -0800, Dave Cross wrote:
> From: "iwilliams" <[EMAIL PROTECTED]>
> > What's the performance hit? Probably worth a benchmark - 
> > being careful about judging the effects of optimisation.
> 
> Having tried it, I find the results a bit hard to believe. Am
> I doing something stupid?

Yes.  Time them as subs.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Just pondering

2002-03-27 Thread Richard Clamp

On Wed, Mar 27, 2002 at 01:27:55PM +, Richard Clamp wrote:
> often useful.  And there's also the speed thing pne picked up on already.

Doh, I mean Paul Makepeace.  Too many names starting with P, or
something.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Just pondering

2002-03-27 Thread Richard Clamp

On Wed, Mar 27, 2002 at 04:31:37AM -0800, Dave Cross wrote:
> 
> This idea popped into my head yesterday and I'd appreciate comments.
> 
> People don't like the "use constant" pragma. The main problem
> seems to be that the constants it returns are subroutines in
> disguise and therefore don't interpolate in double-quoted strings
> as expected.

or exactly as expected,  I really wouldn't want someone to come along
and boobytrap my code:

print "the time is ".localtime;

with

use constant the => 'the arsebiscuits are ready sir';


If I was really reliant on constants then is 

  print "the ".WORD_FOR_TIME." is ".localtime;

so bad in this pathological case?

> Tieing is a good way to make objects look like standard Perl
> variables with non-standard behaviours. Tied variables _do_ interpolate
> in double quotes.

As is overloading objects.  Be careful though, everything starts to
look like a nail when you learn how to write tieclasses.

> Is this a) crack-fuelled, b) so obvious that everyone's already
> done it, c) a complete waste of time as some other even better
> implementation of constants is just around the corner.

a) and b).  c) is subjective, since I don't really use constants, but
I also don't think that C is broken.

b) because it smells like access::readonly, or Hash::Util::lockdown,
or whatever the hell it's called this week.  Certainly there will be
something like this in some module soon, probably the Scalar-ListUtils
stuff.



By making them readonly variables, you lose constant folding, which is
often useful.  And there's also the speed thing pne picked up on already.

Also, doing it at an attribute on lexicals makes it reliant on 5.8
features.  It's my strong suspicion that anyone who has a problem with
constant subs not interpolating neatly will also have issues with
moving to 5.8.  Maybe you could use some alternate notation.

constant $scalar = "something";

and then do something source filtery.[1]


[1] No I don't like that suggestion, but while the crack pipe is out
we may as well indulge.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: object madness?

2002-03-27 Thread Richard Clamp

On Wed, Mar 27, 2002 at 11:33:09AM +, Rob Thompson wrote:
> OK... does anyone know of any good reason why I shouldn't do this to 
> determine which packages/objects I use at runtime?

Not really, you have a slight style nit here though.

>  #!/usr/local/perl5/bin/perl -w
>  use strict;
>  my $objtype = "object1";
>  eval "require report::$objtype;";
>  my $myobject = $objtype->new();
>  my $objtype2 = "object2";

Here you're expecting the file report/object1.pm to just define the
C namespace, but ideally it'd define C
instead.  

It's also considered better style to have your packages use
StudlyCaps::Names since all lowercase names are reserved for pragmas.

Otherwise it's fine, assuming you launder $objtype accordingly.
People (well I) do this all the time.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Me too

2002-03-22 Thread Richard Clamp

My slides from last night lurk here:

http://unixbeard.net/~richardc/lab/talks/acme-your/acme-your.slides/

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: addiction

2002-03-21 Thread Richard Clamp

On Thu, Mar 21, 2002 at 03:14:19PM +, Simon Wistow wrote:
> It's probably the simplest but most deadly drinking game ever devised by
> man (or woman). There is one rule - watch a Nik Cage film (we watched
> Gone in 60 Seconds) and drink everytime he looks perplexed.

No no no.  It's Pensive.

He mostly looks perplexed/confused, but occasionally flips into
pensive.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Testing my tests

2002-03-08 Thread Richard Clamp

On Fri, Mar 08, 2002 at 06:19:26PM +, Simon Wilcox wrote:
> 
> So I've written a module, complete with docs and tests.
> 
> What's the best way (if there is a way) to figure out if I've tested
> everything I should test ?

A good tool to look at is Devel::Cover.  Assuming you're using
MakeMaker, add this to your Makefile.PL

sub MY::postamble {
return <.  Your target is 100% statement coverage.

> How should I structure my tests for maintainability if I'm repeating tests
> with different values ?

I generally group them by function that I'm testing.

> Why can't my code Just Work [tm] so I don't have to write all these
> fecking tests ? [1]
> 
> Simon.
> 
> [1] That's a rhetorical question :-)

I normally find that they're more useful from the point of not
accidentally breaking everything at some point down the line and being
unaware of it.  Also it lets me nail down api conventions by having
real uses of the interface.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Is This For Real?

2002-03-08 Thread Richard Clamp

On Fri, Mar 08, 2002 at 07:46:26AM +, Dave Cross wrote:
> <http://www.cgi101.com/discuss/article.cgi?6478>

For those playing the offline mail game it's this:

---
Article #6478
Subject: london
Author: yoyo
Posted: 3/7/2002 08:21:21 PM


what does London.pm do and where can I download it?

---

This is me again, and not the original poster trying to fake you out,
honest.

I think it's fair to say that London.pm is not only an effective
hangover simulator, but also a fine IPC mechanism, where the P is
Person rather than Process.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Social Meeting

2002-03-06 Thread Richard Clamp

On Wed, Mar 06, 2002 at 11:18:07AM +, Alex McLintock wrote:
> What time would people get there?

>From http://london.pm.org/meetings/

: What time do meetings start ?
:
: Social meetings start after work, e.g. when people get there,
: usually starting around 6pm (although people are still arriving until
: 8.30, often).

> RSA code on badges? t-shirts with O'Reilly animals on them? suits *and* 
> beards?

All of the above?  

>From what I understand there'll also be some signs to guide people
into the cellar bar this time.  Assuming the same goes as for last
time, we'll be in the back half of the bar.

> You can recognise me because I have a goatee and will be carrying a black 
> rucksack full of books.

Does it have a see-through window?  I think even among geeks it's rude
to stop and search everyone carrying rucksacks, though I've been wrong
about less before.

-- 
Richard Clamp <[EMAIL PROTECTED]>




module naming

2002-03-04 Thread Richard Clamp

Say if I were to figure out what versions modules were shipped with
each release of perl were[0], so that I could write some code to
figure out what were CPAN dependencies for a given module, where would
I put it?

I'm currently looking at $Module::Core::List{'5.6.1'}; but it doesn't
seem quite right.

Suggestions please.

[0] Currently done for 5.005_03 and 5.6.1, as they were handy.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: language extensions

2002-03-01 Thread Richard Clamp

On Fri, Mar 01, 2002 at 03:08:32PM +, Simon Wistow wrote:
> Damian's written Switch, Marcel's written a thousand and one
> Attribute::Handler modules, there's Source Filters and a shed load of
> other Language Extensions that essentially change the syntax of the
> language [0] ...
> 
> 
> ... so. Who uses them?

Search me.  I plan to use Sub::Parameters for fun and profit (or as
some people call it, $dayjob) once I've got it ported back to
5.005_03, but I'm biased.

> If you're anything like me then you have some unexplained aversion to
> using them. No, I don't know why either. Why is that?

Because adding regional dialects would be confusing - much like
Londoners going to Wales and getting hung up on the accents.

Or maybe it's just that Perl is flexible enough as it is, and
extending it's syntax isn't really a need that has to be scratched.

> Has *anybody* written a Source Filter that does anything useful

Depends on if you count Acme::Your as useful.  It certainly does funky
stuff - introducing the C and  classes of variables, which
are similar in texture to C variables but not quite.  It possibly
doesn't count cause it was really a joke.

I've been kicking around the idea of a source filter to go with
http://search.cpan.org/search?dist=Exception-Class, which would simply
turn:

 try {
   throw Foo;
 }
 catch Foo {
   print "caught a foo";
 }

into 

 eval {
   throw Foo;
 }
 if (blessed $@ && $@->isa('Foo')) {
   print "caught a foo";
 }

just so people could write exceptions in the java-centric terms
they've become used to and stop declaring that Perl doesn't support
exceptions.

But I only had the idea on Tuesday, so I'm still waiting on tuits.

> (Acme::Buffy doesn't count).

Because it isn't really a source filter, or because it simply
obscures, rather than enhances the language?

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: rsync and mutt woes

2002-02-25 Thread Richard Clamp

On Mon, Feb 25, 2002 at 11:29:25AM +, Simon Wistow wrote:
> On Mon, Feb 25, 2002 at 10:51:44AM +, Roger Burton West said:
> > Or use something other than mutt to tell you which mailboxes have new
> > messages in them. xbuffy/gbuffy, if you're using an X desktop, for
> > example.
> 
> I'm, err, not. 
> 
> Unless I decide to run an X connection over ssh aswell. Which I don't
> want to.

So gut the X app and turn it into a console-based one.  The trick for
identifying which messages are new won't be X-specific after all.

Alternatively I've found I like maildirs.  They're a little more work,
but identifying new messages is just a case of

(ls Maildir/new ; ls Maildir/cur | grep -v ':2,[A-R]?*S[T-Z]?$' ) | wc -l

And identifying which folders have new stuff is just when
Maildir/{cur,new}/ was modified later than Maildir/


-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: How to optimise slow perl scripts?

2002-02-19 Thread Richard Clamp

On Tue, Feb 19, 2002 at 03:31:17PM +, Nicholas Clark wrote:
>  However perlbench went slower because I'd made
> /(.{1,76})/ slower (used in string/base64.t). How many people use {} in real
> regexps?  IIRC There are almost none in any script used to build perl.

I think I used {} for the first time in anger yesterday.  I'm
currently finding it hard to grep for regexes, but I'm fairly certain
I've not used it before.

This is worrying code, but not for the usual reasons:

my $store = pack 'u', freeze $data;

# two magic numbers, 4+8 == 12 and 128. constraints of the XXX table
my $i;
for my $value ( $store =~ m/.{1,128}/g ) {
my $variable = sprintf('perm%08d', $i++);

$set_sth->execute($userid, $variable, $value)
  or die $set_sth->errstr;
$set_sth->finish();
}

I hate not being able to just create database tables that fit the
needs of the application.

> There must be easier ways than this :-)

I think I said that too :)

-- 
Richard Clamp <[EMAIL PROTECTED]>




ANNOUNCE: Pod::Coverage 0.10

2002-02-18 Thread Richard Clamp

There's a new release in town.  It scratches off one of the oldest
TODO items, that of counting the docs in the base class(es) towards
your packages coverage.

 Version 0.10 2002-02-18
Added Pod::Coverage::CountParents which counts the Pod sections from
higher in the inheritance tree (it walks @ISA).

Refactored "_get_pods" into its own method to allow this.

On your local CPAN mirror very soon, or here sooner:
http://unixbeard.net/~richardc/lab/Pod-Coverage/Pod-Coverage-0.10.tar.gz

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Bolloxia

2002-02-18 Thread Richard Clamp

On Mon, Feb 18, 2002 at 03:17:07PM +, Chris Ball wrote:
> >>>>> "Barbie" == phughes   writes:
> 
> Barbie> And perhaps not too surprisingly the intelligence of the
> Barbie> average person has been declining.
> 
> It has?  I wouldn't say so.  I'd say that search engines and net access
> make us more intelligent than we've ever been, if you equate
> intelligence to problem-solving.

Umm, okay, but what happens to the people who don't have access to the
internet?  As much as it might feel that everyone has it, that's not
so.

Also, in the same way that access to recipes doesn't get you more
people who understand the chemical processes involved in cooking.

This I will also call the script kiddie clause.

It feels to me like there's a gap that's getting bigger, dumb fucks
one end, self-congratulatory brain cases on the other.  The bell curve
is more like a molar now, or boobies.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: crack check

2002-02-18 Thread Richard Clamp

On Mon, Feb 18, 2002 at 03:01:02PM +, Richard Clamp wrote:
> It also seems it wasn't quite original thinking of my own:
> http://dev.perl.org/rfc/342.pod  But I don't know how the apocalypses
> have rated that rfc. 

I realised I was being too lazy, and looked:  

Apoc4 states:

-
RFC 342: Pascal-like "with"

I expect Perl's parsing to be powerful enough that you could write a
"with" if you wanted one.
-

Cool :)

http://www.perl.com/pub/a/2002/01/15/apo4.html?page=8#rfc%20342:%20pascallike%20with

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: crack check

2002-02-18 Thread Richard Clamp

On Mon, Feb 18, 2002 at 02:36:53PM +, Rob Partington wrote:
> In message <[EMAIL PROTECTED]>,
> Richard Clamp <[EMAIL PROTECTED]> writes:
> > From the nice features from Turbo Pascal, brought to Perl department:
> > Okay, strangely inspired by Russells Pixies tribute, and a few bottles
> > of beer, I noticed Perl doesn't have a C operator.
> 
> Ruby does, kinda, if you count silly hacks by me.
> 
> http://frottage.org/rjp/ruby/with.html 

Object#method_missing being like AUTOLOAD I'm guessing.

> It would be nice to have it in the core though.

Hmm, only if that's the only way you can do it.  I like the notion
that I'll be able to add proper keywords with perl6.  

It should be fairly doable to make it happen as a module, I think, but
I'm also of the "the core distribution should be just big enough to
bootstrap CPAN(PLUS)?" faith.

It also seems it wasn't quite original thinking of my own:
http://dev.perl.org/rfc/342.pod  But I don't know how the apocalypses
have rated that rfc. 

> > Oh wait, I've just realised that's pretty much what C does.
> 
> Wassat den?

http://search.cpan.org/doc/GSAR/Alias-2.32/Alias.pm

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Bolloxia

2002-02-18 Thread Richard Clamp

On Wed, Jan 09, 2002 at 02:34:38PM -, Barbie wrote:

Your system clock is way out.  Start hiding from Herr Mison now :)

-- 
Richard Clamp <[EMAIL PROTECTED]>




crack check

2002-02-18 Thread Richard Clamp

>From the nice features from Turbo Pascal, brought to Perl department:

Okay, strangely inspired by Russells Pixies tribute, and a few bottles
of beer, I noticed Perl doesn't have a C operator.

 my %foo = ( 
 foo => [qw( bar baz )], 
 bar => { key => 'value' }, 
 );
 my $baz = 'outside';
 with %foo {
 print $bar{key}; # prints 'value'
 print $foo[1];   # prints 'baz'
 print $baz;  # prints 'outside'
 };

Oh wait, I've just realised that's pretty much what C does.

Tum te tum.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Milan (was Re: User Input at speed)

2002-02-18 Thread Richard Clamp

On Mon, Feb 18, 2002 at 03:23:49AM +, Lucy McWilliam wrote:
> Is that like "wanna see my etchings?"?.  Am I going to be the only one
> without a laptop?

Probably not.

I'm currently finding the pan and paper in pocket, computer on desk
thing to help my brain more than always having a laptop to hand.  This
is after being a constant laptop user for ~3 years.  Being constantly
able to hack just seems to lead to windmill chasing for me.

Of course I may have converted back to the church of laptops come
conference season, what with doing last-minute slides and stuff.

> Do you do the squeezy squeezy thing on fruit?

No, but I'm saving up for one of these: (potentially offensive/not
work safe/you're all a bunch of girls if you complain)
 http://www.penny-arcade.com/view.php3?date=2002-02-11&res=l

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Emergency Social Meeting Wednesday next

2002-02-13 Thread Richard Clamp

On Tue, Feb 12, 2002 at 05:49:55PM -0800, Paul Makepeace wrote:
> Is this Wed as in Feb 20th? Hope so, my American adventure Part I
> will've ended & I'll be back in the UK then (since this Friday)...

I'm afraid to say no, it's today, the 13th.  The first post in this
thread happened last Tuesday.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: Youth hostel for YAPC::Europe?

2002-02-12 Thread Richard Clamp

On Tue, Feb 12, 2002 at 09:27:07PM +, Jonathan Stowe wrote:
> Is there an 'Old Gits Hostel' too ;-}

I suspect they'll have to make their pension stretch to a hotel.
Start eating catfood now.


-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: projects

2002-02-11 Thread Richard Clamp

On Mon, Feb 11, 2002 at 12:16:44PM -, Jonathan McKeown wrote:
> and on Sunday 10 February 2002 01:31 +0000 Richard Clamp wrote:
> 
> [and how he does deeply disturbing perlguts-type stuff but doesn't want to
> discuss it on london.pm in case he scares people]

And also that there are scary people who I'm not reaching through
London.pm.  That bit was more to the foreground of my thinking, though
the crossover I perceived with this thread crossed the streams :)

> One of the things I like about london.pm is that no-one has asked me to
> prove my credentials or suggested that I'm not clever enough to listen to
> advanced stuff: I can turn up to a tech meet, or read the list, and see
> stuff that either baffles or scares me (or both) and feel that although I'm
> not at that level of knowledge, I'm in a group that has members who are and
> where I am welcome.

Yeah, I like that too, and I don't really want to stop that.  I'm just
aware that not everyone is of the same mind, but maybe my experiences
are atypical.  From the posts so far I'm starting to be convinced that
they are.

Greg, did you get anyone responding to your question off-list?
Warnocks Dilemma is setting in.  Do the same people who don't get
involved in projects also not participate in mailing list threads
about why?  Gah.  Undercaffinated.

> I would find it a shame if all the brain-stretching
> stuff migrated to another list: I like to know someone's doing it even if I
> don't understand it.

There's always subscribing to the hypothetical list, I certainly
wouldn't want such a thing to be exclusive to lurkers/other seekers of
knowledge, if I even want it - I'm getting less certain of the need as
time passes.

The London.pm is list would be even more high-volume if it took all of
the brainwash/nms/p5ee/latest craze traffic too.  There's already a
well established tradition of other mailing lists that members of
london.pm may be interested in participating in.

Forgive me, I seem to be thinking too much, but I'm losing track of if
they're even useful things to be thinking on.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: projects

2002-02-09 Thread Richard Clamp

On Fri, Feb 08, 2002 at 08:42:08PM +, Greg McCarroll wrote:
> 
> Out of interest, who here, in the last year or so have avoided getting
> involved in some project, such as NMS, Perl Certification, One day
> conferences, early P5EE discussions etc. etc. Because they felt they
> were "too junior" or "too outside the circle" to be involved. Or even
> simply haven't responded to a technical query.

I used to work with a really competent guy who constantly resisted
attending meetings because as he told me "I don't know that much
Perl", which in addition to being wrong, was a real shame that he
should have that assumption.

On the one occasion that I did convince them to attend it was the
pre-YAPC::London meeting, which was some rehearsals of some peoples
talks - which unhappily confirmed all of his previous misconceptions
that London.pm is some form of advanced technical group - and he's not
been since.

That was sucky timing, since a technical meeting isn't always the best
way to ease someone into the Perl experience, especially if they doubt
their abilities.

> I am very curious about this.

Me too.  :)

Actually this afternoon I was thinking a little about making a
deliberate break to do things the other way.  I'd best explain that a
little I think.

Recently I've had cause to do some deeply disturbing things up-close
and personal with the optree, which later became sufficiently
encapsulated hacks[0].  Now for this there isn't really a mailing list
I know where I could post to, and get useful input.

Well no, that's a fib, I could have used London.pm, lots of deeply
scary people seem to read it, but I didn't want to since

  a) I'd have missed some out.
  b) that's not what London.pm necessarily is, to me at least.
  c) possibly related to what you're thinking on (if I squint and
 make some assumptions) I don't really want to risk frightening
 the people who don't feel confident[4] with my talk of optrees
 and pads.

Some of this stems from a related hunch that 80% of Perl hackers don't
want or need to know about the guts of perl, and not knowing the guts
in no way prevents you writing good code.

Now if it was domain specific then I could have probably used that
list.  perl-qa was the lucky recipient of some of my ramblings about
Pod::Coverage while I was still bashing on it heavily.  But for things
like "how to I implement Devel::Caller called_with" I wouldn't really
expect anyone who doesn't follow p5p to even follow that, and p5p is a
little busy to explore this bit of code with me.

So, I was thinking of hunting down/creating some form of advanced
[Pp]erl list, for people interested in the guts though not necessarily
in hacking on them directly.  Currently though I'm thinking this is
potentially a PR nightmare of sorts "internals-chat is just too geeky,
and that's Perl, so Perl must be too geeky".  Also expert forums
always seem to have greater problems in taking in new blood, if only
because of the "you must be this tall to follow this" signs that tend
to get implied.

The signs are leading to this probably not happening, unless a few
people speak up and say it's a good thing.

Anyway, I'm interesting in peoples take on this.


[0] I find myself babbling this phrase to myself and others
recently[2], and it's all Schwerns fault, though it predates his
talk of the same name[1].

[1] If you didn't see this at YAPC::Europe, or just feel like
revisiting it, it's here, and quite funky:
  http://pobox.com/~schwern/talks/Sufficiently_Encapsulated_Hacks/

[2] And "Out, out damn spot!", but that's mostly to myself, and the
voices

[3] Footnote 3 was originally to do with London.pm being my home
group, though in some ways it should really be Birmingham.pm, who
I'll be catching up with on their meeting this month on Wednesday
13th.  The referrer was edited out for length, which this framing
completely reinstates.  Oh well.

[4] Lack of confidence being in no way related to lack of skill[5]

[5] Though as Dave has recently pointed out, lack of skill and high
confidence isn't an impossible combination (though it can result
in impossible people :)

-- 
Richard Clamp <[EMAIL PROTECTED]>
   do you believe in the one big song?




Re: gcov/xs trickery.

2002-02-09 Thread Richard Clamp

On Sat, Feb 09, 2002 at 05:25:27PM +0100, Paul Johnson wrote:
> I suspect that adding -O0 to the flags would be useful, otherwise the
> optimiser can remove some of the contructs you are trying to test.

Good call.

> > Then C and poke around at the generated Foo.xs.gcov
> > results.
> 
> I have been (slowly) investigating how to integrate gcov with the
> backend of Devel::Cover.  I deliberately designed the backend to be
> language agnostic.  Unfortunately, I've not had much time to work on it
> recently.
> 
> One thing has become very apparent though.  Perl still has many untested
> corners.

We were speculating a little about that too.  63% is certainly better
than my most cynical guess, and with enough room for improvement that
it looks like it could be grounds for sufficient fun.

Is the code you used due for a release soon?  Can I make it go faster
by asking less dumb questions?  And where do bees come from?

> Here's where I'm up to.  This is from a debugging bleadperl last night:

I was going to look at both those things tomorrow, but I'm more than
happy to let you have it.  It gives me time to arrange going to
conferences and practice breaking things.

While the thought is in my brain, are you planning to talk at any
conferences this year?  I know I'd like to see a Devel::Cover
flavoured talk, and I suspect I'm not alone.

It's also helped me enough recently retrofitting tests to some code at
work that I suspect that I owe you at least a drink or six.

-- 
Richard Clamp <[EMAIL PROTECTED]>
   do you believe in the one big song?




gcov/xs trickery.

2002-02-08 Thread Richard Clamp

Last night at the London.pm meeting I mentioned to Nick Clark that I
was puzzling over the problem of ensuring suitable test coverage for
.xs modules, to which he kindly put me out of my misery and pointed me
at gcov.

This is the recipie I'm currently working on.  It's a little messy,
and guaranteed fragile, but it works for me, and that's a step
forwards.

In Makefile.PL add:

sub MY::postamble {
return < and poke around at the generated Foo.xs.gcov
results.

-- 
Richard Clamp <[EMAIL PROTECTED]>




ANNOUNCE Sub::Parameters 0.03

2002-02-02 Thread Richard Clamp

0.03 just escaped[0], and now it even works with perl 5.6. (Only
tested with 5.6.1 so far)

Now you too can have readwrite parameters in your perl programs, just
like this:

 sub foo :WantParams(named) {
 Param( my $foo = 'rw' );
 $foo = 'changed';
 }

 my $bar = 'bar';
 print $bar; # prints 'bar'

 foo(foo => $bar);
 print $bar; # prints 'changed'

Funky or what?

If you're l33t enough to be running a copy of bleadperl you can even
use attributes for the variable declarations, which are much cuter.

 my $bar : Parameter(rw);

Work will now commence on forcing this further and further back in
time, next stop 5.005_03.

As ever, lurking here before it gets to CPAN:
 http://unixbeard.net/~richardc/lab/Sub-Parameters/

[0] Taking a less broken Devel::Caller with it, oopsie.

-- 
Richard Clamp <[EMAIL PROTECTED]>




ANNOUNCE Devel::Caller

2002-02-02 Thread Richard Clamp

This scratches my itch by doing interesting things with the optree to
find out how a subroutine was called.

It should mean that Sub::Parameters can now be made to work for perls
all the way back to 5.005_03.

Snag it from http://unixbeard.net/~richardc/lab/Devel-Caller/ or CPAN

-- 
Richard Clamp <[EMAIL PROTECTED]>


NAME
Devel::Caller - meatier versions of "caller"

SYNOPSIS
 use Devel::Caller qw(caller_cv);
 $foo = sub { print "huzzah\n" if $foo == caller_cv(0) };
 $foo->();  # prints huzzah

 use Devel::Caller qw(called_with);
 my @foo;
 sub foo { print "huzzah" if \@foo == (called_with 0)[0] }
 foo(@foo); # should print huzzah

DESCRIPTION
caller_cv($level)
"caller_cv" gives you the coderef of the subroutine being invoked at
the call frame indicated by the value of $level

called_with($level, $names)
"called_with" returns a list of references to the original arguments
to the subroutine at $level. if $names is true, the names of the
variables will be returned instead

constants are returned as "undef" in both cases

BUGS
All of these routines are susceptible to the same limitations as
"caller" as described in "caller" in perlfunc

The deparsing of the optree perfomed by called_with is fairly
simple-minded and so a bit flaky. It's know to currently chokes
structures such as this:

   foo( [ 'constant' ] );

Also, on perl 5.005_03

   use vars qw/@bar/;
   foo( @bar = qw( some value ) );

is broken as it generates real split ops rather than optimising it
into a constant assignment at compile time as in newer perls.

SEE ALSO
"caller" in perlfunc, PadWalker, Devel::Peek

AUTHOR
Richard Clamp <[EMAIL PROTECTED]> with close reference to
PadWalker by Robin Houston

COPYRIGHT
Copyright (c) 2002, Richard Clamp. All Rights Reserved. This module
is free software. It may be used, redistributed and/or modified
under the same terms as Perl itself.




Re: botch to prevent a warning

2002-02-01 Thread Richard Clamp

On Fri, Feb 01, 2002 at 03:40:53PM +, Nick Cleaton wrote:
> The real problem seems to be that the CGI.pm that comes with Perl
> 5.00404 (version 2.36) doesn't have those variables, so even when
> I 'use CGI' I get the warnings under 5.00404.

Ah, but 2.36 doesn't even check those variables, so it probably
doesn't have that behaviour either.  Is it impossible to upgrade
CGI.pm to something less ancient?  The only place I could find a
version of CGI.pm 2.36 was in the perl5.004.tar.gz source bundle, with
the rcsid:

$Id: CGI.pm,v 2.36 1997/5/10 8:22 lstein Exp $

Nineteen ninety seven!  I'd doubt I was even born back then, but I
have albums older than that :)

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: botch to prevent a warning

2002-02-01 Thread Richard Clamp

On Fri, Feb 01, 2002 at 01:27:58PM +, Simon Wistow wrote:
> On Fri, Feb 01, 2002 at 01:10:06PM +, Nick Cleaton said:
> > "./try" or "perl -w try" would be better tests.
> 
> Ah, I thought that Perl parsed the shebang line even if it was passed
> the program as a filename

It does.  In your tests the use of CGI.pm defines the symbols, so
you're not going to get a used once warning from them no matter how
hard you prod them.

> /me learns something new everyday

First reproduce the bug, then fix it?

Careful how you write tests, lest bugs become Heisenbugs?

Embrace really are quite whiny?

Mine was the latter.

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: botch to prevent a warning

2002-02-01 Thread Richard Clamp

On Fri, Feb 01, 2002 at 01:03:57PM +, Simon Wistow wrote:
> which leads me to suspect that my definition of works is wrong.

No, just your understanding as to why your solution works.  By using
CGI you're queering your own test. (See after sig)

Of course that does make me wonder why the OP doesn't just use CGI,
and see the pain fade.

-- 
Richard Clamp <[EMAIL PROTECTED]>


richardc@mirth:~% perl -v | head -2 ; for i in foo bar baz ; do echo --- $i ; cat $i ; 
echo --- ; perl -w $i ; done

This is perl, v5.6.1 built for powerpc-linux
--- foo
{
  local $^W = 0;

  $CGI::DISABLE_UPLOADS = 1;
  $CGI::POST_MAX= 100;
}
---
Name "CGI::POST_MAX" used only once: possible typo at foo line 5.
Name "CGI::DISABLE_UPLOADS" used only once: possible typo at foo line 4.
--- bar
use CGI;
{
  local $^W = 0;

  $CGI::DISABLE_UPLOADS = 1;
  $CGI::POST_MAX= 100;
}
---
--- baz
use CGI;
$CGI::DISABLE_UPLOADS = 1;
$CGI::POST_MAX= 100;
---
richardc@mirth:~%





Re: botch to prevent a warning

2002-02-01 Thread Richard Clamp

On Fri, Feb 01, 2002 at 11:40:39AM +, Simon Wistow wrote:
> Yeah, I didn't have quick access to an early Perl. Should have included
> more disclaimers.

Is now when I mention it doesn't work on 5.6.1 or blead too?

What are you counting as a non-early Perl?

-- 
Richard Clamp <[EMAIL PROTECTED]>




Re: botch to prevent a warning

2002-02-01 Thread Richard Clamp

On Fri, Feb 01, 2002 at 11:05:49AM +, Simon Wistow wrote:
> 
> {
>   local $^W = 0; 
>   $CGI::DISABLE_UPLOADS = 1;
>   $CGI::POST_MAX= 100;
> }
> 
> 
> ?

I'm assuming the ? is because you haven't tried it, right?

Didn't wfm on 5.005_03 anyhow.

-- 
Richard Clamp <[EMAIL PROTECTED]>




  1   2   >