Re: Default library paths
Had a brain wave this evening and came up with the following solution. Replace /usr/lib/perl5 with /usr/local/.p5 in the perl binary[1]. Then create a symlink from /usr/local/.p5 to /usr/local/lib/perl5. The .p5 directory doesn't display in /usr/local so everything looks neat and tidy. I am then left with the whole perl installation entirely contained in /usr/local which means I can remove the Compact Flash card (containing perl) without leaving any loose ends lying around in the main filesystem of my iPAQ. The next challenge will be getting gcc onto the iPAQ so that I can then rebuild perl from scratch :) Matt [1] Strangely enough, perl came in pretty handy for this task. -- s!msfQ!s$utvKs(Q)\1!sfiupoBs^reverse Ibdlfses^# s$#!uojsqs(.)chr(ord($1)-1)ges(.*)reverse $1see - Original Message - From: Paul Makepeace [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 11, 2001 9:43 PM Subject: Re: Default library paths On Mon, Jun 11, 2001 at 10:25:32AM +0100, Dominic Mitchell wrote: You're very probably stuck. Whilst you can use a hex editor to change strings in the binary, you can't expand the length of those strings, only contract them or retain the same length. However, a solution would be to change the perl binary to use /opt/lib instead of /usr/lib and make /opt a symlink to /usr/local. There's a couple of reasonable hex editors out there, but I usually just tend to use M-x hexl-find-file in emacs. If you're a vim user, see xxd(1). Presumably if you know the string, and they're all going to be replaced (as sounds like the case) you could use perl -pi -0e 's~/usr/lib/~/opt/lib~g' in whole-file-slurp mode (is that the right switch, -0?). Paul -- Intentions -credibility of -nobility of -humility of
Re: bk strikes again
I have managed to resist the temptation to join previous flame wars with bk but I was feeling weak this time :( Matt -- s!msfQ!s$utvKs(Q)\1!sfiupoBs^reverse Ibdlfses^# s$#!uojsqs(.)chr(ord($1)-1)ges(.*)reverse $1see - Original Message - From: Dave Cross [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 13, 2001 9:53 PM Subject: bk strikes again It's all been pretty civilised over on the Cookwook board recently which has made a nice change. I suspect it might all kick off again tho' when bk sees my response to his contribution to this thread: http://www.cookwood.com/cgi-bin/lcastro/perlbbs.pl?read=5205 Dave... -- Drugs are just bad m'kay
Default library paths
Apologies in advance if I have missed something blindingly obvious :) I need to change the default library paths in a compiled copy of perl. Basically, I want to move /usr/lib/perl5 into /usr/local/lib/perl5. I am unable to recompile perl as it is compiled for arm-linux and I don't have either the cross-compiler or the correct configuration to get perl to build for this architecture. Currently, I am using a soft link from my /usr/lib to /usr/local/lib. However, I would prefer to keep the whole installation on /usr/local as this is mounted from a removable disk and I would prefer not to have dangling links when the device is removed. Any suggestions, or am I stuck with the link in /usr/lib. Matt -- s!msfQ!s$utvKs(Q)\1!sfiupoBs^reverse Ibdlfses^# s$#!uojsqs(.)chr(ord($1)-1)ges(.*)reverse $1see
Re: Default library paths
On Sun, 10 June 2001, Jonathan Stowe wrote: On Sun, 10 Jun 2001, Matthew Robinson wrote: Apologies in advance if I have missed something blindingly obvious :) I need to change the default library paths in a compiled copy of perl. Basically, I want to move /usr/lib/perl5 into /usr/local/lib/perl5. I am unable to recompile perl as it is compiled for arm-linux and I don't have either the cross-compiler or the correct configuration to get perl to build for this architecture. PERL5LIB ? I suppose I could use PERL5LIB but I would still prefer the entirely self contained setup. Also PERL5LIB won't work with taint checking (not that I will be doing much taint checking on my iPAQ). Matt
Re: BUFFY - SPOILERS , DO NOT READ IF YOU HAVE NOT SEEN SKY 1 LAST NIGHT
On Saturday, June 02, 2001 4:45 PM Leo Lapworth wrote: On Sat, Jun 02, 2001 at 08:19:56AM +0100, Dave Cross wrote: On Sat, Jun 02, 2001 at 07:47:00AM +0100, Greg McCarroll ([EMAIL PROTECTED]) wrote: *SPOILER ALERT* *SPOILER ALERT* *SPOILER ALERT* *SPOILER ALERT* *SPOILER ALERT* *SPOILER ALERT* *SPOILER ALERT* *SPOILER ALERT* *SPOILER ALERT* *SPOILER ALERT* *SPOILER ALERT* *SPOILER ALERT* Well what about last night? Buffy no more? Well I'm pretty sure she will be back, my reasoning - they played the normal end of show credits/ theme tune, if they had of killed the character off, there would of been a special ending. Mind you, when I explained this theory to the wife she used the phrase ``clutching at straws'' Well, how about the argument that SMG has singed up for two more series? I've been told (*prays this is not true*) that SMG signed up for two more series but has a clause that if Univeral Pictures produce it she is not oblidged to do them (as apparently she didn't want to work for Universal). So, this could be an ending to make sure she and Univeral have time to work it out... i just hope I have been mis-informed. Dave, U still need last weeks video ? Leo Anthony Head said this morning on Live Kicking[1] that Buffy will definitely be back and that the change of network in the US would not effect the BBC showing new Buffy (everyone involved was trying not to mention the rival Sky). Obviously, this is just his opinion but it adds to the rumour mill. Matt [1] Don't ask me why I was watching Live Kicking as I don't know the answer -- s!msfQ!s$utvKs(Q)\1!sfiupoBs^reverse Ibdlfses^# s$#!uojsqs(.)chr(ord($1)-1)ges(.*)reverse $1see
Re: Email::Valid
From: Dominic Mitchell [EMAIL PROTECTED] Sent: Wednesday, May 30, 2001 4:45 PM On Wed, May 30, 2001 at 11:40:03AM -0400, Andy Williams wrote: All the one's that claimed to be valid from E::V failed chaddr! [EMAIL PROTECTED] had this result from chaddr: user: andyw. is good host: hillway.com is good address `[EMAIL PROTECTED]' is bad: rfc822 failure So I guess [EMAIL PROTECTED] is invalid even though it works wierd! What is valid on the left hand side of an email address is extremely weird anyway. Practically anything is allowed. A pseudo grammar for them is in RFC822. There's also much fun trying to parse them in Friedl's book on regular expressions (the owl book). He ends up with a mammoth 5k regex to parse email addresses... -Dom Having just had a look at E::V it looks like the module is using the 'mammoth 5k regex'. I prefer the regex that is given in CGI Programming with Perl. This regex is designed to accept the more common address formats. RFC822 will allow all of the following (taken from CGI Programming with Perl) and was designed to accept all the addresses in use in 1982: Alfred Neuman Neuman@BBN-TENEXA :sysmail@ Some-Group. Some-Org Muhammed.(I am the greatest) Ali @(the)vegas.WBA I have checked the following code against the original test cases which originally returned as valid and none of the list are considered valid. sub IsValidAddress { my $addr_to_check = shift; $addr_to_check =~ s/((?:[^\\]|\\.)*|[^\t ]*)[ \t]*/$1/g; my $esc= ''; my$space = '\040'; m $ctrl= '\000-\037'; my $dot= '\.'; my $nonASCII = '\x80-\xff'; my $CRlist = '\012\015'; my $letter = 'a-zA-Z'; my $digit = '\d'; my $atom_char = qq{ [^$space\@,;:.\\[\\]$esc$ctrl$nonASCII] }; my $atom= qq{ $atom_char+ }; my $byte= qq{ (?: 1?$digit?$digit | 2[0-4]$digit | 25[0-5]) }; my $qtext = qq{ [^$esc$nonASCII$CRlist] }; my $quoted_pair = qq{ $esc [^$nonASCII] }; my $quoted_str = qq{ (?: $qtext | $quoted_pair )* }; my $word= qq{ (?: $atom | $quoted_str ) }; my $ip_address = qq{ \\[ $byte (?: $dot $byte ){3} \\] }; my $sub_domain = qq{ [$letter$digit] [$letter$digit-]{0,61} [$letter$digit]}; my $top_level = qq{ (?: $atom_char ){2,4} }; my $domain_name = qq{ (?: $sub_domain $dot )+ $top_level }; my $domain = qq{ (?: $domain_name | $ip_address ) }; my $local_part = qq{ $word (?: $dot $word )* }; my $address= qq{ $local_part \@ $domain }; return $addr_to_check =~ /^$address$/ox ? $addr_to_check : ; } Hope this helps, Matt -- s!msfQ!s$utvKs(Q)\1!sfiupoBs^reverse Ibdlfses^# s$#!uojsqs(.)chr(ord($1)-1)ges(.*)reverse $1see
Re: Monitors
From: Robert Thompson [EMAIL PROTECTED] Sent: Friday, May 11, 2001 4:51 PM Subject: RE: Monitors How many things do you have on top of your monitor? Currently none. But at Torrington I had 8 items ( I think ) including marzipan models of Bagpuss (complete with Organ Mouse) and Tux. They have yet to migrate to my job. That's because they were sold off in the Torrington sale of assets. Matt
Re: More revolting natives
On Sun, May 06, 2001 at 08:49:56PM -0500, Mike Jarvis wrote: Saturday, May 05, 2001, 5:33:47 AM, Brad Bowman wrote: BB An Irish friend once had trouble convincing a Mid-Westerner BB that Ireland was a country in Europe not a State near the BB Canadian border. A cow-orker of mine had to be told that Spain was in Europe, not South America. Mmmm, what if these Yanks are masters of windup ... and think *we* don't have a sense of humour? I think you give them too much credit! Matt
Re: Pointless, Badly-Written Module.
At 16:49 20/03/01 +, you wrote: On Tue, Mar 20, 2001 at 04:44:55PM -, Simon Batistoni wrote: MMDDYY is about as backwards and illogical as you can possibly get[0]. Our cousins across the ocean appear to like it for some reason. I suspect this was the motivation for the module. The irony being that our cousins across the pond will always get a beautifully formatted, Y2K bug ridden, date in _GMT_ :) Anyone know how he managed to create a Makefile.pl that won't run on Win32 even though it is a pure perl module. Also the test scripts are good, they go to a lot of trouble to test the module thoroughly. Matt
Re: Pointless, Badly-Written Module.
Hows this for a patch: package Date::MMDDYY; use strict; use vars qw(@ISA @EXPORT); use Carp; use Exporter; @ISA = qw(Exporter); @EXPORT = qw(datecon); sub datecon { croak "Date::MMDDYY has been deprecated in favour of POSIX::strftime"; } 1; Matt At 17:16 20/03/01 +, you wrote: 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: Matt's Scripts
At 10:54 14/03/01 +, you wrote: Mark Fowler [EMAIL PROTECTED] writes: Finding out where perl is Ooh, 'configure.cgi'. If only we could assume that they had a working perl on the box that they were installing from then we could write a cunning installer script which uploaded configure.cgi to the ISP and interrogated it via a LWP::... client to get a bunch of configuration stuff, which could then be used to generate a list of scripts that could run on the user's ISP, and which could then go on and upload the scripts. Could we not produce something like configure.bat which is a hybrid shell script/batch file that starts the configuration process by finding perl and then launches perl to find out installed libraries. Obviously it would produce lots of 'Command not found' messages etc but it could quickly find perl (or not) and then move into a cleaner environment. Matt Ooh... You don't even have to assume working perl on their box. You stick the interrogation stuff on the 'Not Matt's scripts' website. The punter then says "I want to run these scripts on such an ISP". NMS then checks to see if it has information about that ISP cached, and provides the appropriate scripts if so, or a copy of configure.cgi for the punter to upload. Once the punter has done the upload, he sets off an interrogation phase, which works out the capabilities of the particular user's environment and builds an appropriate script set. Hmm... it's just a simple matter of programming... -- Piers
Re: Matt's Scripts
At 16:53 13/03/01 +, you wrote: At 16:39 13/03/2001, you wrote: Dave Cross wrote: Oops. I just did the Random Text one. And, of course, there should be a comment at the top above #!/usr/local/bin/perl to the effect that "you should edit this to point to where Perl [version 5.00x or above] is installed on your machine". Can you put something like that above the shebang line? I thought that #! had to be the first two chars in the file. Could we write some sort of internal installer process so the instruction to the user would be type 'perl rand_text2.pl configure' and the script then rewrites itself. Updating #! lines etc, possibly even asking configuration questions which get written to config files. Matt Dave... -- http://www.dave.org.uk SMS: [EMAIL PROTECTED] plugData Munging with Perl http://www.manning.com/cross//plug
RE: Matt's Scripts
At 16:55 13/03/01 -, you wrote: Could we write some sort of internal installer process so the instruction to the user would be type 'perl rand_text2.pl configure' and the script then rewrites itself. Updating #! lines etc, possibly even asking No, most people using these scripts don't have command line access to the servers that they need to install the scripts on. We'd have to do something like: go to http://www.yoursite.com/cgi-bin/randtext2.pl?mode=configure and then have configure itself online. Good point! The script would already have to have the correct shebang in order for this to work. Also, we can't necessarily assume that the script would have write access to the disk (or itself) when it is run through the web server. Matt
Pony
Although I didn't make it to the pub after Damian's talk I did hear from my sources that someone thought it would be 'useful' to convert Bleach.pm to print pony instead. So here it is Pony.pm, it isn't quite the same as Bleach but it produces a similar result. Enjoy, Matt package Pony; $VERSION = '1.00'; # MSR - 28 Feb 2001 $magic = "pony " x 4; sub pony { local $_ = unpack("b*", pop); s/0/ /g; s/1/pony/g; $magic.$_ } sub depony { local $_ = pop; s/^$magic//; s/pony/1/g; s/ /0/g; pack("b*", $_) } open 0 or die; ($script = join("", 0)) =~ s/^(.*^use\s+Pony\s*;\s*?\n)//sm; $header = $1; do { eval depony($script); exit } if ($script =~ /^$magic/); open(0, "$0") or die; print {0} $header.pony($script);
Re: Heretics' meeting
At 17:44 28/02/01 +, you wrote: * Hamlet D'Arcy ([EMAIL PROTECTED]) wrote: Could you post a bit more about the Heretic's meeting? Perhaps some links. I've never heard of the group. I have no ability to handle dates (ok, we can also include names, phone numbers and addresses (non computer) into this if we want) and hence always have a problem when the meeting occurs on the first of the month - i simply haven't came to terms with the fact that it is a new month yet. hence i proposed that the we'd meet on the 8th when this happens, so my logic was ... if (meeting date = 1st of mth) { meet on 8th } else { meet on 1st thursday of mth } someone simplified this to ... meetings are held on the day after the first wednesday of the month i then partitioned for this change, but dave held valiantly against myself and the other usual suspects (JS,DC,) - i was also at some stage called `the heretic' philip newton even gimped something up about this however i then ``refused'' to recognise the real meetings if they occured on the 1st, even though i may attend them so it was decided whenever the meeting _should_ of been held on the 8th we would have an additional meeting, named ``the heretics meeting'', we had our first last month at the very fine anchor pub last month we had a meal that was ok, but a bit pricey, however in the anchor we found a nice open fire that was roaring away hapilly and coupled with some really quite good beer we sat by the fire talking and joking as usual a good time was had by all by the fire, and so heretics meetings from now on are going to be the same sort of cozy fireside chats there will only be another 2 this year - this year has been a very heretical year (3 meetings!) ok, that makes everything crystal Sorry, still don't get it! Can I have it as a perl script? are you sorry you asked? Greg
RE: Heretics' meeting
At 17:23 28/02/01 -, you wrote: Sorry, still don't get it! Can I have it as a perl script? err... #!/usr/local/bin/perl # find heretics meetings my @ary = localtime(); print "meeting today!" if ($ary[6] ==4 $ary[3] 1 $ary[3] 9); Possibly OK, its 'meetings are held on the day after the first wednesday of the month'. That makes perfect sense now, Matt
Re: Last Night
At 05:29 27/02/01 -0500, you wrote: At Tue, 27 Feb 2001 10:13:30 +, Matthew Robinson [EMAIL PROTECTED] wrote: At 04:38 27/02/01 -0500, you wrote: Oh, and I've had a quick look at Bleach.pm and Morse.pm and wish to raise a bug against Morse.pm. It doesn't actually convert stuff to Morse Code, just to something that _looks_ like Morse Code. Another bug, when a script gets bleached anything preceding the use Bleach gets lost. #!/usr/bin/perl use Bleach; becomes use Bleach; This is probably not a good thing. I wonder if this has anything to do with MacPerl not needing the shebang line? I came to the same conclusion about MacPerl. It was a simple fix. Dave...
Re: Last Night
At 06:10 27/02/01 -0500, you wrote: At Tue, 27 Feb 2001 10:58:55 +, Matthew Robinson [EMAIL PROTECTED] wrote: At 05:29 27/02/01 -0500, you wrote: At Tue, 27 Feb 2001 10:13:30 +, Matthew Robinson [EMAIL PROTECTED] wrote: At 04:38 27/02/01 -0500, you wrote: Oh, and I've had a quick look at Bleach.pm and Morse.pm and wish to raise a bug against Morse.pm. It doesn't actually convert stuff to Morse Code, just to something that _looks_ like Morse Code. Another bug, when a script gets bleached anything preceding the use Bleach gets lost. #!/usr/bin/perl use Bleach; becomes use Bleach; This is probably not a good thing. I wonder if this has anything to do with MacPerl not needing the shebang line? I came to the same conclusion about MacPerl. It was a simple fix. You will, of course, be submitting the patch to the author (who lurks on this list and will be expecting it :) Dave... It has already gone... Matt
Re: Do what I mean!
At 12:42 27/02/01 +, you wrote: Matthew Robinson wrote: With respect to Quantum::Superpositions and in the spirit of 'Do what I mean' I think we should be able to write any script and place the following pragma in the header. use constant time; Obviously, the constant module would have to be overloaded to allow this along with a few tweaks to the core. need to understand this to make use of it. So maybe it would just be a matter of trying (eg: observing) it and seeing if it works? Well, I did, and I got this error: % perl -e 'use constant time;' Can't define "983277222" as constant (name contains invalid characters or is empty) at -e line 1 BEGIN failed--compilation aborted at -e line 1. I concluded that while it must work in some universe, it isn't ours. I did say we would have to overload the constant pragma first. Matt
Re: Technical Meeting 22nd Feb
[ Editors note I have changed the attachment its contents can be found at http://www.gellyfi.sh/stuff/torridirections.pdf /J\ ] Here you go, directions to Torrington. The address is: Torrington Interactive 2 Printing House Yard London E2 7PR Printing House Yard is on the junction of Old Street, Shoreditch High St, Hackney Road and Kingsland Road. We are about 10-15 minutes walk from Old St and Liverpool St tubes. I have attached the official 'Directions to Torrington' PDF file. However, after 6:30 pm the gate on Hackney Road is closed and the only entrance is through the back gates which are on Waterson St (the first road on the left as you walk up Hackney Rd). Matt At 10:56 12/02/01 -0500, you wrote: At Mon, 12 Feb 2001 15:49:04 +, Matthew Robinson [EMAIL PROTECTED] wrote: How many people can we get in the room at Torrington? I guess we'll be expecting ~30. Maybe a bit more. 30 people should be no problem, over 40 and it will probably start getting a little personal. That sounds OK. I suspect that unfortunately the attendance at this meeting will be adversely affected by Damian being in town only a few days later. And will there be net connectivity in the room? We can probably get by without, but it would be nice to have. We have a 2meg line and we can make sure that there are a few ports patched through from the boardroom. We are also running DHCP so people can get an IP if required. Excellent. Let's call that a plan then. Can you post directions to Torrington, and then I'll post an official announcement. Cheers, Dave... I Have removed the PDF map attachment and placed it at: http://www.gellyfi.sh/stuff/torridirections.pdf Because it was bounced by majordomo :) /J\
Re: Technical Meeting 22nd Feb
At 10:31 12/02/01 -0500, you wrote: At Mon, 12 Feb 2001 15:25:34 +, Matthew Robinson [EMAIL PROTECTED] wrote: What kit are we going to need for this? (projector, etc.). I assume we'll need the usual. Projecter, Screen (or white wall!), net connectivity. Can someone at Torrington please confirm which of that list they can supply. Thanks. Sorry, been busy all morning. We can supply either a screen or a white wall, not sure which yet but we will supply one or the other. So if somebody else can supply the projector that would be good. Thanks Matt. I guess we'll impose on Neil for his projector again, if that's ok :) How many people can we get in the room at Torrington? I guess we'll be expecting ~30. Maybe a bit more. 30 people should be no problem, over 40 and it will probably start getting a little personal. And will there be net connectivity in the room? We can probably get by without, but it would be nice to have. We have a 2meg line and we can make sure that there are a few ports patched through from the boardroom. We are also running DHCP so people can get an IP if required. Matt