Re: 25 Years of Perl

2012-11-26 Thread Graham Barr

On Nov 24, 2012, at 22:43 , David H. Adler d...@panix.com wrote:

 On Thu, Nov 22, 2012 at 12:25:33PM +, Dave Cross wrote:
 Quoting Guinevere Nell guinevere.n...@gmail.com:
 
 On that subject, I recall that search.cpan.org sucked at the start and I'm
 not sure who fixed it (the search) and who maintained CPAN (and it's
 accumulating wonderful -- and sometimes silly -- modules) but yeah it's the
 heart of most development ...
 
 That's a good point. I know when CPAN started (1995) but I don't
 know when search.cpan.org launched. Can anyone help there?
 
 It was originally Graham's project, so he'd probably be the one to ask.

search.cpan.org started  in 1998 about the same time as cpan testers

search.cpan.org was originally hosted on a Sun Solaris box at Washington 
University in St. Louis (wustl.edu) by Elaine Ashton

due to storage constraints the original site did not keep an unpacked version 
of CPAN as it does now. It unpacked the tarball to index the cleaned up. During 
a request for a pod document it would extract the pod from the tarball and 
cache the generated html, purging the cache as space was needed.

I think it was around 2001 that we started keeping CPAN in an unpacked form.

In 2003 there was an auction at OSCONN in Portland, won by London PM, which 
resulted in the colors of search being changed to orange for a while. We did a 
fund raising campaign to expedite the return to its original color which was 
quite controversial.

Also, cpantesters was originally a static site. I had a script which processed 
emails sent to a mailing list which generated the files and uploaded them to my 
isp. I was on a dialup machine at home at the time so this script was run once 
a day when I got home from work. It later moved to also be hosted at wustl.edu 
and be more dynamic.

Graham.




Re: Exiting eval via next [perl v5.14]

2011-11-04 Thread Graham Barr

On Nov 4, 2011, at 11:36 , Chisel wrote:
 
 # why no error?!
 $ perl -M5.14.0 -wle 'for my $i (qw/foo/) { eval { $i.=q{}; next; }; } say
 done'
 done

Because the next never happens, check $@ you will see

Modification of a read-only value attempted

Graham.



Re: XS Constants peculiarity

2010-10-28 Thread Graham Barr

On Oct 28, 2010, at 10:09 , Dirk Koopman wrote:

 On 28/10/10 17:26, Chris Jack wrote:
 
 Dirk Koopman d...@tobit.co.uk wrote:
 This is not my stuff, this is generated from the original header file(s).
 
 Prototypes? Functions??
 
 What kind of a solution are you looking for here and what is your real 
 problem?
 
 There is a fair but not insurmountable amount of code. RK+LOCK is common 
 (meaning Read Key with Lock on some C-Isam files). More people used to the C 
 version of the system are likely to start using it and RK+LOCK is a even more 
 common idiom there.
 
 Manually defining all the constants using use constant is IMHO a cop out 
 without understanding why.
 
 
 Have you tried the suggestion about surrounding your constants in round 
 brackets? Or is this so widespread in your code that it would take too long.
 
 
 Yes, and it fixes the problem.
 
 There are several hundred constants. Some of which are bit maps.
 
 However it does not explain why a constant, that is generated from a header 
 file by h2xs, is taken to be a function with arguments. Especially as all the 
 XS code (and generated C) implies it is an integer.

It depends how the functions themselves are defined and exported from the 
module.

h2xs IIRC depends on AUTOLOAD to actually make the constant subs get defined. 
However this does not happen until the constant is first needed at runtime and 
the import sub is really exported an undefined subroutine, causing AUTOLOAD to 
be called when needed.

THe smallest should would be to make your import sub create the sub when it is 
imported and ensure that sub is created with a prototype of (), then you code 
for RK+LOCK will work.

Graham.




Re: Posting to blogger.com?

2010-06-03 Thread Graham Barr
On Jun 3, 2010, at 5:06 AM, Steve Mynott wrote:
 On Wed, Jun 02, 2010 at 05:52:40PM +0100, Mark Fowler typed:
 
 On Wed, Jun 2, 2010 at 4:29 PM, Dave Hodgkinson daveh...@gmail.com wrote:
 
 On 2 Jun 2010, at 21:38, Egor Shipovalov wrote:
 use File::Slurp;
 
 This is the start of most scripts I've been writing recently.
 
 I dumped this since I started using Path::Class all the time.
 
 my $content = file(something)-slurp
 
 Does it work with UTF-8?

It does with this patch

https://rt.cpan.org/Public/Bug/Display.html?id=58088

  my $content = file(something)-slurp(iolayers = ':encoding(utf8)');

Graham.




Re: Perl Christmas Quiz 2009

2009-11-30 Thread Graham Barr

On Nov 30, 2009, at 3:17 PM, Graham Barr wrote:

 
 On Nov 30, 2009, at 2:14 PM, Randal L. Schwartz wrote:
 
 Dave == Dave Cross d...@dave.org.uk writes:
 
 1) Without running it to check, what does the following program output?
 
 
 my %a = (3,2,1,0);
 
 
 for my $b (sort values %a) {
 $b += 4;
 }
 
 
 print $a{1} . \n;
 
 Dave Without running it, I'd say 4. Having now run it, I'm glad that's what 
 I said
 Dave :)
 
 When did sort start returning lvalues?  I bet if you did this
 on an older Perl, it'd return 0.
 
 sort just shuffles whatever SV* are on the stack, and values returns aliases, 
 so
 in this case you end up with aliases being returned by sort.

I meant to add that this change to sort was added to 5.6.0. So to answer your 
question it was nearly a decade ago :-)

Graham.




Re: Perl Christmas Quiz 2009

2009-11-30 Thread Graham Barr

On Nov 30, 2009, at 2:14 PM, Randal L. Schwartz wrote:

 Dave == Dave Cross d...@dave.org.uk writes:
 
 1) Without running it to check, what does the following program output?
 
 
 my %a = (3,2,1,0);
 
 
 for my $b (sort values %a) {
 $b += 4;
 }
 
 
 print $a{1} . \n;
 
 Dave Without running it, I'd say 4. Having now run it, I'm glad that's what 
 I said
 Dave :)
 
 When did sort start returning lvalues?  I bet if you did this
 on an older Perl, it'd return 0.

sort just shuffles whatever SV* are on the stack, and values returns aliases, so
in this case you end up with aliases being returned by sort.

Graham.




Re: Perl Christmas Quiz 2009

2009-11-30 Thread Graham Barr

On Nov 30, 2009, at 3:51 PM, Abigail wrote:
 
 
 I meant to add that this change to sort was added to 5.6.0. So to answer 
 your question it was nearly a decade ago :-)
 
 
 Which was the same release where values() returned aliases instead of copies.

Ah, you are right. sort was before that. the oldest perl I have is 5.4.5 which 
gives

$ /apps/perl-5.4.5/bin/perl5.00405  -l
my @a = (4,3,2,1);
for my $x (sort @a) { print ++$x; }  
print @a;
__END__
2
3
4
5
5432

Graham.




Re: Unresponsive module authors

2003-09-25 Thread Graham Barr
On 25 Sep 2003, at 10:45, David Cantrell wrote:

What's the etiquette for dealing with unresponsive module authors?  
I've
tried to contact the author of Data::Compare twice now to report bugs,
with no response in nearly a month.  Should I just upload a new version
to CPAN and take over maintenance?
There is an answer to this in the CPAN FAQ

http://www.cpan.org/misc/cpan-faq.html#How_maintain_module

Graham.




Re: Exceptions

2003-09-23 Thread Graham Barr
Sorry if you see duplicates of this, I sent it originally from a 
non-subscribed address

On 23 Sep 2003, at 17:41, Nigel Rantor wrote:
Hi all,

Quick poll regarding modules to provide more OO exception facilities.

Whenever I have mucked about with this I have opted to use Graham's 
Error.pm module.
I may have wrote it initially, but it is now maintained by someone else.

I have found that it cannot handle a return within a catch block 
though, I haven't spent a lot of time exploring this yet but it is 
giving a couple of other developers some problems at the moment and 
making the code less clean than we would like.
This is because of the way it uses anonymous subs

I'm really looking for two things.

1) If anyone has any ideas about Error.pm or has found a workaround 
that would be great. I may go and have a look at the code myself if I 
get some time but if anyone has done this already I would love to hear 
from you.
At one time I was going to re-write it as a source filter. Using 
anonymous subs has all sorts of unwanted side effects, one being memory 
leaks in earlier versions of perl.

Graham.

2) Suggestions as to which exception mechanism module you would 
suggest using other than Error.pm, prefereably with reasons.

Cheers,

  N







Re: ! Orange [Was: Orange]

2003-07-14 Thread Graham Barr
On Thursday, Jul 10, 2003, at 13:35 US/Pacific, Luis Campos de Carvalho 
wrote:

Leon Brocard wrote:
Hello.
They are planning to auction the colour of search.cpan.org tonight at
OSCON. I hear that it is not going to be cheap. If you want to help me
make it orange and would like to pledge a small amount that'd be
wonderful. Emails offlist please.
Leon
  Well, nothing personal, but the search.cpan.org colour will be mine, 
unless there is no way to interact remotelly. I will stand up to my 
last penny against the Orange colour. =-]
I am sure we can do something over IRC.

Graham.




Re: Contracts for contractors

2003-06-26 Thread Graham Barr
On Thu, 2003-06-26 at 15:33, David Cantrell wrote:
 On Thursday, June 26, 2003 14:26 +0100 Andy Mendelsohn 
 [EMAIL PROTECTED] wrote:
  On Thursday, June 26, 2003, at 02:04  pm, Dave Cross wrote:
  A quid is made up of 20 shillings, each of which contains 12
  pennies.
  Sorry to correct you Dave, but i think you'll find a quid is made of of
  20 bob.
 
 So is the relationship between shilling and bob like that between GMT and 
 UTC?

No. bob has nothing todo with the French :-)

Graham.





Re: assimilating CPAN

2003-06-11 Thread Graham Barr
On Wed, Jun 11, 2003 at 04:56:20PM +0100, Nicholas Clark wrote:
 Arthur Bergman has joined the list of known London.pm-ers on muttley's
 CPAN leaderboard:
 
   http://www.thegestalt.org/simon/perl/
 
 london.pm is now responsible for 9% of CPAN.
 It would be nice to get over 10%.
 
 I know that not all london.pm-ers are in muttley's list of CPAN IDs.
 Hence if you want to be added, please mail muttley your CPAN ID
 ( [EMAIL PROTECTED] ). There's no compulsion, and neither of us are
 going to attempt to make any list of who isn't there.
 
 We don't (yet) have stats for just Acme modules. That might get more
 interesting (or just confirm our reputation)

$ zcat var/CPAN/modules/02packages.details.txt.gz | grep -c /GBARR/
121

:-)

Graham.



Re: RegEx for UK Postal Codes

2003-04-01 Thread Graham Barr
On Tue, Apr 01, 2003 at 03:43:16PM +0100, Jon Reades wrote:
 And the following exceptions are also valid to some degree:
 
 1. GIR 0AA -- a bank that sounds like they were issued this code either 
 so long ago that they hadn't decided on a format, or completely by accident

GiroBank was originally a bank service run by the Post Office so the
Post Office gave it a special postcode. It is now run by Alliance and Leicester,
but still has the special postcode. In fact the exception in GIR 0A[A-Z]
as they have different postcodes for different departments.

Graham.



Re: CPAN site

2003-04-01 Thread Graham Barr
On Tue, Apr 01, 2003 at 05:09:50PM +0100, Peter Sergeant wrote:
  Out of interest, what do people get from www.cpan.org? I only ever 
  use search.cpan.org myself. What am I missing? 
 
 a) Provides a useful link to theory5 when search.cpan.org is down

hehe. Well soon (for some definition of soon) we will have 3 independant
boxes running search.

 b) It's much easier to scan specific heirachies on it, like URI::,
 especially now that people are polluting the CPAN with modules like Meta

Can you expand on that. I have been thinking of adding catalog interface
to the module namespace onto search.

 c) It has some scripts on it

True.

 d) Some people have index pages in their home directories that provide
 (debatably) useful information

Well there is always  http://search.cpan.org/CPAN/authors/id/X/XX/XXX/
which will redirect you to thier directory on your selected mirror

Graham.




Re: CPAN site

2003-04-01 Thread Graham Barr
On Tue, Apr 01, 2003 at 05:01:22PM +0100, Cal Henderson wrote:
 At 16:55 GMT 01.04.03, Paul Mison [EMAIL PROTECTED] wrote:
 : Out of interest, what do people get from www.cpan.org? I only ever 
 : use search.cpan.org myself. What am I missing? 
 
 the mirrors list?

Have you ever looked at http://mirrors.cpan.org/

Graham.



Re: CPAN site

2003-04-01 Thread Graham Barr
On Tue, Apr 01, 2003 at 05:49:17PM +0100, Simon Wistow wrote:
 On Tue, Apr 01, 2003 at 05:43:41PM +0100, Graham Barr said:
  Can you expand on that. I have been thinking of adding catalog interface
  to the module namespace onto search.
 
 I'd love to be able to see all the TT plugins without having to search 
 for Template Plugin and getting a load of crud along with it.
 
 Perhaps I'm missing an easy way to do this though

Are you doing a module search ?

http://search.cpan.org/search?m=moduleq=Template%3A%3APlugins=1n=100

Graham.



Re: CPAN site

2003-04-01 Thread Graham Barr
On Tue, Apr 01, 2003 at 07:46:19PM +0100, Nicholas Clark wrote:
 On Tue, Apr 01, 2003 at 08:49:27AM -0800, Randal L. Schwartz wrote:
  Well, you can't run my MINICPAN[1] mirroring program against
  search.cpan.org, that I'm aware of.  Nor would you want to.
  Of course, *you* shouldn't use www.cpan.org either.  *You* should use
  uk.cpan.org.
 
 $ host uk.cpan.org 
 uk.cpan.org has address 128.252.133.13
 $ host 128.252.133.13
 13.133.252.128.IN-ADDR.ARPA domain name pointer chaos.wustl.edu

But if you do a GET you will see that it will redirect you to
ftp://ftp.demon.co.uk/pub/mirrors/perl/CPAN/

Graham.

 
 Why? It's in the US:
 
 $ traceroute uk.cpan.org
 traceroute to uk.cpan.org (128.252.133.13), 64 hops max, 44 byte packets
  1  fa2-0.pepo.router.flirble.org (194.70.3.1)  1.749 ms  1.020 ms  0.947 ms
  2  fa5-0-103.cr1.bllon.uk.easynet.net (212.134.0.1)  0.702 ms  1.114 ms  0.927 ms
  3  ge0-2-0-0.br1.bllon.uk.easynet.net (212.135.0.3)  1.414 ms  1.062 ms  1.332 ms
  4  ge0-0-0-0.gr0.bllon.uk.easynet.net (207.162.206.65)  1.706 ms  1.715 ms  1.820 ms
  5  so0-1-0-0.gr0.bwnyc.us.easynet.net (207.162.205.5)  73.571 ms  73.850 ms  74.157 
 ms
  6  iar5-so-2-0-1.NewYork.cw.net (208.173.135.213)  74.078 ms  74.340 ms  74.115 ms
  7  agr2-loopback.NewYork.cw.net (206.24.194.102)  74.407 ms  73.339 ms  74.089 ms
  8  dcr2-so-6-1-0.NewYork.cw.net (206.24.207.181)  74.015 ms  73.252 ms  73.901 ms
  9  agr3-so-2-0-0.NewYork.cw.net (206.24.207.186)  73.765 ms 
 agr4-so-2-0-0.NewYork.cw.net (206.24.207.190)  74.875 ms  73.466 ms
 10  acr1-loopback.NewYork.cw.net (206.24.194.61)  74.539 ms  74.355 ms  73.881 ms
 11  p4-3-2-0.r04.nycmny01.us.bb.verio.net (129.250.9.49)  73.750 ms 
 p4-2-1-0.r04.nycmny01.us.bb.verio.net (129.250.9.77)  73.388 ms  73.850 ms
 12  p16-1-1-0.r20.nycmny01.us.bb.verio.net (129.250.2.36)  74.247 ms  73.606 ms  
 74.176 ms
 13  p16-4-0-0.r01.chcgil06.us.bb.verio.net (129.250.4.198)  100.462 ms  101.519 ms  
 100.564 ms
 14  p16-7-0-0.r01.chcgil01.us.bb.verio.net (129.250.5.71)  100.663 ms  103.302 ms  
 101.323 ms
 15  p4-1-2-0.r00.stlsmo04.us.bb.verio.net (129.250.4.45)  119.441 ms  120.948 ms  
 119.946 ms
 16  ge-0-2-0.a00.stlsmo04.us.ra.verio.net (129.250.30.76)  121.452 ms  119.890 ms  
 120.165 ms
 17  199.217.166.226 (199.217.166.226)  121.454 ms  128.130 ms  120.231 ms
 18  128.252.1.201 (128.252.1.201)  121.736 ms  120.500 ms  121.368 ms
 19  ncrc-eng1.wustl.edu (128.252.1.50)  120.991 ms  120.932 ms  121.367 ms
 20  chaos.wustl.edu (128.252.133.13)  120.547 ms *  121.817 ms
 
 
 Surely you should use a mirror with lots of bandwidth in the UK:
 
 $ traceroute philes.flirble.org
 traceroute to philes.flirble.org (194.70.3.50), 64 hops max, 44 byte packets
  1  philes (194.70.3.50)  3.177 ms  0.731 ms  0.664 ms
 
 (my traceroutes start in Soho)
 
 Nicholas Clark
 



Re: CPAN site

2003-04-01 Thread Graham Barr
On Tue, Apr 01, 2003 at 08:49:27AM -0800, Randal L. Schwartz wrote:
  Paul == Paul Mison [EMAIL PROTECTED] writes:
 
 Paul On 31/03/2003 at 22:39 +0100, Leon Brocard wrote:
  This is terrible, terrible: http://www.cpan.org/
 
 Paul Out of interest, what do people get from www.cpan.org? I only ever use
 Paul search.cpan.org myself. What am I missing? (Please no Matt's Scripts
 Paul jokes, ta. April Fools has been tedious enough already.)
 
 Well, you can't run my MINICPAN[1] mirroring program against
 search.cpan.org, that I'm aware of.

That is because http://search.cpan.org/CPAN/ is not a real CPAN mirror,
it just redirects to the users selected mirror, which is stored in
a cookie.

Graham.



Re: Looking for a better way

2003-03-11 Thread Graham Barr
On Mon, Mar 10, 2003 at 09:44:08PM +0530, shn wrote:
 I was just bored and was wondering what would be a better way to titlecase
 something, using this right now:
 
 perl -e $_='boink boink';@a=split' ';foreach(@a){$_=ucfirst;}$_=join' ',@a;print

  perl -le $_='boink boink'; s/(\w+)/\u$1/g; print

Graham.



Re: Freelance cooperatives (was: Recruitment Consultant Database)

2003-03-04 Thread Graham Barr
On Tue, Mar 04, 2003 at 02:50:21PM +, Nick Woolley wrote:
 I also have other friends who have companies and do work for them 
 occasionally.  The main reason I'm asking this question about cooperatives is 
 because working on one's own can be damn hard, and the lesson seems to be to 

I know how it feels. I dont work for myself (yet) but I do work from home
for an American company.

 seek out like-minded company, for inspiration and moral support if nothing 
 else.  I'm looking for successful examples to follow, and potential allies.

Well I have been thinking about making the jump for a long time,
but I am finding it very hard todo so. But eventually I want to
start my own company. So if you want someone who can help, albeit
on a limited basis, and at the same time you may be helping them.
Then keep me in mind.

Graham.



Re: lists.perl.org

2003-02-24 Thread Graham Barr
On Mon, Feb 24, 2003 at 08:51:27AM +0100, Philip Newton wrote:
 On 22 Feb 2003 at 21:54, Gabor Szabo wrote:
 
  I have been trying to get a change in one of the listings
  on http://lists.perl.org/ for a couple of month now.
  
  I filled in the New List form and e-mailed the listmaster on
  the feedback link but with no success.
  
  Is there anyone here with good contact to those peole ?
 
 I *think* hfb/aevil/Elaine Ashton is behind lists.perl.org, but I'm not 
 sure. So you could try emailing her. (I don't have an address for her 
 off-hand, so you should be able to find it as well as I can -- try 
 looking for hfb on use.perl.org, for example, or google for her.)

Yes, Elaine is the person running lists.  Elaine has recently moved
from the US to Europe, so I dont know how much time she has had
recently.  If you mail me your changes I can get them added.

Graham.



Re: CPANSTATS

2003-02-06 Thread Graham Barr
On Thu, Feb 06, 2003 at 03:09:46PM +0100, Robin Berjon wrote:
  ps and it would help if search.cpan.org were opensource too
 
 No kidding :)

Just how would that help ?

Graham.




Re: CPANSTATS

2003-02-06 Thread Graham Barr
On Thu, Feb 06, 2003 at 02:46:15PM +, Leon Brocard wrote:
 Graham Barr sent the following bits through the ether:
 
  Just how would that help ?
 
 We'd have been able to fix the site for you. For example, the FAQ is a
 little out of date - linking to
 http://chaos.wustl.edu/analog/cpan_org/search/ (last updated in
 2002-05) isn't terribly useful.

Well you have the source for that. patches welcome.

 The search results are a little iffy sometimes:
 http://search.cpan.org/search?query=imlibmode=all
 doesn't list 'Image::Imlib2'.

Well report it via the feedback.

 And I notice you've been having a load problem recently. Would you
 like some help scaling the site? Would a couple of identical mirrors
 help?

Thats an apache problem. it was recently moved across boxes and now uses
apache2 for a proxy frontend. sadly apache2 does not want to work
as a proxy and a cache so every request hits the backend. But there
will be a mirror in the UK soon

Graham.




Re: Look ma, no barewords!

2002-12-09 Thread Graham Barr
On Sun, Dec 08, 2002 at 11:13:17AM +, Dave Cross wrote:
  It's commonly used to pass named arguments:
  
  set_lang( -name='Perl', -paradigm='hybrid', -motto='TMTOWTDI' );
 
 I thought that was using = quotes its left-hand operand magic
 quoting, not unary - quotes its operand magic quoting :)

IIRC, way back in the early days of perl5 = was just a different
way to write , it did not have auto-quoting properties. The leading
- to the word did though. Although I think that was added after the
original perl5 release. It may have been push for by Nick in the
early days of Tk development.

Graham.




Re: REVIEW: Extending and Embedding Perl

2002-11-28 Thread Graham Barr
On Wed, Nov 27, 2002 at 02:35:20PM +, Nicholas Clark wrote:
 Review of Extending and Embedding Perl
 
 Author:  Tim Jenness and Simon Cozens
 ISBN:  1-930110-82-0
 Publisher:   Manning
 Reviewed by: Nicholas Clark
 
 
 pThis is a long review. I could have said the book is missing things that I
 think should be there and leave it at that. But it's trivial to say, easy to
 dismiss, and impossible to follow. As I'm clear in my head about the specifics
 of what I think is missing but relevant to the book's subject matter, I've
 backed things up every time with examples. This makes a much longer review,
 but hopefully much clearer to follow, and easier to understand why I hold
 my opinions. Maybe it's more of a short article than a review, but it says what
 I feel I need to say./p

Ouch.

OK, I will come clean, I did do an early technical review of some
parts to this book, but I did not see the completed thing or even
if any of my input was taken. Heck I even gave a quote for the cover
as I thought it was a very promising book. Having read this please
tell me its not there as I have never received my free copy.

Graham.




Re: Book: Best of the Perl Journal

2002-11-25 Thread Graham Barr
On Fri, Nov 22, 2002 at 02:10:00PM +, Graham Barr wrote:
 On Thu, Nov 21, 2002 at 11:11:55PM +, David Cantrell wrote:
  On Wed, Nov 20, 2002 at 12:53:55PM +, Graham Barr wrote:
   On Wed, Nov 20, 2002 at 09:27:24AM +, Andy Wardley wrote:
Graham Barr wrote:
 You can either collect it from me, or we could arrage to meet in a
 local(-ish) pub...
This sounds like the perfect opportunity to resurrect Surrey.pm.
How about a meeting in Guildford one night next week or soon thereafter?

Fortunately, I am familiar with several of the local taverns and should
have no trouble recommending one  :-)
   Sounds good to me. David, pick a day thats good for you. I work
   evenings, so whatever day it is means time off from work anyway.
  
  Monday and Friday next week are free for me.
 
 Either is fine with me.  Andy do you want to pick a suitable place.

Well its Monday, so I doubt it will be tonight :)

If nobody seems that interested in a pub meetup on Friday
and suggests/organizes a pub in the next day or so then
I will send you my address.

Graham.




Re: Book: Best of the Perl Journal

2002-11-22 Thread Graham Barr
On Thu, Nov 21, 2002 at 11:11:55PM +, David Cantrell wrote:
 On Wed, Nov 20, 2002 at 12:53:55PM +, Graham Barr wrote:
  On Wed, Nov 20, 2002 at 09:27:24AM +, Andy Wardley wrote:
   Graham Barr wrote:
You can either collect it from me, or we could arrage to meet in a
local(-ish) pub...
   This sounds like the perfect opportunity to resurrect Surrey.pm.
   How about a meeting in Guildford one night next week or soon thereafter?
   
   Fortunately, I am familiar with several of the local taverns and should
   have no trouble recommending one  :-)
  Sounds good to me. David, pick a day thats good for you. I work
  evenings, so whatever day it is means time off from work anyway.
 
 Monday and Friday next week are free for me.

Either is fine with me.  Andy do you want to pick a suitable place.

Graham.




Re: Book: Best of the Perl Journal

2002-11-20 Thread Graham Barr
Sounds good to me. David, pick a day thats good for you. I work
evenings, so whatever day it is means time off from work anyway.

Graham.

On Wed, Nov 20, 2002 at 09:27:24AM +, Andy Wardley wrote:
 Graham Barr wrote:
  You can either collect it from me, or we could arrage to meet in a
  local(-ish) pub. If we do a pub, then some of the lurkers that this
  brought out of the woodwork (like me :) can meet up if they want.
 
 This sounds like the perfect opportunity to resurrect Surrey.pm.
 
 How about a meeting in Guildford one night next week or soon thereafter?
 
  Just dont ask me to suggest a pub :-)
 
 Fortunately, I am familiar with several of the local taverns and should
 have no trouble recommending one  :-)
 
 A
 
 




Thanks (was Re: contracts)

2002-11-20 Thread Graham Barr
Thanks to all those who gave answers, they were certainly helpful.

As I am moving, I will not be planning to do this anytime soon. However maybe
sometime next year. So those that offered direct advice, I may contact you
closer to the time. Doing so now will just be a waste of both our time

Thanks,
Graham.




Book: Best of the Perl Journal

2002-11-19 Thread Graham Barr
As an author I have just been sent two copies of this book by O'Reilly.
I have no use for a second copy, so I thought I would throw it up for grabs.

However, I live in Guildford and dont travel to London, so it would be
easier if it was delivered to someone to the south of London.

Graham.




Re: Book: Best of the Perl Journal

2002-11-19 Thread Graham Barr
I forgot to add, the winner will be picked a random, possibly biased
by how easy it is to get the book to them (this book has 700 pages
so its not light, so if they are close enough I will deliver it)
or how much they bribe me with donations to the Perl Foundation.

Graham.

On Tue, Nov 19, 2002 at 10:49:00AM +, Graham Barr wrote:
 As an author I have just been sent two copies of this book by O'Reilly.
 I have no use for a second copy, so I thought I would throw it up for grabs.
 
 However, I live in Guildford and dont travel to London, so it would be
 easier if it was delivered to someone to the south of London.
 
 Graham.




Re: Book: Best of the Perl Journal

2002-11-19 Thread Graham Barr
On Tue, Nov 19, 2002 at 11:01:45AM -, Gareth Kirwan wrote:
 There's me surprised at Guildford - where do all you lot hide?

Well as I said I am in Guildford, now. But soon I will be moving
to Wisbech in Cambridgeshire.

Graham.





Re: contracts

2002-11-19 Thread Graham Barr
On Tue, Nov 19, 2002 at 07:35:41PM +, Simon Wilcox wrote:
 On Tue, 19 Nov 2002, David Cantrell wrote:
 
  Hey contractory people, I might get some short-term work next week, can
  anyone point me at a sensible standard contract I can use?  Bear in mind
  that I don't give a monkeys about IR35 as I have no intention of being
  an evil tax-evader.
 
 Would this be employed directly or via a ltd company of some description ?

This brings up an interesting question for me.

For a while now I have been doing small jobs on the side, while
being employed. But I have been thinking about leaving my full time
job and doing contracting. Now before you all tell me I am crazy,
I have my reasons for wanting to leave :)

But the question I have is, which is the best route. Is it better
to start a ltd company or just go self employed. I have read a lot
of online info fro various web sites, but none I found give real
pros and cons either way.

Graham.





Re: Technical Reviewer

2002-11-14 Thread Graham Barr
On Thu, Nov 14, 2002 at 09:34:06AM +, Alex McLintock wrote:
 Manning have asked me to be a technical reviewer for one of their (non 
 perl) books.
 
 I have heard that other people on this list have done technical reviewing too.
 
 Is it standard practice that technical reviewers don't get paid? I am happy 
 to do the review anyway because I run DiverseBooks.com but I'd like to know 
 that I am not being taken advantage of.

It varies between publishers. I have done technical reviews for
several.  Some pay cash, some will send you a free copy of the book
and some do both.  IIRC Manning don't pay cash, but do send a copy
of the book.

Graham.




Re: ADSL again

2002-10-18 Thread Graham Barr
On Fri, Oct 18, 2002 at 05:41:25PM +0100, David Cantrell wrote:
 On Fri, Oct 18, 2002 at 03:18:55PM +0100, Ben wrote:
  On Fri, Oct 18, 2002 at 03:09:18PM +0100, Simon Wistow wrote:
   The question is do I go for a wires only option and buy my own ADSL
   modem or do i go for Nildram's managed USB frog at a 25 quid one off
   charge and then 8 quid a month?
  Wires only. I have yet to be convinced that anyone reading this list would be
  better off with a managed router.
 
 I am happy with a managed router.  It means that when it breaks, I phone
 and they fix.  Or they supply a new one.

This is a vary good point. I have a managed router. I also travel a lot
and one time while I was abroad it broke. My wife called them and they came
and fixed it and I was able to get at my machine again. Sometimes the
exta cost is worth it.

Graham.





Re: RE efficiency question.

2002-10-17 Thread Graham Barr
On Thu, Oct 17, 2002 at 09:37:11PM +0100, Shevek wrote:
 On Thu, 17 Oct 2002, Belden Lyman wrote:
  pos($_) = 9;  # skip first 9 chars
  push ext, $1 while /(.{12})/g;

No need for the while.

  pos($_) = 9;  # skip first 9 chars
  push ext, /.{12}/g;

Graham.





Re: applying patterns

2002-10-10 Thread Graham Barr

On Thu, Oct 10, 2002 at 09:04:34AM +0100, Simon Wistow wrote:
 On Wed, Oct 09, 2002 at 05:50:35PM -0400, darren chamberlain said:
  I use the one from lib.pm:
  
nodups = grep { ++$h{$_} == 1 } dups;
 
 using grep is the other idiom/technique/method/pattern/whatever that
 I've seen I just have a sort of irrational fear of grep stemming from
 when I was first learning Perl and someone more experienced than I told
 me that you very rarely ever need to use it and 99% of the time people
 use it incorrectly.

I don't understand how anyone can say that any construct is used
incorrectly if the result is the desired one. It may be that they
is a better/different way to solve the problem, but thats what perl
is all about TMTOWTDI.

Graham.




Re: {OT} elegant MAC address formatting code?

2002-10-07 Thread Graham Barr

On Mon, Oct 07, 2002 at 11:32:55PM +0100, Chris Benson wrote:
 On Mon, Oct 07, 2002 at 10:29:18PM +0100, Chisel Wright wrote:
  On Mon, Oct 07, 2002 at 10:00:24PM +0100, Chris Benson wrote:
   Hi,  within the last few weeks I've seen a nice bit of code to format
   irregular 0:2:7E:4:7:0 style MAC addresses into standard 00027E6437C0
   ones.  
  
  Not worked out a one-liner but:
  
  s/\b(\w):\b/0$1/g;
  s/://g;
  
  perhaps?
 
 What I've done is
   $mac = join '', map { sprintf %02x, hex } split /:/, $mac
   if $mac =~ /:/;
 
 Which is more that I wanted but keeps the magic one-line :-) I thought
 there was a pack() in the version I saw, but I can't work out how.
 The use of hex() (once again) fooled me :-(

You mean something like

perl -le '$_ = 0:2:7E:4:7:0; print unpack H*, pack C*, map hex, /\w\w?/g'
00027e040700
perl -le '$_ = 00027e040700; print unpack H*, pack C*, map hex, /\w\w?/g'
00027e040700

Graham.