Re: Straight Jackets and Video Cameras

2009-07-30 Thread Rafael Garcia-Suarez
2009/7/29 Ovid :
> Python (Japanese): I'm Ruby.
> Perl: I'm Perl.
> Python:  I'm a clean, modern language.
> Perl: Hey, you're Japanese. Don't you write that funny Kanji stuff? How can 
> you read that?
> Python: Hey, it's a beautiful, expressive style of writing. It's not my fault 
> if you've never troubled to learn it.
> Perl: My point.

Except that in Kanji, there is often more than one way to do it...
I imagine Python incarnated by a lawyer or something.



Re: [OT] Perl woes and types

2009-01-28 Thread Rafael Garcia-Suarez
2009/1/28 Ovid :
> - Original Message 
>
>> From: Peter Corlett 
>
>> > The problem with "strongly" and "weakly" typed is that different people 
>> > define
>> them differently and they don't have much meaning in type systems.  It's 
>> static
>> typing and dynamic typing which is important.
>>
>> Wikipedia says that weakly- versus strongly-typed indicates how readily the
>> language coerces between types. I'm not sure one can get much weaker than 
>> Perl
>> on that front.
>
> By "types" I assume you mean "kinds of data a variable can hold".  Strictly
> speaking, taint checking in Perl is another type system in the language, one
> which (like "use strict") must be explicitly enabled in the code.  There is a
> very specific action which is required to extract untainted data from tainted
> data, so Perl is "strongly typed" in this respect..  You also can't coerce an
> array reference into a hash reference though you can create them out of thin
> air via auto-vivification, but once created, you can't change 'em:
>
>$ perl -Mstrict -le 'my $foo = []; $foo->[0]{bar}[0] = "Wheee!"; print 
> $foo->[0]{bar}[0]; $foo->[0]{bar}{baz}'
>Wheee!
>Can't coerce array into hash at -e line 1.
>
> So is Perl strongly or weakly typed?

I see tainting as something the value holds, not its container. Unlike
types.

>> > I *think* what you're describing as "strongly typed" is "a variable can 
>> > hold
>> different types, but that operators change their behavior at runtime:
>>
>> That's just polymorphism, no?
>
> Yes, but many argue that early binding is a key component of a strongly typed
> language.  The python example I posted clearly had different kinds (types) of
> data assigned to the 'foo' and 'bar' variables at different points in the
> program.
>
> I'm just saying that while type theorists generally agree on the meaning of
> "static" and "dynamic" typing (and all languages contain elements of each),
> "strong" and "weak" typing don't have much meaning there.  They only have
> meaning to those who make up their own definitions :)

C passes for "strongly" typed, but allows casting back and forth to such
types as void*. Could be called the dark side of the strong typing. And
I'm not mentioning the funny cast operators in C++.

That reminds me :

The Typing is strong with this one.
The Typing can have a strong influence on the weak-minded.
I want to learn the ways of the Typing and become a Haskell coder like
my father.
For my ally is the Typing, and a powerful ally it is.

-- 
"You don't mean odds and ends, you mean des curieux et des bouts", corrected
the manager. -- Terry Pratchett, Hogfather


Re: Perl 5 now uses Git for version control

2008-12-22 Thread Rafael Garcia-Suarez
2008/12/22 Léon Brocard :
> 2008/12/22 Nicholas Clark :
>
>> If your network lets you, it's probably faster to do this:
>>
>>  git clone git://perl5.git.perl.org/perl.git perl-git
>
> If you are interested in hacking on perl, we're putting together a
> document which leads you slowly into it:
>
>  http://perl5.git.perl.org/perl.git/blob/HEAD:/pod/perlrepository.pod

Also:
http://dev.perl.org/perl5/source.html
(and an already outdated copy of perlrepository.pod there)

dev.perl.org/perl5 is not very pretty, but it shouldn't be left to
rot. (which means also that I'm taking patches :)



Re: Perl's lack of 'in' keyword

2008-10-10 Thread Rafael Garcia-Suarez
2008/10/10 Paul Makepeace <[EMAIL PROTECTED]>:
> Back to programming languages(!)
>
> Just as a different perspective, here is Python growing a ternary operator,
> i.e. how to get the same behavior as the C-like C ? A : B. There was
> considerable debate about this, with Guido eventually Making a Decision.
> What's interesting is that python gets ?: without any additional keywords,
> or... punctuation: http://www.python.org/dev/peps/pep-0308/
>
> There's no moral judgment here, just thought it was an interesting aside
> from lies & nazism.

But isn't aesthetics the ultimate moral judgment for the centuries to come ?

And honestly, putting the condition in the middle just makes me want
to poke my eyes out with a snail fork.


Re: Perl's lack of 'in' keyword

2008-10-09 Thread Rafael Garcia-Suarez
2008/10/9 Iain Barnett <[EMAIL PROTECTED]>:
> I've no idea what smart match should do when confronted with an object -
> check against each value in it's hash? It's the smart one, not me! :_)

Check if the ~~ operator is overloaded and call it, of course.


Re: svk v git + possible gig

2008-09-09 Thread Rafael Garcia-Suarez
2008/9/8 Nicholas Clark <[EMAIL PROTECTED]>:
> On Mon, Sep 08, 2008 at 05:59:26PM +0100, Paul Makepeace wrote:
>
>> Has anyone used perforce? Do you also think it makes the OSS VCS look
>> especially weak?
>
> I am much happier with its merge support than raw subversion, or subversion
> (1.4) + svn-merge.py. I've not yet tried subversion 1.5 on this front.
>
> Apart from that, perforce generally annoys me because
>
> a: it defaults to "whole checkout" rather than "this directory downwards",
>   which can confuse me, and makes it damn hard to have 2+ checkouts on one
>   machine
> b: the architectural arrogance of the "you don't need a command to reliably
>   reverse a changeset" (and how integration of an add and then an edit works)
> c: because it's most definitely not offline

d. one needs to p4-edit files one want to modify, and even if they're
not modified, they're still part of the submitted changeset.
e. p4 won't warn you about new files you might want to add. In the
same vein, there's no support for the like of
.cvsignore/.gitignore/svn:ignore etc.


Re: __DATA__ and scalars

2003-09-24 Thread Rafael Garcia-Suarez
Philip Newton wrote:
> I think Brian McCauley(sp?) has a solution to this (that he wanted to 
> get into the Perl FAQ) using here-docs. Something like this:
> 
> my $data = join '', ;
> eval "\$data = <;

(I tend to think that this is an argument in favor
of the syntax "do FILEHANDLE")



Re: Arrgh!

2003-09-19 Thread Rafael Garcia-Suarez
Jasper McCrea wrote:
> 
> What's a pirate's favourite country?

Isn't there one with lightbulbs ?

There's always one with lightbulbs.

-- 
Q: How many extreme programmers does it take to change a lightbulb?
A: Two (Firstly to write the regression tests, then to declare that it's a
   hardware problem)  -- Nicholas Clark in p5p



Re: How many lines of Perl code?

2003-09-16 Thread Rafael Garcia-Suarez
Andy Wardley wrote:
> Just for fun:
>   How many lines of Perl code have been written?  Ever.

And, how many lines of Perl code have been cargo-culted from Matt's
script archive ?  Ever ;-)



Re: [ot] doubtless silly perl question

2003-09-16 Thread Rafael Garcia-Suarez
Joel Bernstein wrote:
>   my $foo=( split ',' => $line )[7];

Side note : use /,/ instead of ','.
The 1st argument to split() is always a regexp (1), and write it this way
if you don't want to debug what's wrong with C $foo>.

­-
(1) except when it's a single space " ". :-)



Re: Spam tarpits...

2003-09-10 Thread Rafael Garcia-Suarez
Ronan Oger wrote:
> Qmail has a tarpit patch. more about it here:
> 
> http://www.palomine.net/qmail/tarpit.html

Side-comment :

I guess each major open source project gives birth to a
different-shaped community.

I'm always amazed at the qmail community, where the main
currency unit seems to be unofficial patches. It's a bit
like if patches were gold coins to be found in obscure
dungeons. Guess who is the dragon ;-)



Re: Audiofile::Info

2003-09-09 Thread Rafael Garcia-Suarez
Matt Lawrence wrote:
> > INC is one of those symbols that are always forced into package main::.
> > (they're listed at the end of perlvar.)
> 
> Is it not possible to use local() on these variables, then?

Well, you can local()ise variables in main:: just like any other ones.
local() creates a temporary value, not a temporary variable.



Re: Audiofile::Info

2003-09-09 Thread Rafael Garcia-Suarez
Dan Brook wrote:
> > > 
> > >   use vars '%INC';
> > 
> > useless use of "use vars" : the INC symbol is exempt from strict-vars
> > errors. Or do you use a buggy version of perl that I don't know about
> > ?
> 
> No, I was just keeping my own copy of %INC so it didn't interfere with
> the main %INC.

INC is one of those symbols that are always forced into package main::.
(they're listed at the end of perlvar.)



Re: Module dependencies

2003-09-08 Thread Rafael Garcia-Suarez
Michael Stevens wrote:
> 
> Probably you could get most of the data the experimental way - %INC will
> list things loaded with do, require, or use (see perlvar), so you could
> 'use' each interesting module on its own and monitor which files get
> loaded, and generate a suitable graph.

I think that Module::Info (by Schwern) uses a slightly more
sophisticated technique. However, whithout a web connection at
the moment, I'm unable to confirm this. So this information is
potientially completely worthless.



Re: Exim and HELO

2003-09-08 Thread Rafael Garcia-Suarez
Jason Clifford wrote:
> On Mon, 8 Sep 2003, Robin Berjon wrote:
> 
> > > It's Willow.
> > 
> > My oh my. To say I had been putting such an absurd notion on the back of the 
> > fact that they were rosbifs. You're making me doubt if building that tunnel was 
> > a good idea, maybe it was better off as an island.
> > 
> > Faith Faith Faith Faith Faith.
> 
> No, it's definitely Willow - particularly in leather. 

What do you guys have about this leather thing ?

Willow is definitively able to configure sendmail blindfolded, while
Faith is probably barely able to use elm(1) at all. 'nuff said.



Re: Module dependencies

2003-09-08 Thread Rafael Garcia-Suarez
Shevek wrote:
> 
> Surely identifying the dependencies of any one module is incomputable in 
> general, and most likely incomputable in the specific cases of many 
> popular modules, especially those with baroque plugin architectures.

Of course that depends on whether you want to compute the dependencies
yourself, or if you rely on metadata such as the Makefile.PLs and
the META.yml files.

-- 
Upward is not *NIX



Re: Exim and HELO

2003-09-08 Thread Rafael Garcia-Suarez
Nicholas Clark wrote:
> On Mon, Sep 08, 2003 at 11:58:57AM +, Dominic Mitchell wrote:
> > Jonathan Stowe <[EMAIL PROTECTED]> wrote:
> 
> > > MTA Advocacy  Zzzz
> > 
> > What, you'd rather we talked about *cars* or something like that?
> 
> I thought traditional london.pm advocacy was whether Willow or Buffy was
> on top.

It's Willow.

And she writes sendmail.cf files by hand. (due to her high level of wizardry ;-)



Re: Audiofile::Info

2003-09-08 Thread Rafael Garcia-Suarez
Apparently my mail server was dead for three days...

Rafael Garcia-Suarez wrote before the week-end:
> Dan Brook wrote:
> > 
> >   use vars '%INC';
> 
> useless use of "use vars" : the INC symbol is exempt from strict-vars
> errors. Or do you use a buggy version of perl that I don't know about ?



Re: Dave and Religion

2003-09-08 Thread Rafael Garcia-Suarez
Jason Clifford wrote:
> 
> Christianity is a derived form of Judaism. It teaches that there is one 
> God and that's it. 

Nope -- Christianity is a derived form of Zorostrianism, with a few
Judaic influences, since Jesus was Jew. Note that Judaism was itself
heavily influenced by Zorostrianism, esp. during their slavery in
Babylon (monotheism, angels.)

Some of the non-Judaic features of Christianism that are directly
borrowed from Zoroaster :
 - struggle between Good and Evil at the end of times
 - the second coming (the Saoshyant will come at the end of times and
   save the vertuous part of humanity)
 - the Saviour is born the day of the winter (25th december in the old
   pre-julian calendar)
 - and the mother of the Saoshyant is a virgin
 - heaven and hell
 - angels and archangels
 - Satan (Ahriman), the rebel angel
 - ceremony of communion (Haoma)
 - the day of the sun (sunday) is sacred (jews had shabbat, not quite the
   same thing)
 - that circle of light behind the head of saints (what's the english
   word ?)
 - specialized priests, not allowed to have a wife



Re: Audiofile::Info

2003-09-08 Thread Rafael Garcia-Suarez
Dan Brook wrote:
> 
>   use vars '%INC';

useless use of "use vars" : the INC symbol is exempt from strict-vars
errors. Or do you use a buggy version of perl that I don't know about ?



Re: Ob-buffy

2003-09-04 Thread Rafael Garcia-Suarez
Nigel Rantor wrote:
> > Hopefully Lynch hasn't completely given away the
> > idea of coming back to TV...
> 
> And Wild Palms was forgettable. Well, I saw it and now it is forgotten. 

I've seen it. I some point I was looking at the original comic books
(never found them). It's true that the first episodes have some lynchean
colour, (not mentioning the presence of Robert Loggia), but Lynch didn't
participate in them, did he ?

http://www.imdb.com/title/tt0106175/



Re: Ob-buffy

2003-09-03 Thread Rafael Garcia-Suarez
Dave Cross wrote:
> You jest surely. Have you never seen "The Prisoner" or "Twin
> Peaks"?

While Twin Peaks was pretty good, (and I enjoyed the companion movie as
well), I don't think it has the same level of achievement and
homogeneity than Buffy and the Prisoner. It's more like a testbed for
Lynch's next movies. Hopefully Lynch hasn't completely given away the
idea of coming back to TV...



Re: Ob-buffy

2003-09-03 Thread Rafael Garcia-Suarez
Paul Mison wrote:
> Babylon 5 is an obvious counter-example,

First time I encounter this title. I think it was never
broadcast in France, at least not on a public channel. Or is
it ancient ?



Re: Ob-buffy

2003-09-03 Thread Rafael Garcia-Suarez
Jason Clifford wrote:
> 
> Hollywood commercialism had it's chance with Buffy and produced the movie 
> - truly awful rubbish that nearly frightened any TV network from buying 
> the show when Joss finally got complete control to make it himself.

Indeed BtVS is, at a rarely-precedented level, the "work of one man".
It's clear, when watching interviews of the scenarists or other members
of the team, that Whedon had control over every aspect of the show. I
know no other example of this on TV, except McGoohan and the Prisoner.



Re: Bad C Source (Re: gzipping your websites WINRAR 40 days trial)

2003-09-03 Thread Rafael Garcia-Suarez
Nicholas Clark wrote:
> 
> At the risk of going off topic, the Perl 5 source isn't exactly pleasant.
> And contains gotos. IIRC I added 2 between 5.6.0 and 5.8.0, but the
> alternative was a big mess of if()s and braces. C doesn't have all the
> nice loop labelling features of a certain other language.

In bleadperl :
$ perl -lne 'print if /\bgoto\b/' *.[ch] | wc -l
605

This is a rough metric, there are probably less actual gotos than this
(because of comments and because "goto" is a perl keyword -- not
forgetting the yacc-generated code, that contains gotos as well).

However most of gotos appear to be in the tokenizer and in the regular
expression engine. Thoee are based on state machines, and IMHO gotos are
legitimate in state machines.



Re: insidious biometrics, identity crises

2003-09-01 Thread Rafael Garcia-Suarez
Philip Newton wrote:
> On 1 Sep 2003 at 9:56, Rafael Garcia-Suarez wrote:
> > 
> > The obligatory dantesque reference ?
> 
> No, the obligatory "language that's very easy to program in, hence 
> suited for large projects".

Yep, I've already looked at that... thing...
I was more in the line of "language for evil projects" -- the kind
of thing BOFHs could write their crontab scripts in.

> http://www.google.com/search?q=malbolge&btnI=I%27m+Feeling+Lucky

And they erroneously state that Malebolge ("the pouches of evil")
is the 9th circle -- it's only the 8th one.

Wasn't there a project to port INTERCAL to parrot ?



Re: insidious biometrics, identity crises

2003-09-01 Thread Rafael Garcia-Suarez
Piers Cawley wrote:
> 
> How would they know who to arrest if nobody turned up with the ID
> card within seven days?

Implementation detail. Do you think that the marketroids that work
for the government are any better, on the average, than the others ?

Oh, and ID cards should be soft pink, too. More pleasant to the
customers' eyes : so they'll accept them with more facility.



Re: insidious biometrics, identity crises

2003-09-01 Thread Rafael Garcia-Suarez
Philip Newton wrote:
> On 29 Aug 2003 at 22:29, Piers Cawley wrote:
> 
> > Michael Stevens <[EMAIL PROTECTED]> writes:
> > 
> > > Aah, but what programming language would be best for them to use on
> > > such a project?
> > 
> > Befunge. Or Brainfuck. Maybe INTERCAL.
> 
> Malbolge.

The obligatory dantesque reference ? That's the circle of liars
and fakers, obviously that doesn't fit very well.



Re: insidious biometrics, identity crises

2003-08-29 Thread Rafael Garcia-Suarez
David Landgren wrote:
> 
> I think it would be a nice idea.

Although the scope of Ghandi's quote is much broader than the sole
North-American civilisation.

-- 
Their syphilisation, you mean, says the citizen.
-- J. Joyce, Ulysses



Re: Getting a Hashkey for a Perl Data Structure

2003-08-29 Thread Rafael Garcia-Suarez
Mark Fowler wrote:
> 
> Essentially what I need to do is calculate a hashkey for a Perl data
> structure.  What's the commonly accepted wisdom to do this?  My wee little
> brain is thinking serialisation either by Storable or YAML and then hashing
> with Digest::MD5 or one of the other common string hashing routines.  The
> only problem I see with this is things like different versions of Storable
> suddenly hashing to different values.

And even the same version of Storable (or Data::Dumper), with perl
5.8.1, will produce different results for the same hash, due to
the new random ordering of hash keys. On the other hand YAML produces
sorted keys by default, is a documented format, and is more compact.



Re: insidious biometrics, identity crises

2003-08-28 Thread Rafael Garcia-Suarez
Earle Martin wrote:
> On Thu, Aug 28, 2003 at 09:48:56AM -0500, Elaine -HFB- Ashton wrote:
> > You don't carry any ID on you at times? What
> > happens if you get hit by a bus and you're alone? How do you expect your
> > body will be identified? 
> 
> My debit cards? Business card? Piece of paper in my wallet that states my
> name, address and telephone number? (Yes, I have one.) There are plenty of
> things you can identify yourself with, and none of them need to be
> mandatory.

I always have in my wallet an official and signed statement asserting
that I authorize hospitals to take my organs off my dead body and use
them without bothering asking my family. As a side-effect, it identifies
me.

> > Getting fussy over having to carry an ID card, much like your health card
> > and your Tesco card and your bank card and your credit cards...work on a
> > more credible argument :)
> 
> Can you be arrested for not carrying any of those? Can a policeman stop you
> in the street because he/she doesn't like the look of you and _require_ you
> to produce them, with the full force of the law behind him/her? I think
> you'll find that the answer is no.

I remember six or seven years ago, there was that G7 summit in Lyon. My
flat was 50 meters next to the Hotel de Ville were all presidents and
ministers were awaited. At each and every corner, policemen and soldiers
were asking people for papers. I had to prove I was living in this
street to be actually able to walk in it.



Re: @INC

2003-08-20 Thread Rafael Garcia-Suarez
Andy Ford wrote:
> How do I change the search directories in @INC?

Recompile perl and reinstall.

> I have recently installed a later version of perl (5.8.0) from version
> 5.6.1 on a solaris 2.8 box. I am now trying to make new perl modules to
> use under this distribution but @INC point ot the wrong directories -
> @INC shows the following 
> 
> @INC contains: /usr/local/lib/perl5/5.8.0/sun4-solaris
> /usr/local/lib/perl5/5.8.0
> /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris
> /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl
> 
> ... and 5.8.0 is installed in /usr (i.e. /usr/bin/perl and
> /usr/lib/perl5/5.8.0) rather than /usr/local so nothing works

Strange screwup.
How did you install 5.8.0 ? Was there a previous 5.8.0 over there ?



Re: [RFC] arbitary maths evaluation

2003-08-17 Thread Rafael Garcia-Suarez
Nicholas Clark wrote:
> On Sat, Aug 16, 2003 at 11:13:53AM +0100, Simon Wistow wrote:
> 
> > I think the potential for me to mess up with Safe is too great,
> 
> Safe has bugs. You don't need to mess up - it's already done
> for you. Safe isn't.

More precisely there are quite a lot of opcodes that aren't caught
by Safe as of 5.8.0. For example, IIRC, regular expression matches.
5.8.1 will fix this -- but still not for *all* opcodes. As this is
a core bug, that can't be fixed by a CPAN upgrade.

Moreover you can still do annoying things with innocent-looking
opcodes. Enumerating 1..1_000_000 for example...

> (mmm. that sounds like FUD. Hopefully someone (Rafael? Arthur?) can fill
> in the details)



Re: Exporting Symbols

2003-08-17 Thread Rafael Garcia-Suarez
Nigel Rantor wrote:
> 
> The reasoning is not so that the namespace doesn't get polluted. His 
> argument is regarding space efficiency.

That might matter in an Apache::Registry environment.

Each Apache::Registry script is compiled in its own namespace ;
importing symbols takes space (not so much, though) in the namespace's
smybol table ; mod_perl careful programming guidelines recommend
to spare space.



Re: Siesta party

2003-08-14 Thread Rafael Garcia-Suarez
Chisel Wright wrote:
> On Thu, Aug 14, 2003 at 02:03:17PM +0200, Elizabeth Mattijsen wrote:
> > Hmmm... PerlIO::via::backwards?
> 
> Or (assuming vim as the mutt editor used):
> 
>   select lines, then !rev

Or perhaps more accurately :
%!rev
%ri
%!tac
although using external commands makes me nervous,
portability-wise.



Re: talking of arrays....

2003-08-14 Thread Rafael Garcia-Suarez
[EMAIL PROTECTED] wrote:
> I was just wondering why this:
> 
> @m=([(_)x10])x5;
> $m[1][2]=o;
> 
> for $y (0..4)
> {
>   for $x (0..9)
>   {
> print "$m[$y][$x]";
>   }
>   print " $y$/";
> }
> 
> produces this:
> __o___ 0
> __o___ 1
> __o___ 2
> __o___ 3
> __o___ 4
> 
> ?

the x operator on lists makes shallow copies, not clones.
The five rows contain the same arrayref.
See :

$ perl -wle '@x=([])x2;print [EMAIL PROTECTED]'
ARRAY(0x810ba34)
ARRAY(0x810ba34)



Re: Siesta party

2003-08-14 Thread Rafael Garcia-Suarez
Nigel Rantor wrote:
> Talking 
> of Jamon...here's a really *nice* restaurant in that area...
> 
> Jamon Jamon

Does the French madness about movie-named restaurants invade London ?

http://www.imdb.com/Title?0104545

> Must try stuffed baby red peppers, white anchovies, mushrooms with 
> spinach & bechamel sauce.

Béchamel !~ Spanish food (Béchamel was a French cook, and
AFAIK he's one of the first persons to have his name attached
to a recipe.)



Re: [OT] submitting a perl bug without ``perlbug''?

2003-08-05 Thread Rafael Garcia-Suarez
Belden Lyman wrote:
> A few months back I encountered a switch ordering bug with
> Perl 5.6.1 and 5.8 on Solaris. (-w -T on #! line doesn't work;
> -T -w does work, as do -wT and -Tw.)
> 
> I wasn't able to 'perlbug' it at the time, and am still unable
> to do so. On occassion, I remember the bug and wish there were
> some way for me to submit it... what's the accepted way to do
> so in this case?

Send an email to perlbug at prel punkt org.
Don't forget perl -V, esp. because I can't reproduce your bug
(if I understood correctly :)

$ cat foo.pl 
#!/opt/perl580/bin/perl -w -T
print "${^TAINT} $^W\n";

$ ./foo.pl 
1 1



Re: text'd or texted

2003-08-05 Thread Rafael Garcia-Suarez
Philip Newton wrote:
> On 5 Aug 2003 at 9:41, Andy Ford wrote:
> 
> > Another word to confuse the non English speaking community -the verb to
> > text!!
> 
> Any noun can be verbed (though verbing weirds language).

"hlör u fang axaxaxas mlö".

I let you "google" for it.



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

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

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



Re: Magazines

2003-07-02 Thread Rafael Garcia-Suarez
Dean Wilson wrote:
> I've been clearing out my bookmarks and found one for the Perl Review,
> (http://www.theperlreview.com/), after a quick mosey around the site it
> looks like its stopped being published. Does any one know the story behind
> it?

The work force behind the Perl Review is brian d foy, who apparently
is currently quite busy somewhere near Iraq. Hence this temporary
interruption.

(I noticed as well some lack of activity on the perlfaq CVS.)



Re: [ot] Mounting Unix Drives in Windows

2003-07-01 Thread Rafael Garcia-Suarez
Robin Berjon wrote:
> Rafael Garcia-Suarez wrote:
> > Alternatives :
> > WebDAV ? IIRC Windows' file explorer supports it natively.
> 
> It does. I'm not sure however that using WebDAV as a full time file system is a 
> happy choice, not sure it's been tested that intensively. It'll also be slow.

So WebDAV, like Samba, doesn't require any additionnal software on the
recent clients. Good point for it.

The relative performances depends on the use case. I believe that WebDAV
demands less bandwidth than Samba.

I'm quite confident in the quality of mod_dav (for apache 2) due to my
experience with Subversion. But that's a personal impression. We don't
use WebDAV by itself at work -- just as a support layer for DeltaV, the
protocol extension used by Subversion over http.

Now there's also the questions of access control, file ownership, rights
management, etc... which are (to my taste) easier to manage in Apache
than in Samba. Former administrator of both speaking.



Re: [ot] Mounting Unix Drives in Windows

2003-07-01 Thread Rafael Garcia-Suarez
Dave Cross wrote:
> So, a few questions:
> 
> 1/ How much chance is there that a Samba installation will cause
> problems? How stable is Samba?

Samba is quite stable, but well, it has the same problems than NetBIOS :
it's bandwidth consuming (designed for LANs). And if the machines are
open on the Outside, you must be very careful about security, access
control and software updates.

> 2/ Is there anyone that will provide a commercial support contract
> for Samba?
> 
> 3/ Are there any other solutions we can look at - like, perhaps,
> an NFS client for Windows?

There are NFS clients for Windows. Alternatives :
WebDAV ? IIRC Windows' file explorer supports it natively.
rsync ? (over ssh ?) (hey, that's another fine piece of software A.
Tridgell is reponsible for)

It's difficult to give a advice without knowing the use case.



Re: auction time

2003-06-26 Thread Rafael Garcia-Suarez
Greg McCarroll wrote:
> * Rafael Garcia-Suarez ([EMAIL PROTECTED]) wrote:
> > 
> > I could sell a running joke, or another recurrent mention of
> > something, for the P5P summaries. - That's not like I was
> > copying on Piers. Is it ?
> 
> straw poll - would anyone be interested in bidding on this?

More amazing things happen.

> just think you could give Rafael a word to use every time 
> and see how long it took people to spot it. or maybe you could
> buy it and propose to your loved one via a P5P summary, how
> romantic! ;-)

Or more seriously you could buy a feature. Force me to include
weekly stats, for example (number of mails, of patches, of bugs,
of fixes, of commits...).



Re: auction time

2003-06-26 Thread Rafael Garcia-Suarez
Greg McCarroll wrote:
> So does anyone have anything that they think would sell?

I could sell a running joke, or another recurrent mention of
something, for the P5P summaries. - That's not like I was
copying on Piers. Is it ?



Re: Number Indicating Participation in London.pm (NIPL) (was:assimilating CPAN)

2003-06-18 Thread Rafael Garcia-Suarez
Earle Martin wrote:
> 
> Wouldn't hacking perl be more of a lowest common denominator here? You 
> also missed out the crucial IRC bit. I'd rearrange the bits to:
> 
>  owns a pony
>  | lives or works in the London area
>  | | actively subscribed to mailing list
>  | | | regularly attends London.pm technical meetings
>  | | | | regularly attends London.pm social meetings
>  | | | | | is a regular on #london.pm
>  | | | | | | has written an Acme module
>  | | | | | | | hacks perl 
>  | | | | | | | |
>  ---
>  1 6 3 1 8 4 2 1 
>  2 4 2
>  8 
>  
> I had to drop the Buffy bit. 

That's a first design flaw : "eight parameters will be enough for all
purposes".

> On your original scale, my NIPL is bigger than yours, but not by much, at
> 250 to 160. On this modified scale, my NIPL towers over yours by 125 to 33,
> which is clearly a much more reasonable result. ;)

That's a second design flaw : the mandatory ordering of bits, and the
temptation to score people according to their NIPL's weight.

I'd like to propose an alternative implementation, the London.pm Indice
of Purity String. Instead of using bits, it uses characters that may or
not be present in a string.

# is a regular on #london.pm
L lives or works in the London area
P hacks perl
a has written an Acme module
b watches Buffy
m actively subscribed to mailing list
p owns a pony
s regularly attends London.pm social meetings
t regularly attends London.pm technical meetings

Then, we could use the Levenshtein distance (did I got the spelling
right?) to "#LPabmpst" to calculate the degree of purity. For free, by
calculating the L-distance between two members' LIPSs, we could have a
rational measure of their affinity. For example, the company of someone
who doesn't watch Buffy won't be very appealing to me.

Aren't LIPSs better than NIPLs ?

-- 
RGS : my $LIPS = q/Pbm/;



Re: Something is wrong with my conceptual model of regexes

2003-06-17 Thread Rafael Garcia-Suarez
Roger Burton West <[EMAIL PROTECTED]> wrote:
> This has bitten me several times. A recent example:
> 
> I have a file in HTML-like markup. I've just found a piece of text to
> which I might want to do something, but not if it's within a tag. The
> file up to but not including the match is in $foo. I match:
> 
> $foo =~ /([><]).*?$/s;
> 
> which should, according to the way I think of regexes, find me the last
> < or > character (and if it's a >, then the match isn't inside a tag).
> But it doesn't; it finds me the first, even though it's supposedly a
> non-greedy match. Why?

because .*? doesn't backtrack.
It only stops as soon as it matches.

> (I know how to _solve_ this; I do
> 
> $foo =~ /([><])[^><]*?$/s;
> 
> instead. But I want to know why I make the mistake.)
> 
> Roger
> 
> 



Re: reading other people's lexicals

2003-06-16 Thread Rafael Garcia-Suarez
Robin Houston wrote:
>   
> ps. If anyone has any idea why PadWalker doesn't work with bleadperl,
> I'd be interested in hearing it!

There has been some massive reorganisation in the pad code.
(I suggest that you ping Dave Mitchell. He knows this part best.)



Re: [JOB][HERESY] Python / wxPython GUI developer

2003-06-13 Thread Rafael Garcia-Suarez
Lusercop wrote:
> On Fri, Jun 13, 2003 at 11:58:23AM +0100, Leon Brocard wrote:
> > ... H lp! S m b d st l ll th v w ls fr m m k yb rd!
> 
> This is totally inconsistent, at the very least, "y" should be either a
> vowel or not, it can't be both, as above...

Nope : 

(there's probably some algorithm on CPAN to decide whether some
particular english 'y' acts as a vowel or a consonant, but I'm
a bit tired right now to look it up.)



Re: [JOB][HERESY] Python / wxPython GUI developer

2003-06-13 Thread Rafael Garcia-Suarez
acme wrote:
> I've been reading the Python Cookbook and it's all quite
> interesting apart from the whitespace.

Butabookwithoutanywhitespacewouldbedifficulttoread,wouldn'tit.



Re: [scott@asofyet.org: xsubpp patch]

2003-06-12 Thread Rafael Garcia-Suarez
Joel Bernstein <[EMAIL PROTECTED]> wrote:
> > This hit the gtk-perl list, and looks really damn useful for all XS
> > developers. I'm certainly going to give it a whirl, because xsubpp error
> > reporting is Broken and Wrong, currently.

Any reason not to use the less intrusive (but untested) patch below ?

Index: lib/ExtUtils/xsubpp
===
--- lib/ExtUtils/xsubpp (revision 1484)
+++ lib/ExtUtils/xsubpp (working copy)
@@ -1697,7 +1697,9 @@ sub Warn
 # work out the line number
 my $line_no = [EMAIL PROTECTED] - @line -1] ;
 
-print STDERR "@_ in $filename, line $line_no\n" ;
+# standard compiler output format, to work with things that parse
+# compiler errors and take you to them, e.g. vim and emacs
+print STDERR "$dir/$filename:$line_no:@_\n" ;
 }
 
 sub blurt
End.



Re: The Perl Color?

2003-06-06 Thread Rafael Garcia-Suarez
Dominic Mitchell wrote:
> Lusercop wrote:
> > 
> > What's this "M-x" rubbish?
> 
> Just take this red pill, labelled "emacs.rpm".  You'll soon find out how 
> deep the elisp hole really goes.

What's that ".rpm" rubbish ?



Re: The Perl Color?

2003-06-06 Thread Rafael Garcia-Suarez
Iain Tatch wrote:
> 
> JC> variables are light blue
> s/light blue/ref($&)eq'hash'?brown
> :ref($&)eq'array'?light green
> :light blue/e

Of course this is a no-op, once the syntax fixed.

-- 
s/\w+/gray/g if $colour_blind;



Re: The Perl Color?

2003-06-05 Thread Rafael Garcia-Suarez
Elaine -HFB- Ashton <[EMAIL PROTECTED]> wrote:
> 
> I registered the domain 'perlnuns.org' a long time ago but it never really
> got going due to a decided lack of women and interest. It was likely for
> the best though as perl already has enough of a religious and cultish
> cachet.

And if you're depicting oneself as a monk, this could be an avatari of
that awesome fellow of Robin Hood, (what's his name?), who prefers
beverages to prayers.

On the other hand, nobody wants to be a nun.

-- 
rgs the perljesuit



Re: The Perl Color?

2003-06-05 Thread Rafael Garcia-Suarez
"Dave Cross" wrote:
> 
> Is there any reason why you're not interested in the opinions
> of the women on this list?

Because there are no perl nuns ?
(seems to me that a discussion with "monks" necessarily
involves "brothers")