Re: Forthcoming Meetings

2001-06-01 Thread Robin Houston

On Tue, May 29, 2001 at 02:09:56PM +0100, Cross David - dcross wrote:
 Technical Meeting: Thursday 21st June
 
 Need a venue for this please people. And speakers. If any speakers want to
 practise TPC or YAPC::E talks, then this might be a good time to do it.

Since I've already practiced my YAPC::E submission on you lot, it
would be unfair to do it again.

But I could do something about Perl regular expressions and
algorithmic complexity. That would be fun :-)

 .robin.



Re: Forthcoming Meetings

2001-06-01 Thread Robin Houston

On Fri, Jun 01, 2001 at 11:28:20AM +0100, Dave Hodgkinson wrote:
 Robin Houston [EMAIL PROTECTED] writes:
 
  But I could do something about Perl regular expressions and
  algorithmic complexity. That would be fun :-)
 
 Robin, can we have a whip round and pay you NOT to do it? My head
 always hurts after one of your talks...

I *think* that's a compliment ;-)

BTW, I'm going on holiday tonight, for two weeks.
So if you start to wonder why I'm not answering email, that's why :)

 .robin.

-- 
select replace(a, CHR(88), replace(a,,'')) from (
select 'select replace(a, CHR(88), replace(a,,)) from (
select ''X'' a from dual)' a from dual)



Re: General Election

2001-06-01 Thread Robin Houston

On Fri, Jun 01, 2001 at 01:55:20PM +0100, Cross David - dcross wrote:
 The New Labour version starts like this:
 
 The people's flag is lightest pink,
 It's not as red as you might think.

How things have changed.

'Mr Heseltine, whose mane of golden hair has given him the nickname
 of Tarzan, apologised for waving the ceremonial mace around his head
 like a mediaeval battle axe. I was unwarrantably provoked by the
 singing of the Red Flag, he said.'

http://www.guardiancentury.co.uk/1970-1979/Story/0,6051,106906,00.html


The internationale is a better song though.

 .robin.



Re: O'Reilly Safari - anyone use it?

2001-05-19 Thread Robin Houston

On Fri, May 18, 2001 at 11:30:28PM +0100, Barry Pretsell wrote:
 It sounds like a good idea (must be better than having 3 editions
 of Programming Perl) and I'm tempted to give it a go, so any Safari
 subscribers out there with an opinion?

Don't forget the ever-fabulous http://corvin.spb.ru/

 .robin.

-- 
God! a red nugget: a fat egg under a dog.



Re: Ken Campbell is a god (was: pc components)

2001-05-18 Thread Robin Houston

On Fri, May 18, 2001 at 06:05:44AM +1000, Damian Conway wrote:
 Im nogat samting til ridim insait long pastaim Klingon!
 
 Damian (longlong tisa Perlpela)

Lingua::TokPisin::Perlpela?

 .robin.

-- 
Have you been certain you came to me the real reason explain anything
else that I came to you the real reason explain anything else that I
came to you the real reason explain anything else? --eliza



Re: Shoot out

2001-05-17 Thread Robin Houston

On Thu, May 17, 2001 at 01:19:27PM +0200, Merijn Broeren wrote:
 My pike loving friend was amused to see Perl and Python trounced. But
 the testing rig was written in Perl at least. 

I was astounded by the performance of Ocaml.

Being forced by an insane lecturer to debug an obfuscated Ocaml
program when I was a student rather put me off the language.
(And _boy_ can you write obfuscated Ocaml programs if you try!
User-definable infix operators are an especially nice touch in
that regard)

Why isn't Ocaml more popular? Is there a good reason?

 .robin.

-- 
Sometimes I sit in front of my washing machine and contemplate the
 worthlessness of life.  My washing machine isn't even plugged in.
--alex



Re: Shoot out

2001-05-17 Thread Robin Houston

On Thu, May 17, 2001 at 03:06:45PM +0100, Dominic Mitchell wrote:
 On Thu, May 17, 2001 at 03:04:47PM +0100, Robin Houston wrote:
 
 Statement:
 
  (And _boy_ can you write obfuscated Ocaml programs if you try!
  User-definable infix operators are an especially nice touch in
  that regard)
 
 Answer:
 
  Why isn't Ocaml more popular? Is there a good reason?

:-)

I don't find that enormously convincing as a reason, though.
You may have noticed that it's possible to write obfuscated
Perl programs ;)

C++ is also pretty bad in that respect (I still don't *quite*
believe that overloadable typecasting isn't a joke...), and
is pretty popular...

I suppose one reason is that in order to be popular, a language
has to syntactically resemble C to make it easier for existing
programmers to learn.

 .robin.

-- 
It really depends on the architraves. --Harl



Re: Shoot out

2001-05-17 Thread Robin Houston

On Thu, May 17, 2001 at 03:28:13PM +0100, Greg McCarroll wrote:
 But the question is, are they generating C code from Ocaml code
 and compiling it,

I don't think so. I think the Ocaml compiler compiles directly to
machine code. But what difference does it make, ultimately?

 this would explain the performance.

It might help to explain why it's faster than interpreted languages.
But C++ is a compiled language too, and Ocaml seemed to be
consistently faster than C++ in those benchmarks.

I don't think the picture is so simple any more, anyway.
Optimising JITs seem to be catching up...

 .robin.

-- 
Satan, oscillate my metallic sonatas!



Re: Latest Perl Journal

2001-05-16 Thread Robin Houston

On Wed, May 16, 2001 at 10:05:25AM +0100, Cross David - dcross wrote:
  Loved the footnote on page 78.
 
 Thanks very much. It's one of my favourite jokes. It was trialed at a
 london.pm technical meeting some months ago :)

What's the footnote on page 78, Dave?

 .robin.

-- 
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal--Panama!
--Guy Jacobson



Re: Politics (was RE: BOFHs requiring license)

2001-05-14 Thread Robin Houston

On Mon, May 14, 2001 at 01:06:42PM +0100, Lucy McWilliam wrote:
 Is this the point where I can try and recruit some of you compscis to the
 bioinformatics revolution?

I've always thought it sounded like fun.

How does one go about joining the bioinformatics revolution, then?

 .robin.

-- 
It really depends on the architraves. --Harl



Re: Schroedingers Computer

2001-05-11 Thread Robin Houston

On Fri, May 11, 2001 at 04:55:47PM +0100, Barbie wrote:
 So far, demonstrations of quantum computing have been limited to the most
 rudimentary of calculations, involving only two or three bits of
 information. 
 
 I'm sure Damian could them straight on that one ;-P

Hmm, I think Damian's module ought to be called
Classical::NonDeterminism. Lovely though it is,
it's (theoretically) more powerful than quantum
computers are known to be...

 .robin.

-- 
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal--Panama!
--Guy Jacobson



Re: (Ab)Using substr

2001-05-10 Thread Robin Houston

On Thu, May 10, 2001 at 09:16:25AM +0100, Cross David - dcross wrote:
 #!/usr/bin/perl -w   # how to (ab)use substr
 use strict;
 my $pi='3.14159210535152623346475240375062163750446240333543375062';

Well, it's more just taking advantage of the fact that most people
don't know more than six decimal places of Pi :-)

Actually it is a thing of great beauty.

 .robin.

-- 
Flee to me, remote elf!



Re: putting escape characters in files

2001-05-10 Thread Robin Houston

On Thu, May 10, 2001 at 04:35:29PM +0100, Struan Donald wrote:
 kind of off topic but how do you get things like ^M and such like into
 a file for, say, writing vi macros?

perl -e 'print \cM'  my-file

;-)
 .robin.


ps. Dominic's already given a proper answer...

-- 
Flee to me, remote elf!



Re: Movies (was Re: Buffy musings ...)

2001-05-09 Thread Robin Houston

On Wed, May 09, 2001 at 08:55:16AM -0600, Nathan Torkington wrote:
 On the subject of music (despite the Subject: of movies) ... anyone
 here into trad. Irish instrumental music?

I'm rather fond of Sharon Shannon.
Does she count?

 .robin.

-- 
select replace(a, CHR(88), replace(a,,'')) from (
select 'select replace(a, CHR(88), replace(a,,)) from (
select ''X'' a from dual)' a from dual)



Re: cocktails

2001-05-03 Thread Robin Houston

On Thu, May 03, 2001 at 11:47:25AM +0100, Chris Heathcote wrote:
 Off the top of my head:
 ICA bar, Match (Noho/Farringdon/Sosho), lab (on Old Compton St.), aka...
 also heard about Smiths of Smithfield, but never been there.
 
 Dunno about Sun afternoon opening on all those...

The ICA bar is certainly open on Sunday afternoon, but will be
serving more coffee than cocktails. I suppose they'd make you
cocktails if you asked, but I wonder how expertly...

 .robin.

-- 
You are bound to be in a state of mental unrest, even turmoil.
 And of course there can be no inner peace: be proud of it!
-- Electric Posters, Piotr Szyhalski



Apocalypse Two

2001-05-03 Thread Robin Houston

http://www.perl.com/pub/2001/05/03/wall.html

Some quite exciting stuff in there. Array dereferencing will be
@foo[23] rather than $foo[23]. Everything will be an object (or at
least work like one). No more typeglobs. User-definable quoting
operators.

And much, much more!

 .robin.

-- 
I dreamt the other night that my nose had fallen off --john melesky



YAPC::E abstract

2001-05-02 Thread Robin Houston

Any comments before I send this off?

 .robin.


Type: talk
Duration: 40 mins
Title: Mutagenic Modules
Slides (draft version): http://London.pm.org/~robin/semantic-talk/0.title.html
Abstract:

It's possible to write a Perl module which will change the meaning of
subsequent code in some way. Pragmas (eg use integer) alter meaning
in this way, but require significant co-operation from the perl
interpreter. However, there are many different ways that you can write
your own mutagenic modules. Mechanisms that make this possible include:

 * AUTOLOAD
 * CORE::UNIVERSAL::
 * overload::constant
 * source filters
 * CHECK blocks
 * tie()

...and many more.

You can do a lot of fun, interesting tricks using these mechanisms, and
I shall demonstrate several different examples; but there are limits to
what you can do. To take a simple example, there's no general way to
change the behaviour of the print function. I'll briefly mention the
difficulties I encountered trying to implement the mythical
Symbol::Approx::Scalar module.

Next I present a brief overview of the internal workings of the perl
interpreter: How it parses your code and compiles it into an optree,
and how the optree is then executed. A compiler backend (or, to speak
more generally, a CHECK block) interposes itself between these two
stages, and converts the optree into some other form. My favourite
compiler backend is B::Deparse, which just converts the optree back
into Perl source code!

Finally I'll describe some work (currently still in the planning phase)
to use a Deparse-like module to convert the optree into a structured
object model which represents the original code. This object model can
serialise itself as Perl code; but serialisation of any specific
construct can be over-ridden to produce different code. (The objects
will also have methods which enumerate the lexical variables which
are in-scope at that point in the program.)

This then amounts to a perfectly general mechanism for applying any
kind of semantic transformation to any Perl code.



Installing Oracle (was: DBD::*-bind_param() ?)

2001-04-30 Thread Robin Houston

On Fri, Apr 27, 2001 at 11:31:16PM +0100, David Cantrell wrote:
 Does anyone?  Every time I've used Oracle, it's been installed by someone
 else who was supposedly an expert.  Although I remain to be convinced that
 any of them really *was* an expert.

I've installed Oracle a few times, and I'm certainly not a Jedi-level
DBA. It really helps to have some DBA experience, and if you want
it to run efficiently you have to be prepared to hand-tune the caches,
block sizes etc. I tend to get it started using the GUI, then tweak it
manually and run the rest from the command line using svrmgrl.

And if you want to use JDBC, then don't be tempted to use the
ISO-8859-15 charset. Changing the charset without reinstalling the
database is very scary indeed, and entirely unsupported and
undocumented. I had to update SYS.COL$ manually, and still can't
quite believe that it worked...

 .robin.

-- 
Satan, oscillate my metallic sonatas!



Re: require Module; and filehandles

2001-04-27 Thread Robin Houston

On Fri, Apr 27, 2001 at 01:32:24PM +0200, Philip Newton wrote:
 Ian Brayshaw wrote:
  it's the internal workings of require that stop the tie 
  from being honoured. I presume that the require burrows
  down into the internals and isn't aware that it's a tie'd
  handle. As far as I can tell the code within the require
  call is unaware that this handle is an object. If you place
  an AUTOLOAD method in TrueHandle instead of the READ and 
  READLINE methods, only DESTROY is called.
 
 Did you tell p5p about this? Perhaps they can do something about it, if they
 consider this a bug.

Having looked at the implementation yesterday, I pity the person
who's *so* certain it's a bug that they try and fix it. It would
not be an easy thing to do, I don't think. (Anyway, PerlIO layers
will save us all!)

 .robin.

-- 
Are we not drawn onward, we few, drawn onward to new era?



Re: require Module; and filehandles

2001-04-26 Thread Robin Houston

On Fri, Apr 27, 2001 at 12:32:47AM +1000, Ian Brayshaw wrote:
  Sometimes, however, no recompilation is necessary, and so I'd like 
 to return a filehandle that evaluates to true (in the 'do file' sense of 
 evaluates)
 
 Is there a way to do this without creating a dummy file (i.e. can we do this 
 in memory)?

In bleadperl (and hence in the forthcoming 5.8) it's really easy to
do this. Just:

  sub true_filehandle {
my $true = 1;
open (my $fh, , \$true);
return $fh;
  }

In earlier perls, you'll need to make a tied filehandle:

package TrueHandle;
sub TIEHANDLE {
bless {};
}

sub READ {
my $self = shift;
return 0 if $self-{done} || $_[1] == 0;
substr($_[0], $_[2], 1) = 1;
$self-{done}=1;
return 1;
}

sub READLINE {
return if $self-{done};
$self-{done}=1;
return 1;
}

package main;
sub true_filehandle {
use Symbol;
my $fh = gensym();
tie *$fh, TrueHandle;
return $fh;
}


.robin.



Re: perlismybitch.com

2001-04-25 Thread Robin Houston

On Tue, Apr 24, 2001 at 10:14:02PM -0500, will wrote:
 
 An old boss of mine wanted a domain that was expiring in a few weeks once so
 he ran a cron task that checked the status of the domain every hour and
 automatically registered it when it became available.

That's how we got kitsite.com, except that it became available while
Jamie was still testing the script. The gods were smiling on us that
day.

 .robin.

-- 
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal--Panama!
--Guy Jacobson



Re: Mutagenic modules: online slides

2001-04-20 Thread Robin Houston

On Thu, Apr 19, 2001 at 11:57:01PM +0100, Simon Cozens wrote:
 
 Funny. You've come across the same idea I did.
 http://simon-cozens.org/pg.pdf

Having now read your paper, I think that in some ways it's the
*opposite* idea; or at least a complementary one.

You want to take arbitrary languages, and execute them as if they
were Perl. I want to take Perl and execute it as if it were an
arbitrary language :-)

 .robin.

-- 
"There is a global coincidence of desires for this"



Tech mtg?

2001-04-18 Thread Robin Houston

Do we yet know if there's going to be a data projector for
the tech meeting? If not, will there be _any_ kind of mechanism
for showing things to people? (OHP, blackboard, whatever)

 .robin.



Re: Tech mtg?

2001-04-18 Thread Robin Houston

On Wed, Apr 18, 2001 at 02:30:01PM +0100, Richard Clamp wrote:
 
 Now all that remains is me remebering to bring it tomorrow.

Cool :-)
Now I've got no excuse for not finishing my slides... :/

 .robin.

-- 
Satan, oscillate my metallic sonatas!



Re: Mentioned in Dispatches

2001-04-18 Thread Robin Houston

On Wed, Apr 18, 2001 at 02:38:26PM +0100, dcross - David Cross wrote:
 
 Maybe Robin would care to comment on this :)
 
 http://www.perl.com/pub/2001/04/p5pdigest/THISWEEK-20010408.html#Robin_Hous
 ton_Left_On_ALL_WEEK

I don't have a lot of time on my hands; I work quickly ;-)

I also have a secret mission, which I'll be partially revealing
tomorrow...

 .robin.

-- 
Are we not drawn onward, we few, drawn onward to new era?



Win32 perl (was: Komodo)

2001-04-18 Thread Robin Houston

On Wed, Apr 18, 2001 at 04:34:17PM +0100, Dean wrote:
 
 Your right, the perls are the same ActiveState are just a lot more aware of
 what the OS can do and lacks the ability to do and tries to compensate for
 them. If you have a stocked Windows box with nmake, VC++ and a bit of time
 you can get CPAN working on it.

You don't even need to pander to the evil empire. dmake will
work in place of nmake, and mingw32 (ie. egcs) works fine for
building perl and modules.

Last time I did this was a couple of years ago, and it took
a _long_ time to compile perl itself. Maybe they've made it
faster now.

 .robin.

-- 
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal--Panama!
--Guy Jacobson



Re: Komodo

2001-04-18 Thread Robin Houston

On Wed, Apr 18, 2001 at 04:36:08PM +0100, Dean wrote:
 Whats MPW?

Macintosh Programmers' Workshop. Delicious...

 Does OS X come with GNU tools like GCC and make then?

Yes (on the optional developers CD)

 .robin.

-- 
Are we not drawn onward, we few, drawn onward to new era?



Re: Technical Meeting - 19th April

2001-04-10 Thread Robin Houston

On Mon, Apr 09, 2001 at 04:09:14PM +0100, dcross - David Cross wrote:
 As usual I'll aim at having four or five lightning talks and two or three
 longer talks.

I'd like to give a (preferably "longer") talk about parsing and
semantic transformation of Perl code. I promise to think of a
less scary title, and try not to say "semantic transformation".

Should take about 20 minutes.

 .robin.

-- 
select replace(a, CHR(88), replace(a,,'')) from (
select 'select replace(a, CHR(88), replace(a,,)) from (
select ''X'' a from dual)' a from dual)



Re: Grammar (was: Re: Linux.com Online Chat)

2001-04-04 Thread Robin Houston

On Wed, Apr 04, 2001 at 10:00:08AM +0100, Dave Hodgkinson wrote:
 
 I'm as liberal as anyone here as far as creativity, expression,
 society and the rest go, but there are certain fundamentals that you
 need before you can go out and break the rules. Like having the
 musical basics before you go out and become a punk or a heavy metal
 god.

I agree with you about education, but all the best punk bands
started off without the first idea how to play any of their
instruments :-)

 .robin.

-- 
Beware. The paranoids are watching you.



Re: Test

2001-04-04 Thread Robin Houston

On Wed, Apr 04, 2001 at 02:25:50PM +0100, Clarke, Darren wrote:
 Sorry all - this is a test... :P
 
 Bloomin' Outlook  HTML ... *grumble*

It's coming through as multipart/alternative, which is fine IMO.
People with broken mail clients may disagree :-)

 .robin.

-- 
select replace(a, CHR(88), replace(a,,'')) from (
select 'select replace(a, CHR(88), replace(a,,)) from (
select ''X'' a from dual)' a from dual)



Re: Test

2001-04-04 Thread Robin Houston

On Wed, Apr 04, 2001 at 03:09:02PM +0100, Nicholas Clark wrote:
 [...] the HTML hanger on serves no purpose except to consume
 my disk space at 4 times the rate.

You mean you *archive* this bollocks?

:-)

 .robin. (reads london-pm with the 'D' key)

-- 
Satan, oscillate my metallic sonatas!



Re: archiving

2001-04-03 Thread Robin Houston

On Tue, Apr 03, 2001 at 01:36:54PM +0100, Greg McCarroll wrote:
 
 Did you all know that i used to blow up pressurised butane
 cannisters as a child?

We *all* used to do *that* :-)

 .robin.

-- 
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal--Panama!
--Guy Jacobson



Re: Buffy riding a pony!

2001-04-02 Thread Robin Houston

That's the most addled thing I've seen for a long, long time.
Congratulations!

 .robin.



Re: Job: I'm looking for one..

2001-03-29 Thread Robin Houston

On Thu, Mar 29, 2001 at 11:32:57AM +0100, Piers Cawley wrote:
 
 Hmm... not quite sure what happens if either of the COMMITs fail.

That's exactly the problem. And what if you crash after the
first COMMIT?

This is not an easy problem. The usual solution is
called "two-phase commit". See
http://www.sei.cmu.edu/str/descriptions/dtpc.html
for example.

 And I'd bemused as to how Java would handle it too...

It's not a language issue per se.
J2EE is (a lot!) more than just the Java language.

http://www.subrahmanyam.com/articles/jts/JTS.html

 .robin.

-- 
"Do nine men interpret?" "Nine men," I nod. 



Re: Job: I'm looking for one..

2001-03-28 Thread Robin Houston

On Wed, Mar 28, 2001 at 12:16:07PM +0100, Jonathan Peterson wrote:
 
 I'd also add that Java, to my eyes, seems dreadfully uncooperative. Is it
 really as hard as it seems to get a non Java program to talk to j2ee stuff?
 Or is it all just part of the Java marketing? Is it me or is COM actually
 way easier to use than CORBA?

The "J2EE platform" consists of so many disparate technologies
that it's very hard to generalise about it. It's quite easy
to get a non-Java program to talk to an HTTP servlet, for
example :-)

Which parts of J2EE tend to get used the most in enterprise
environments? Anyone got any ideas/experience?

Presumably most people build solutions around e.g. weblogic,
rather than doing everything from raw ingredients.

 .robin.

-- 
"You are bound to be in a state of mental unrest, even turmoil.
 And of course there can be no inner peace: be proud of it!"



Re: Perl Auto-RPC

2001-03-28 Thread Robin Houston

Is the intention simply that it be possible to use modules
which aren't available locally?

If so, you could do something like:

 - use request is passed to module server
 - module server "require"s module (will do nothing if it's already
been required. That's a good thing)
 - server serialises module stash (including subs) and passes it
   back to client
 - client deserialises stash, calls import()
 - client can now use module without actually having it.

Major problems:

 1. (de)serialisation would be hard, but not impossible
(the hard bit, code, can be done with B::Deparse)
 2. XS won't work


(2) is the killer, I fear.

 .robin.



Re: Job: I'm looking for one..

2001-03-28 Thread Robin Houston

On Wed, Mar 28, 2001 at 01:59:40PM +, Greg Cope wrote:
 I was thinking about this the otherday - can you recommend some (pref
 open source) Java regex libs ?

OROMatcher.
http://jakarta.apache.org/oro/index.html

There's also gnu.regexp, for LGPL fans:
http://www.cacas.org/~wes/java/

Both support perl5 syntax, more or less.

 .robin.

-- 
"Sometimes I sit in front of my washing machine and contemplate the
 worthlessness of life.  My washing machine isn't even plugged in."
--alex



Re: Buffycode (was Re: That book)

2001-03-28 Thread Robin Houston

On Wed, Mar 28, 2001 at 11:35:33AM -0500, Dave Cross wrote:
 
 Would this be an appropriate time to point out that my TPC talk 
 proposes the creation of a Parse::Perl::Approx module :)

What does it do?

 .robin.

-- 
Satan, oscillate my metallic sonatas!



Re: Job: I'm looking for one..

2001-03-28 Thread Robin Houston

On Wed, Mar 28, 2001 at 08:08:00PM +0100, Robin Szemeti wrote:
 On Wed, 28 Mar 2001, Paul Makepeace wrote:
  Can Perl do distributed database transactions? 
 
 probably .. simple multi threaded app, fork a few child processes,
 establish the odd DBI connection, execute a query each return when the
 last child is reaped ... 100 lines?

I think the key word in Paul's question was "transactions".
In other words, you have more than one database, possibly
in different physical (and network) locations, and you need
to perform a transaction - an _atomic_ transaction - across
several of them.

No partial failure allowed, it has to either succeed completely
or fail completely.

The obvious example is a bank transfer. Add the money to one
account, remove it from the other. Oops, the second part failed.
Double your money!

Actually, any e-commerce operation has the same problem. You
need to fulfil the order *and* charge the customer - those
two things almost certainly can't happen on the same machine.
If you do one and not the other, then either the supplier or
the customer is obviously losing out. It has to be neither or
both.


I think that's what Paul was talking about. He can correct me
if I'm wrong :-)

 .robin.

-- 
select replace(a, CHR(88), replace(a,,'')) from (
select 'select replace(a, CHR(88), replace(a,,)) from (
select ''X'' a from dual)' a from dual)



Re: Not Matt's Scripts

2001-03-27 Thread Robin Houston

On Tue, Mar 27, 2001 at 10:14:22PM +0100, Robert Shiels wrote:
 
 %e seems to be Linux specific. %d works on both Linux and Windows.

Not Linux-specific, it's part of the Single Unix Specification.

Point taken about Win32.

 .robin.

-- 
select replace(a, CHR(88), replace(a,,'')) from (
select 'select replace(a, CHR(88), replace(a,,)) from (
select ''X'' a from dual)' a from dual)



Re: Not Matt's Scripts

2001-03-27 Thread Robin Houston

On Tue, Mar 27, 2001 at 01:29:57PM +, Matthew Byng-Maddick wrote:

  my @th=(qw(th st nd rd),("th")x16)x2; $th[31]="st";
 
 That's an evil and gross hack.
 
 sub th{(($_[0]-10-$_[0]%10)/10%10)?(qw(th st nd rd),('th')x6)[$_[0]%10]:"th"}


TIMTOWTDI, thank ghod ;-)

 .robin.

-- 
"It really depends on the architraves." --Harl



Re: Benchmarking [was] Re: Not Matt's Scripts

2001-03-27 Thread Robin Houston

On Tue, Mar 27, 2001 at 05:40:19PM +0200, Philip Newton wrote:
 Well, remember that the sub effecticaly recalculates (what amounts to) the
 array each time. To be fair, you should include the array initialisation
 inside the loop and see who wins then.

Hey, that's not _fair_!
The whole point of using an array is that you can pre-populate it.
(also it's more concise, and I find it more comprehensible. YMMV)

 .robin.

-- 
Beware. The paranoids are watching you.



script archive naming

2001-03-23 Thread Robin Houston

On Fri, Mar 23, 2001 at 05:40:21PM +, Robin Szemeti wrote:
 
 and I can tell you that ezscripts.org is still available 

There is already a site called ezscripts though:

http://www.bytchandbytes.com/ezscripts/

Simplescripts is http://www.simplescripts.co.uk/ - they
sell perl scripts (and have some free for download).

Scripteasy seems to be some sort of programming language -
http://www.scripteasy.com/

Webscripts is an MSA-like archive. I haven't looked at the
code. http://awsd.com/scripts/


Your search - "london script archive" - did not match any documents.

 .robin.

-- 
"Sometimes I sit in front of my washing machine and contemplate the
 worthlessness of life.  My washing machine isn't even plugged in."
--alex



HAL (was: ISO8601 (was: Pointless, Badly-Written Module.))

2001-03-23 Thread Robin Houston

On Fri, Mar 23, 2001 at 05:48:42PM +, Robin Szemeti wrote:
 and for a bonus half point (cos its easy) .. why was HAL called HAL?

Supposedly because
  join ("", map chr(1+ord), split"", "HAL") eq "IBM"

though apparently that's accidental.


"When someone pointed out the spurious
 association between HAL and IBM, Kubrick wanted to change the
 computer's name and refilm the scenes but was dissuaded because of
 production costs."

--http://www.research.ibm.com/deepblue/learn/html/e.8.1b.html

 .robin.

-- 
"It really depends on the architraves." --Harl



Fruit flies like a banana

2001-03-23 Thread Robin Houston

On Fri, Mar 23, 2001 at 06:05:21PM +, Leon Brocard wrote:
 AEF sent the following bits through the ether:
  On Fri, 23 Mar 2001, Lucy McWilliam wrote:
   Love and fruit flies,
   I only really want /one/ of those things...
 Really? How many flies do you have?

There's an interactive fruit fly on the interweb.
Really!

 http://sdb.bio.purdue.edu/fly/aimain/1aahome.htm

Antennapedia is my favourite mutation, but I expect Lucy
knows some better ones :-)

 .robin.

-- 
God! a red nugget: a fat egg under a dog.



Re: Pointless, Badly-Written Module.

2001-03-20 Thread Robin Houston

On Tue, Mar 20, 2001 at 11:40:18AM -0500, Dave Cross wrote:
 I really think I should drop the author a polite note offering him a 
 patch or three.

A patch? It needs taking outside and shooting!

package Date::MMDDYY;
use strict;
use vars qw(@ISA @EXPORT_OK);
require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK='datecon';

use POSIX 'strftime';

sub datecon {
my ($time, $format, $delim) = @_;
$time   = time() if !defined $time;
$format = 'MM,DD,YY' if !defined $format;
$delim  = '-'if !defined $delim;

for ($format) {
s:,:$delim:g;
s:(MM|DD|YY):"%".lc(substr($1,0,1)):eg;
}
return strftime($format, localtime($time));
}


Should we also do a series of drop-in replacements for
crappy CPAN modules? ;-)

 .robin.

-- 
Straw? No, too stupid a fad! I put soot on warts.



Re: Pointless, Badly-Written Module.

2001-03-20 Thread Robin Houston

On Tue, Mar 20, 2001 at 05:07:28PM +, Leon Brocard wrote:
 This isn't such a crazy idea. People keep on complaining about the
 quality of modules on CPAN. So pick a random one and make it better
 ;-P

Well, with a module like Date::MMDDYY the implementation
_is_ broken - it uses gmtime() instead of localtime() for
example;

but worse than that, the design and conception are flawed.
Any drop-in replacement would inevitably suffer from the
same flaws of conception and interface.

There's no reason at all for anybody to use this module.
Compare:

  use Date::MMDDYY 'datecon';
  print "The date is ", datecon(time()), "\n";

to

  use POSIX 'strftime';
  print "The date is ", strftime("%m-%d-%y", localtime()), "\n";


The module is redundant, not just poorly implemented.

 .robin.

-- 
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal--Panama!



Re: LWP::Simple

2001-03-16 Thread Robin Houston

On Fri, Mar 16, 2001 at 01:38:41PM +, [EMAIL PROTECTED] wrote:
 Does anybody know if LWP::Simple allow for un@pw:url convention?

Yes it does.

Wouldn't it have been quicker to try it than to write that
message? ;-)

 .robin.

-- 
Flee to me, remote elf!



Re: LWP::Simple

2001-03-16 Thread Robin Houston

On Fri, Mar 16, 2001 at 02:59:13PM +0100, Philip Newton wrote:
 
 Well, isn't being precise part of being a programmer? "Pedantic" is
 basically just "precise", only a little more extreme. But "you can't just
 make sh*t up and expect the computer to understand what you want,
 Retardo!"[1] -- standards *do* serve a purpose and referring to them can be
 helpful.

Yeah, I suppose so. And I'm certainly capable of being pedantic
myself, as I'm sure others here can attest :-)

Standards evolve though, and they evolve based on the way
that they're used in the real world. They're not infallible
scriptures.

When we're talking about an *extension* to the standard
which is
  - compatible with the basic standard
  - very very widely implemented
  - simple and obvious

we should be trying to get the "standard" improved IMO,
rather than saying "Don't use it, it's not standard".

This is how we make progress.

 .robin.

-- 
Beware. The paranoids are watching you.



Re: Descrambling CSS w/ 7 Lines Of Perl

2001-03-07 Thread Robin Houston

Nice. I'm sure it can easily be shortened some more.

Without even understanding what it does, it seems pretty clear
that we can shave 2 bytes by changing:

  $_='while(read+STDIN,$_,2048){

into

  $_='$/=\2048;while(STDIN){


Any more obvious shavings?

 .robin.

-- 
Satan, oscillate my metallic sonatas!



Re: Descrambling CSS w/ 7 Lines Of Perl

2001-03-07 Thread Robin Houston

On Wed, Mar 07, 2001 at 04:44:54PM +0100, Philip Newton wrote:
 Try posting to Fun With Perl; they like playing golf there.

What do you think I did, immediately after posting here? :-)

FWP is so bloody slow though, that it hasn't got there yet
AFAICT...

 .robin.

-- 
God! a red nugget: a fat egg under a dog.



Re: That thesis generator

2001-03-06 Thread Robin Houston

On Tue, Mar 06, 2001 at 02:57:45PM -, Jonathan Peterson wrote:
 Can anyone remember the URL for the thesis generator that Damian Conway
 mentioned in his talk?

http://dev.null.org/dadaengine/

http://www.elsewhere.org/cgi-bin/postmodern/DadaEngine


 .robin.

-- 
Satan, oscillate my metallic sonatas!



Re: lvalue subroutines

2001-02-27 Thread Robin Houston

On Tue, Feb 27, 2001 at 11:38:40PM +1100, Ian Brayshaw wrote:
 
 I'm new to the discussion of Perl6, so are there any discussions around 
 providing operators such as wantlvalue and wantvoid
 to perform similar queries to wantarray?

Yes. Damian has proposed
 http://dev.perl.org/rfc/21.html

which seems sufficiently generic

 .robin.


PS:  You know that "wantvoid" is just !defined(wantarray())
 ?



Re: lvalue subroutines

2001-02-27 Thread Robin Houston

On Tue, Feb 27, 2001 at 10:50:26PM +1100, Ian Brayshaw wrote:
 Given the following lvalue subroutine
 
   sub mysub : lvalue {
   $value;
   }
 
 is there any way for mysub() to be able to determine that it
 was called in an lvalue context?

Yeah there is, but you're not going to like it :-)

 .robin.

use v5.6;
use Inline C = NOMO;

U8 wantlvalue ()
{
  return cxstack[cxstack_ix].blk_sub.lval;
}

NOMO

sub foo :lvalue {
  print (wantlvalue() ? "lvaluably\n" : "rvaluably\n");
  my $foo
}

foo();
foo() = 23;




SRN (was: lvalue subroutines)

2001-02-27 Thread Robin Houston

On Tue, Feb 27, 2001 at 02:39:35PM +, Piers Cawley wrote:
 (I note that, in the slide, ()^0.5 is refered to as U_SRN. Presumably
 because the idea gives the mathematicians headaches too, so they hide
 it slightly behind another symbol)

Apparently SRN stands for "Square Root of Not", so they're not hiding
it too much.

http://www.qtc.ecs.soton.ac.uk/lecture1/lecture1d.html
is interesting.

I agree about generalisation. I think it's perfectly reasonable
to call such an operator the "square root of not" in context;
as long as you understand that by the same definition, adding
one is the "square root" of adding two ;-)

 .robin.

-- 
"Do nine men interpret?" "Nine men," I nod. 



Re: SRN (was: lvalue subroutines)

2001-02-27 Thread Robin Houston

I've also found
 http://www.sigmaxi.org/amsci/issues/comsci95/compsci95-07.html
 "The Square Root of NOT"

which seems to be a good non-experts introduction to *real* QC.

 .robin.



Quantum Weirdness

2001-02-27 Thread Robin Houston

I just bought a Mars bar, and it's

*drum roll*

sixty-five grams!

 .robin.



Re: Quantum Weirdness

2001-02-27 Thread Robin Houston

On Tue, Feb 27, 2001 at 05:48:27PM +, Rob Partington wrote:
 
 They already did that on IRC!  Keep up, that man!

I'm trying to cut down on IRC. It's becoming too distracting.
But you miss so much by not being there.

robin irc+-

 .robin.

-- 
"Do nine men interpret?" "Nine men," I nod. 



Re: London.pm List Weekly Summary 2001-02-12

2001-02-15 Thread Robin Houston

On Thu, Feb 15, 2001 at 10:17:42AM +0100, Philip Newton wrote:
 [...] summaries of #london.pm traffic :)

Now _there's_ an idea :-)

Is anyone feeling really, really bored?

 .robin.



Re: Penderel Configuration

2001-02-15 Thread Robin Houston

On Thu, Feb 15, 2001 at 03:26:27PM -, Robert Shiels wrote:
 
 I'd like to know which perl modules are already installed.

Add this handy alias to your ~/.bashrc and you'll be able to
find out whenever you like :-)

alias lsmodules='perldoc -m perllocal | perl -nle '\''print $1 if /L(.*?)/'\'' | 
sort -u | column'

Output follows.

 .robin.

Apache::AuthCookie  Digest::MD5 Parse::Yapp
Apache::DB  Getopt::LongSet::Object
Apache::DBI HTML::ParserStorable
Apache::Reload  HTML::TagsetTangram
Apache::SandwichlibapreqTemplate
Apache::Session libwww-perl Text::Autoformat
Apache::Stage   libxml-enno Tie::IxHash
AppConfig   libxml-perl URI
CGI MIME::Base64XML::Parser
Data::ShowTable mod_perlXML::RSS
Date::Manip Msql-Mysql-modules  XML::XPath
DBI Net
Devel::Symdump  Net::IRC



Re: [OT] symlinks to symlinks

2001-02-14 Thread Robin Houston

On Wed, Feb 14, 2001 at 04:07:34PM +, David Cantrell wrote:
 -l will tell we whether it's a symlink, but I can't see any way of telling
 what it points to

perldoc -f readlink

 .robin.



Re: Technical Meeting Sponsorship

2001-02-06 Thread Robin Houston

On Tue, Feb 06, 2001 at 07:29:53AM -0500, Dave Cross wrote:
 I've been investigating places to hold Damian's meeting and I've already
 got some interesting leads (the Conway Hall looks like it might well
 work out!)

Conway Hall would be a great venue, for the name alone!

It can't be too expensive, because it's used by any number of
fringe anarcho groups, who presumably don't have too much cash
spilling around.

 .robin.



Re: Mailing List Stuff

2001-02-02 Thread Robin Houston

On Fri, Feb 02, 2001 at 12:27:16PM +, Struan Donald wrote:
 * at 02/02 12:29 + Jonathan Stowe said:
  On Fri, 2 Feb 2001, Dave Cross wrote:
  
   Any questions?
  
  
  Yeah, can I have a pony ?
 
 what is it with ponys?

I've wondered that too.
Seems to be a #perl obsession...

 .robin.

-- 
Satan, oscillate my metallic sonatas!



Re: Mailing List Stuff

2001-02-02 Thread Robin Houston

On Fri, Feb 02, 2001 at 12:40:18PM +, Michael Stevens wrote:
 purl pony
 [purl] pony is replyGimme a Pony! Pony! Pony! Pony Pony Pony! Pony
 Pony Pony!  Pony Pony Pony! Pony Pony Pony! Pony Pony Pony! Pony
 Pony Pony! Pony Pony Pony!

robin literal pony pony pony
purl robin: pony pony pony =is= replyGLUE GLUE GLUE|
  replyRHAPSODY in Glue!

robin glue glue glue?
purl glue glue glue is replyPONY PONY PONY


hmm
It must be a US cultural reference of some sort...

 .robin.



Re: irc problems

2001-02-01 Thread Robin Houston

On Thu, Feb 01, 2001 at 11:18:04AM +, Michael Stevens wrote:
 I can't get onto any of rhizomatic.net. Is anyone else having problems?

Not I.
London tolerates my caresses.

Bullfrog seems to be doing some spletnit shenannigans though.

 .robin.

-- 
Straw? No, too stupid a fad! I put soot on warts.



Re: Opening Files using OO Modules

2001-02-01 Thread Robin Houston

On Thu, Feb 01, 2001 at 05:01:37AM -0500, Dave Cross wrote:
 
 Within the script, the lines output to different files depending on
 a $type data field. The files are used like this:
 
 my $fh = "FH$type";
 open $fh, "=$streamnum{$type}" or die $!;
 print $fh "some data from the input file";
 
 Where %streamnum maps a $type to an output file descriptor.
 
 This, of course, breaks under 'use strict' [...]

If you have perl 5.6, you can do it even more simply
(and in a way which works under 'strict'):


open my $fh, "=$streamnum{$type}" or die $!;
print $fh "some data from the input file"; 


I like that!

 .robin.



Re: website directory access

2001-02-01 Thread Robin Houston

On Thu, Feb 01, 2001 at 02:24:08PM +0100, Philip Newton wrote:
 Michael Stevens wrote:
  You could give out urls with the usernames and passwords in?
 
 Were you thinking of
 http://username:[EMAIL PROTECTED]/pics/drunkenperlmongers.jpg ? No
 such thing; RTFRFC for more info.

There may well be no such thing, but since it works in just about
every user agent, including LWP, that's a pretty bad argument against
using it here in the Real World.

It's a pretty obvious and compatible extension the the standard...

 .robin.

-- 
"do not assume that you are in control of your own actions,
 but take responsibility for them anyway."



Re: Perl Books

2001-02-01 Thread Robin Houston

On Thu, Feb 01, 2001 at 11:57:20AM -0700, Nathan Torkington wrote:
 [...] brain surgery tech support [...]

Have you got the number?
I'm having a spot of bother with my hypothalamus.

 .robin.



Re: Perl Books

2001-01-31 Thread Robin Houston

On Wed, Jan 31, 2001 at 02:32:21PM +, Struan Donald wrote:
 
 er... this unweldy thing would seem to be it:
 
 http://www.amazon.com/exec/obidos/tg/browse/-/4045/107-2581489-8245353

A handy hint for amazon URLs: you can knock off the long number
on the end, and the thing will still work. 

http://www.amazon.com/exec/obidos/tg/browse/-/4045


The same trick works for any amazon URL.
This has been a public service announcement.

 .robin.

-- 
Satan, oscillate my metallic sonatas!



Re: .emacs

2001-01-29 Thread Robin Houston

On Mon, Jan 29, 2001 at 08:13:11PM +, Mark Fowler wrote:
 
 Hmm. Can you do something to save directly via scp?

http://ls6-www.informatik.uni-dortmund.de/~grossjoh/emacs/tramp.html

 .robin.

-- 
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal--Panama!



Re: Mailing List Archive

2001-01-26 Thread Robin Houston

On Fri, Jan 26, 2001 at 06:50:59AM -0500, Dave Cross wrote:
 
 This is all a fine plan, but it doesn't prevent external people from
 achiving us in the same way that mail-archive do. I really don't think
 there's a foolproof way to prevent it.

I doubt that's a serious problem.

I assume that someone deliberately added mail-archive's bot to the
list, because mail-archive certainly don't hunt down lists themselves.

If we have an explicit "no public archives" policy then presumably
people will have the decency to honour it, and not subscrive archive
bots to the list.

 .robin.

-- 
Flee to me, remote elf!



Re: List Archive ( was SUBSCRIBE london-list archive@jab.org (fwd))

2001-01-26 Thread Robin Houston

On Fri, Jan 26, 2001 at 07:02:48AM -0500, Dave Cross wrote:
 I wonder what mail-archive would do if we just unsubbed their bot?

Nothing, presumably.

I don't think that mail-archive subbed their bot to the list -
I think someone from here must have done it. They seem like a
decent bunch, and don't seem to be the types to actively search
out lists.

 .robin.



Re: Mailing List Archive

2001-01-25 Thread Robin Houston

Well, this discussion has been beaten to death on IRC,
so I feel like I'm repeating myself here. But for the
public record: ;-)


- This is a public list. Anyone can subscribe using an advertised
  address.
- We're not plotting to bring down the government.
- "Information wants to be free."  Old emails live for ever.


However:

- Google already knows more about me than I'd like ;-)
- We don't need an archive: it's not exactly going to
  contain useful information.
- The hoarders among us will have our own archives.


So I vote against a public archive.

 .robin.



Re: word processors

2001-01-24 Thread Robin Houston

On Wed, Jan 24, 2001 at 04:35:17PM -, Jonathan Peterson wrote:
 
 I wonder if anyone has written a novel in Latex?

That sounds like a challenge to me :-)
You have to set it in Computer Modern as well though.

 .robin.



Re: word processors

2001-01-24 Thread Robin Houston

On Wed, Jan 24, 2001 at 05:11:25PM +, Michael Stevens wrote:
 
 Much as I love Computer Modern for technical work, using it for fiction
 would just be WRONG WRONG WRONG.

In a good way :-)

 .robin.



Re: Dumb-assed question

2001-01-24 Thread Robin Houston

On Wed, Jan 24, 2001 at 12:42:58PM -0600, Paul Makepeace wrote:
 
 Exercise: Implement the "except the last" in a regex :-)
 Extra points for squeezing it into a single regex rather than
 a while / $' solution


s/\.(?=.*\.)/_/g;

 .robin.

-- 
Are we not drawn onward, we few, drawn onward to new era?



Re: Munging Reply-To

2001-01-22 Thread Robin Houston

On Mon, Jan 22, 2001 at 05:10:57PM +, alex wrote:

 there is only one right way, and that's to give people the choice.
 
 that's what i do, and in my experience the majority prefer to have their
 reply-to's munged on discussive lists such as this one.

I wonder whether that's really true, or if it's simply that
most people don't bother to change from the default because
they're not that interested?

If the default was an unmunged (void) and (void-munged) was
also available for the munging fanatics, which would be the
majority then?

Don't know, but wondering...

 .robin.



OuPerlPo

2001-01-19 Thread Robin Houston

The talk I gave last night (or an outline thereof) is at
 http://www.kitsite.com/~robin/ou-x-po/talk/0.title.html

The code for my "prisoner's JAPH":
 http://www.kitsite.com/~robin/ou-x-po/japh-prisoner.pl


In case anyone gets really obsessed, the code I used
to analyze font metrics is
 http://www.kitsite.com/~robin/ou-x-po/fontm.c
 http://www.kitsite.com/~robin/ou-x-po/prisoner.pl


Oh - and in case it inspires anyone, the keywords of
Lingua::Romana::Perligata which are permissible under
the prisoner's restriction are listed at
 http://www.kitsite.com/~robin/ou-x-po/LRP%20prisoner%20keywords


 .robin.



Re: Red Hat worm discovered

2001-01-17 Thread Robin Houston

On Wed, Jan 17, 2001 at 12:59:56PM -0800, Paul Makepeace wrote:
 Just to reinforce the point that this OS is a steaming pile of crap

Aww c'mon! RedHat was obviously targeted because it's the most
widely used! None of the vulnerable software was written by RH
(and all of it was also included in other distros).

 .robin.



Speaking Welsh (Re: Speaking Japanese (Re: Access Control Lists and Functions))

2001-01-16 Thread Robin Houston

On Tue, Jan 16, 2001 at 11:47:44AM +, Redvers Davies wrote:
 And possibly some welsh...  The welsh word "drwg" (pronounced the english
 way is "droog") and means 'Bad, naughty, evil, wicked' etc.

Anthony Burgess spoke fluent Welsh (his first wife was Welsh),
so I'd have thought that was quite likely.

 .robin.

-- 
Satan, oscillate my metallic sonatas!



Re: Access Control Lists and Functions

2001-01-16 Thread Robin Houston

On Tue, Jan 16, 2001 at 08:47:52AM +0100, Philip Newton wrote:
 Yes. I converted a little script I have that puts some stuff into a database
 to use LRP.
 
 [snip interesting discussion]

Can we see the result? I'm fascinated...

 .robin.

-- 
"You are bound to be in a state of mental unrest, even turmoil.
 And of course there can be no inner peace: be proud of it!"



trade mark parody (Re: PIMB T-shirts)

2001-01-16 Thread Robin Houston

On Tue, Jan 16, 2001 at 08:09:55AM -0500, Alex Page wrote:
 IANAL, but AFAIK parody is protected under trademark law, as long as
 you're not making profit (I presume beer money for the hassle of
 T-shirt making is excusable).

IANAL either, but I think it's quite complicated.

"More interestingly the Court held that in trade mark law,
 there is no "parody" defence to an infringement action."

 (from http://www.bristows.com/news/news_items/elvis.html)

Other cases seem to contradict that view though. Also relevant
is http://www.murdoch.edu.au/elaw/issues/v5n1/blake51.html#infringet
paragraph 48:

"derogotary use", involving the "suggestion of an unwholesome, or
 unsavoury association" seems to qualify as infringement in the US.


Don't we have someone here who *is* a lawyer? :-)

.robin.



Re: Access Control Lists and Functions

2001-01-15 Thread Robin Houston

On Mon, Jan 15, 2001 at 02:29:38PM +, Simon Wistow wrote:
 How would the user get round this? I mean sure they could if they had
 access to the source code but ...
 
 
 I'm writing something at the moment that's got lots of 
 
 
 sub do_summat
 {
   my ($self, $userid, $arg1, $arg2) = @_;
   
   return access_denied('do_summat') unless (grep {/^$userid$/}
 $self-acl-{do_summat});
 }
 
 so this was just a way of automating that.

I think I misunderstood you before. I thought you were trying
to restrict what could be done by code which uses your module.
Obviously that's not what you're doing; because in the code
above, anyone could pass in any userid (not necessarily their own).

OTOH, if your program is running locally then it can't do
anything that the user couldn't do directly anyway (unless
it's SUID, which is too frightening to contemplate). So
presumably it's some sort of network-available service.

I think I see where you're coming from now. Sorry for the
confusion.

 .robin.

-- 
"Have you been certain you came to me the real reason explain anything
else that I came to you the real reason explain anything else that I
came to you the real reason explain anything else?" --eliza



Re: Access Control Lists and Functions

2001-01-15 Thread Robin Houston

On Mon, Jan 15, 2001 at 05:17:08PM +, Marcel Grunauer wrote:
 
 Sounds like the business. There have been quite a number of Perl modules
 lately that are more about the syntax and the way the language is being
 used than for any specific tasks, such as:

Lingua::Romana::Perligata   :-)

I don't know when the module was actually released onto CPAN,
but I saw it for the first time at the weekend. It is ...
staggering ...

Anyone written any programs using it?

 .robin.

-- 
"do not assume that you are in control of your own actions,
 but take responsibility for them anyway."



Simultaneously a list and a hash

2001-01-12 Thread Robin Houston

In the "Directory to Data Structure" thread, there's been some
talk of a value which is a list *and* a hash, so you can have
a structure like 

$dirstruct{'mydir'}-['file1.txt', 'file2.txt']
$dirstruct{'mydir'}-{'anotherdir'}-['file3.txt', 'file4.txt']

and there was talk of tie().

But really there's a much easier way to do it:

  local *mydir;
  @mydir = qw(file1.txt file2.txt);
  %mydir = (anotherdir = [qw(file3.txt file4.txt)]);

  my $dirstruct = {mydir = *mydir};

  $,=", "; $\="\n";
  print @{$dirstruct-{mydir}};
  print @{$dirstruct-{mydir}-{anotherdir}};


or if you're offended by dynamic scoping,

  use Symbol 'gensym';

  my $mydir = *{gensym};
  @$mydir = qw(file1.txt file2.txt);
  %$mydir = (anotherdir = [qw(file3.txt file4.txt)]);

  my $dirstruct = {mydir = $mydir};

  $,=", "; $\="\n";
  print @{$dirstruct-{mydir}};
  print @{$dirstruct-{mydir}-{anotherdir}};


 .robin.

-- 
Beware. The paranoids are watching you.



Re: From whence cometh www.fnord.demon.co.uk?

2001-01-11 Thread Robin Houston

On Thu, Jan 11, 2001 at 01:56:32PM +, Andy Wardley wrote:
 ... a cryptic Perl 3 liner (which I couldn't get to work) ...

See http://www.cypherspace.org/~adam/rsa/ for an explanation
of that particular cryptic 3-liner  :-)

 .robin.

-- 
Santa, oscillate my metallic soatnas!