From pak@ast.cam.ac.uk Tue Jul 03 12:58:37 2001 Received: from lilac.csi.cam.ac.uk ([131.111.8.44.5886] ident=exim) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15HOpB-000E1v-00 for cam.pm@cam.pm.org; Tue, 03 Jul 2001 12:58:37 +0100 Received: from cass41.ast.cam.ac.uk ([131.111.69.186]) by lilac.csi.cam.ac.uk with esmtp (Exim 3.22 #1) id 15HOpB-0001fV-00 for cam.pm@cam.pm.org; Tue, 03 Jul 2001 12:58:37 +0100 Received: from cass26.ast.cam.ac.uk (cass26 [131.111.69.103]) by cass41.ast.cam.ac.uk (8.9.3+Sun/8.9.3) with ESMTP id MAA26059 for ; Tue, 3 Jul 2001 12:58:36 +0100 (BST) Received: (from pak@localhost) by cass26.ast.cam.ac.uk (8.10.2+Sun/8.10.2) id f63BwZ027355 for cam.pm@cam.pm.org; Tue, 3 Jul 2001 12:58:35 +0100 (BST) Date: Tue, 3 Jul 2001 12:58:35 +0100 From: Philip Kendall To: cam.pm@cam.pm.org Subject: Re: Simon Cozens' Perl6 emulator Message-ID: <20010703125835.H26835@ast.cam.ac.uk> Mail-Followup-To: cam.pm@cam.pm.org References: <20010626101249.B77818@colon.colondot.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010626101249.B77818@colon.colondot.net>; from cam-pm@lists.colondot.net on Tue, Jun 26, 2001 at 10:12:49AM +0100 Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Tue, Jun 26, 2001 at 10:12:49AM +0100, Matthew Byng-Maddick wrote: > I don't know how many people have played with this, but it's available from: > [simon wrote in perl6-internals] > > http://simon-cozens.org/hacks/perl6.tar.gz > >and run Configure in the usual way - then "make miniperl". OK, finally got it working (at least with the version from 30 June); if it helps anyone else, I had to create an `ext' subdirectory under the main build directory to get things to work. Let's see if I've grokked these correctly: > | #!miniperl > | s;;\n.rekcaH lreP rehtonA tsuJ;;sub > | f{print chop;return *f}f().().().() > | .().().().().().().().().().().().( > | ).().().().().().().().().().() Just the same as Perl 5, apart from s/->/./g; > | #!miniperl > | print "hello" ~ ", " ~ "world.\n"; Pretty trivial :-) > | #!miniperl > | @a=(1,2,3,4,5,6,7,8); print @a[0] ~ "\n"; As Perl 5, apart from array elements are now accessed with @, rather than $ (what's being done about array slices? I'm sure I've seen something on this somewhere...) > | #!miniperl > | @a=(1,2,3,4,5,6,7,8); $a=@a; print $a[0] ~ "\n"; `$a = @a' makes the scalar $a be a reference to the array @a, and $a[0] then automatically dereferences that and takes the 0th element? When are references automatically made and dereferenced? Phil -- Philip Kendall http://www.srcf.ucam.org/~pak21/ From cam-pm@lists.colondot.net Tue Jul 03 13:12:37 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15HP2j-000E3g-00 for cam.pm@cam.pm.org; Tue, 03 Jul 2001 13:12:37 +0100 Date: Tue, 3 Jul 2001 13:12:37 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: Simon Cozens' Perl6 emulator Message-ID: <20010703131237.J46120@colon.colondot.net> References: <20010626101249.B77818@colon.colondot.net> <20010703125835.H26835@ast.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010703125835.H26835@ast.cam.ac.uk>; from pak21-campm@srcf.ucam.org on Tue, Jul 03, 2001 at 12:58:35PM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Tue, Jul 03, 2001 at 12:58:35PM +0100, Philip Kendall wrote: > On Tue, Jun 26, 2001 at 10:12:49AM +0100, Matthew Byng-Maddick wrote: > > I don't know how many people have played with this, but it's available from: > > [simon wrote in perl6-internals] > > > http://simon-cozens.org/hacks/perl6.tar.gz > > >and run Configure in the usual way - then "make miniperl". > OK, finally got it working (at least with the version from 30 June); if > it helps anyone else, I had to create an `ext' subdirectory under the > main build directory to get things to work. ah, I haven't tried that version yet, it includes a new strict.pm, I think. > Let's see if I've grokked these correctly: > > > | #!miniperl > > | s;;\n.rekcaH lreP rehtonA tsuJ;;sub > > | f{print chop;return *f}f().().().() > > | .().().().().().().().().().().().( > > | ).().().().().().().().().().() > Just the same as Perl 5, apart from s/->/./g; Indeed, the '.' as a dereference operator. > > | #!miniperl > > | print "hello" ~ ", " ~ "world.\n"; > Pretty trivial :-) Absolutely > > | #!miniperl > > | @a=(1,2,3,4,5,6,7,8); print @a[0] ~ "\n"; > As Perl 5, apart from array elements are now accessed with @, rather > than $ (what's being done about array slices? I'm sure I've seen > something on this somewhere...) In Perl6 AIUI, any operation on an array will use the '@' tag. so I can get @b=@a[1..3]; should give me @b=(2,3,4); as well as the example above. > > | #!miniperl > > | @a=(1,2,3,4,5,6,7,8); $a=@a; print $a[0] ~ "\n"; > `$a = @a' makes the scalar $a be a reference to the array @a, and $a[0] > then automatically dereferences that and takes the 0th element? Indeed. > When are references automatically made and dereferenced? When you said they are. The $a[0] syntax is unambiguous, because we know that (ref($a) eq "ARRAY") will be true. Because we are *unambiguously* (now) talking about the *::a{"SCALAR"}, then we can trivially see it is a reference and can (automagically) dereference it to give the result. MBM -- Matthew Byng-Maddick http://colondot.net/ From tim.cutts@incyte.com Tue Jul 03 14:44:35 2001 Received: from master.incyte.com ([198.31.37.253.4165] helo=dipsy.eu.incyte.com) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15HQTi-000EDp-00 for cam.pm@cam.pm.org; Tue, 03 Jul 2001 14:44:35 +0100 Received: from localhost ([127.0.0.1] helo=trill.eu.incyte.com) by dipsy.eu.incyte.com with esmtp (Exim 2.12 #3) id 15HQTe-0000sv-00 for cam.pm@cam.pm.org; Tue, 3 Jul 2001 14:44:30 +0100 Received: from timc by trill.eu.incyte.com with local (Exim 3.22 #1) id 15HQTe-0006VN-00 for cam.pm@cam.pm.org; Tue, 03 Jul 2001 14:44:30 +0100 Date: Tue, 3 Jul 2001 14:44:30 +0100 From: Tim Cutts To: cam.pm@cam.pm.org Subject: Re: Personal perl irritations (Re: Web application survey) Message-ID: <20010703144430.F24635@trill.eu.incyte.com> Mail-Followup-To: Tim Cutts , cam.pm@cam.pm.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010702205830.C40400@colon.colondot.net> User-Agent: Mutt/1.3.18i Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Mon, Jul 02, 2001 at 08:58:30PM +0100, Matthew Byng-Maddick wrote: > > Seconded that these are horrific. However, > use English; > helps... It only makes them more readable. They're still an abomination. $/ and $$ are about the only ones I ever use, although I have had occasion to use $, and $>, as in snippets like the following: ($user, undef, $uid, undef) = getpwuid($>); unless (scalar(grep(/$user/,@Gap4::Cfg::rebuild_users)) > 0) { die "You do not have permission to run this program - Contact Tim.\n"; } Oops. I've just spotted a bug in that. The regexp should be /^$user$/. > > > Ok, so how do I get a global variable when I need one then? > > Just give its complete name including namespace, so: > > %main::somehash = (); > > or the shorthand > %::somehash, which then looks a bit neater. If you say so. :-) > I thought that $_ was supposed to be a package global, but a bit of > experimentation shows that this isn't actually the case. :-( $_ has all sorts of horrible magic associated with it though, doesn't it? Things like foreach automatically localize it, for example. I'm not surprised if it behaves oddly in other contexts as well. It's another thing I avoid using apart from in very small inner loops, where it's obvious what sort of thing $_ is. Tim. -- Tim Cutts PhD Tel: +44 1223 454918 Senior Bioinformatics Scientist Incyte Genomics Botanic House, 100 Hills Road, Cambridge, CB2 1FF, UK From cam-pm@lists.colondot.net Tue Jul 03 16:17:52 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15HRw0-000ERc-00 for cam.pm@cam.pm.org; Tue, 03 Jul 2001 16:17:52 +0100 Date: Tue, 3 Jul 2001 16:17:52 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: Personal perl irritations (Re: Web application survey) Message-ID: <20010703161752.W46120@colon.colondot.net> References: <20010702205830.C40400@colon.colondot.net> <20010703144430.F24635@trill.eu.incyte.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010703144430.F24635@trill.eu.incyte.com>; from tim.cutts@incyte.com on Tue, Jul 03, 2001 at 02:44:30PM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Tue, Jul 03, 2001 at 02:44:30PM +0100, Tim Cutts wrote: > On Mon, Jul 02, 2001 at 08:58:30PM +0100, Matthew Byng-Maddick wrote: > > Seconded that these are horrific. However, > > use English; > > helps... > It only makes them more readable. They're still an abomination. $/ and > $$ are about the only ones I ever use, although I have had occasion to use $, $$ is useful. $/ is very useful if you're playing with record-like files. I occasionally use $., which is the current record number. $> and $< are also useful, as they allow you to do the userid operations. I occasionally use $_ too, $0, occasionally, and often $!.[1] > and $>, as in snippets like the following: > ($user, undef, $uid, undef) = getpwuid($>); > > unless (scalar(grep(/$user/,@Gap4::Cfg::rebuild_users)) > 0) { > die "You do not have permission to run this program - Contact Tim.\n"; > } > Oops. I've just spotted a bug in that. The regexp should be /^$user$/. erm. /^\Q$user\E$/, I think. > > > > Ok, so how do I get a global variable when I need one then? > > > Just give its complete name including namespace, so: > > > %main::somehash = (); > > or the shorthand > > %::somehash, which then looks a bit neater. > If you say so. :-) I think so, if you're talking about globals... > > I thought that $_ was supposed to be a package global, but a bit of > > experimentation shows that this isn't actually the case. :-( > $_ has all sorts of horrible magic associated with it though, doesn't it? No. Builtin functions will often try to use $_ if they can't find other arguments. There's no real magic associated with it. There's also no "magic" in the perl sense, either, IIRC. > Things like foreach automatically localize it, for example. I'm not That's not magic. That's using local. > surprised if it behaves oddly in other contexts as well. It's another > thing I avoid using apart from in very small inner loops, where it's > obvious what sort of thing $_ is. using it with map is probably my main use. MBM [1] for those who don't know and can't be bothered to look it up: $$ - process id $/ - record separator, useful with operators $. - current record number $> - effective uid $) - effective gid $< - real uid $( - real gid $_ - erm. well, too many meanings $0 - the argv[0] of this script $! - errno or strerror(errno) -- Matthew Byng-Maddick http://colondot.net/ From tim.cutts@incyte.com Wed Jul 04 10:00:26 2001 Received: from master.incyte.com ([198.31.37.253.22879] helo=dipsy.eu.incyte.com) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15HiWH-000G80-00 for cam.pm@cam.pm.org; Wed, 04 Jul 2001 10:00:26 +0100 Received: from localhost ([127.0.0.1] helo=trill.eu.incyte.com) by dipsy.eu.incyte.com with esmtp (Exim 2.12 #3) id 15HiWE-00022j-00 for cam.pm@cam.pm.org; Wed, 4 Jul 2001 10:00:22 +0100 Received: from timc by trill.eu.incyte.com with local (Exim 3.22 #1) id 15HiWE-0000A5-00 for cam.pm@cam.pm.org; Wed, 04 Jul 2001 10:00:22 +0100 Date: Wed, 4 Jul 2001 10:00:22 +0100 From: Tim Cutts To: cam.pm@cam.pm.org Subject: Re: Personal perl irritations (Re: Web application survey) Message-ID: <20010704100022.B490@trill.eu.incyte.com> Mail-Followup-To: Tim Cutts , cam.pm@cam.pm.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010703161752.W46120@colon.colondot.net> User-Agent: Mutt/1.3.18i Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Tue, Jul 03, 2001 at 04:17:52PM +0100, Matthew Byng-Maddick wrote: > $$ is useful. $/ is very useful if you're playing with record-like files. Which I do. A lot. FASTA format nucleic sequence database? local $/ = "\n>"; SWISSPROT-style protein databases? local $/ = "\n//\n"; > I occasionally use $., which is the current record number. $> and $< are > also useful, as they allow you to do the userid operations. I occasionally > use $_ too, $0, occasionally, and often $!.[1] Indeed. $fh->open(" > and $>, as in snippets like the following: > > ($user, undef, $uid, undef) = getpwuid($>); > > > > unless (scalar(grep(/$user/,@Gap4::Cfg::rebuild_users)) > 0) { > > die "You do not have permission to run this program - Contact Tim.\n"; > > } > > Oops. I've just spotted a bug in that. The regexp should be /^$user$/. > > erm. /^\Q$user\E$/, I think. Oh, I see. Is that to stop the $ in $user being interpreted in the usual regexp way? None of our users have perl metacharacters in their user IDs, but I suppose it doesn't hurt to be safe. > > Things like foreach automatically localize it, for example. I'm not > > That's not magic. That's using local. Yes, but it's using local without your explicitly asking for it. I call that magic. > using it with map is probably my main use. I only just started using map. Can't imagine why I overlooked it before - stunningly useful! > [1] for those who don't know and can't be bothered to look it up: > $$ - process id > $/ - record separator, useful with operators $, - output record separator. Useful for creating tab-delimited files and the like from array references without cluttering your code with 'join'. > $. - current record number > $> - effective uid > $) - effective gid > $< - real uid > $( - real gid > $_ - erm. well, too many meanings > $0 - the argv[0] of this script > $! - errno or strerror(errno) -- Tim Cutts PhD Tel: +44 1223 454918 Senior Bioinformatics Scientist Incyte Genomics Botanic House, 100 Hills Road, Cambridge, CB2 1FF, UK From cam-pm@lists.colondot.net Wed Jul 04 10:37:55 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15Hj6Z-000GC1-00 for cam.pm@cam.pm.org; Wed, 04 Jul 2001 10:37:55 +0100 Date: Wed, 4 Jul 2001 10:37:55 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: Personal perl irritations (Re: Web application survey) Message-ID: <20010704103755.B61867@colon.colondot.net> References: <20010703161752.W46120@colon.colondot.net> <20010704100022.B490@trill.eu.incyte.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010704100022.B490@trill.eu.incyte.com>; from tim.cutts@incyte.com on Wed, Jul 04, 2001 at 10:00:22AM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Wed, Jul 04, 2001 at 10:00:22AM +0100, Tim Cutts wrote: > On Tue, Jul 03, 2001 at 04:17:52PM +0100, Matthew Byng-Maddick wrote: > > $$ is useful. $/ is very useful if you're playing with record-like files. > Which I do. A lot. FASTA format nucleic sequence database? > local $/ = "\n>"; > SWISSPROT-style protein databases? > local $/ = "\n//\n"; erm. Ok. Whatever. :-) > > I occasionally use $., which is the current record number. $> and $< are > > also useful, as they allow you to do the userid operations. I occasionally > > use $_ too, $0, occasionally, and often $!.[1] > Indeed. > $fh->open(" > > and $>, as in snippets like the following: > > > ($user, undef, $uid, undef) = getpwuid($>); > > > unless (scalar(grep(/$user/,@Gap4::Cfg::rebuild_users)) > 0) { > > > die "You do not have permission to run this program - Contact Tim.\n"; > > > } > > > Oops. I've just spotted a bug in that. The regexp should be /^$user$/. > > erm. /^\Q$user\E$/, I think. > Oh, I see. Is that to stop the $ in $user being interpreted in the > usual regexp way? None of our users have perl metacharacters in their Yes. > user IDs, but I suppose it doesn't hurt to be safe. Defensive programming. :-) > > > Things like foreach automatically localize it, for example. I'm not > > That's not magic. That's using local. > Yes, but it's using local without your explicitly asking for it. I call > that magic. Erm. sort of. > > using it with map is probably my main use. > I only just started using map. Can't imagine why I overlooked it before > - stunningly useful! Indeed. :-) I often use it for dereferencing things: $foo= [ { bar => "d", baz => "f" }, { bar => "a", baz => "b" }, { bar => "z", baz => "x" } ]; @z = map { $_->{"bar"} } @$foo; > $, - output record separator. Useful for creating tab-delimited > files and the like from array references without cluttering > your code with 'join'. Ah, I've never been very fond of this one, I'd prefer my own output to be explicitly what I ask for, but then TMTOWTDI. :-) MBM -- Matthew Byng-Maddick http://colondot.net/ From tim.cutts@incyte.com Wed Jul 04 16:14:52 2001 Received: from master.incyte.com ([198.31.37.253.42343] helo=dipsy.eu.incyte.com) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15HoMd-000PfW-00 for cam.pm@cam.pm.org; Wed, 04 Jul 2001 16:14:52 +0100 Received: from localhost ([127.0.0.1] helo=trill.eu.incyte.com) by dipsy.eu.incyte.com with esmtp (Exim 2.12 #3) id 15HoMU-0002mH-00 for cam.pm@cam.pm.org; Wed, 4 Jul 2001 16:14:42 +0100 Received: from timc by trill.eu.incyte.com with local (Exim 3.22 #1) id 15HoMU-0000Os-00 for cam.pm@cam.pm.org; Wed, 04 Jul 2001 16:14:42 +0100 Date: Wed, 4 Jul 2001 16:14:42 +0100 From: Tim Cutts To: cam.pm@cam.pm.org Subject: map Message-ID: <20010704161442.A1520@trill.eu.incyte.com> Mail-Followup-To: Tim Cutts , cam.pm@cam.pm.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010704103755.B61867@colon.colondot.net> User-Agent: Mutt/1.3.18i Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: Thinking about map has just enabled me to write an absolute gem. A routine to translate DNA sequence into its protein equivalent using three lines of code and one lookup table: my %convert = ( "AAA", "K", "AAC", "N", "AAG", "K", "AAT", "N", "ACA", "T", "ACC", "T", "ACG", "T", "ACT", "T", "AGA", "R", "AGC", "S", "AGG", "R", "AGT", "S", "ATA", "I", "ATC", "I", "ATG", "M", "ATT", "I", "CAA", "Q", "CAC", "H", "CAG", "Q", "CAT", "H", "CCA", "P", "CCC", "P", "CCG", "P", "CCT", "P", "CGA", "R", "CGC", "R", "CGG", "R", "CGT", "R", "CTA", "L", "CTC", "L", "CTG", "L", "CTT", "L", "GAA", "E", "GAC", "D", "GAG", "E", "GAT", "D", "GCA", "A", "GCC", "A", "GCG", "A", "GCT", "A", "GGA", "G", "GGC", "G", "GGG", "G", "GGT", "G", "GTA", "V", "GTC", "V", "GTG", "V", "GTT", "V", "TAA", "*", "TAC", "Y", "TAG", "*", "TAT", "Y", "TCA", "S", "TCC", "S", "TCG", "S", "TCT", "S", "TGA", "*", "TGC", "C", "TGG", "W", "TGT", "C", "TTA", "L", "TTC", "F", "TTG", "L", "TTT", "F" ) ; sub translate { my $seq = uc(shift); my @codons = $seq =~ /\G.../g; join('', map { $convert{$_} || 'X' } @codons); } I'm quite pleased with that. :-) There are probably faster but more long-winded methods though. I have C code to do the same thing which is a couple of hundred lines long (although it does use various tricks to translate all six reading frames simultaneously - the above routine only translates the first forward frame). Ooh, I can go home a happy man today. Tim. On Wed, Jul 04, 2001 at 10:37:55AM +0100, Matthew Byng-Maddick wrote: [map] > I often use it for dereferencing things: > > $foo= [ > { > bar => "d", > baz => "f" > }, > { > bar => "a", > baz => "b" > }, > { > bar => "z", > baz => "x" > } > ]; > @z = map { $_->{"bar"} } @$foo; -- Tim Cutts PhD Tel: +44 1223 454918 Senior Bioinformatics Scientist Incyte Genomics Botanic House, 100 Hills Road, Cambridge, CB2 1FF, UK From lejm3@hermes.cam.ac.uk Wed Jul 04 16:28:45 2001 Received: from orange.csi.cam.ac.uk ([131.111.8.77.35544] ident=exim) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15Hoa5-000Pi0-00 for cam.pm@cam.pm.org; Wed, 04 Jul 2001 16:28:45 +0100 Received: from lejm3 (helo=localhost) by orange.csi.cam.ac.uk with local-esmtp (Exim 3.22 #1) id 15Hoa5-0006Ng-00 for cam.pm@cam.pm.org; Wed, 04 Jul 2001 16:28:45 +0100 Date: Wed, 4 Jul 2001 16:28:45 +0100 (BST) From: Lucy McWilliam X-X-Sender: To: Subject: Re: map In-Reply-To: <20010704161442.A1520@trill.eu.incyte.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Wed, 4 Jul 2001, Tim Cutts wrote: > Thinking about map has just enabled me to write an absolute gem. A > routine to translate DNA sequence into its protein equivalent using > three lines of code and one lookup table: Ooh, I might have to borrow that. What flavour bioinformatician are you anyway? --------------------------------------------------------------------- Lucy McWilliam Email: lejm3@cam.ac.uk Flychip Tel: +44 (0)1223 765927 Department of Genetics Fax: +44 (0)1223 333992 University of Cambridge Mobile: 07939 476024 CB2 3EH WWW: www.bio.cam.ac.uk/~lejm3 From cam-pm@lists.colondot.net Wed Jul 04 17:01:30 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15Hp5m-000PnA-00 for cam.pm@cam.pm.org; Wed, 04 Jul 2001 17:01:30 +0100 Date: Wed, 4 Jul 2001 17:01:30 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: map Message-ID: <20010704170130.N61867@colon.colondot.net> References: <20010704103755.B61867@colon.colondot.net> <20010704161442.A1520@trill.eu.incyte.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010704161442.A1520@trill.eu.incyte.com>; from tim.cutts@incyte.com on Wed, Jul 04, 2001 at 04:14:42PM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Wed, Jul 04, 2001 at 04:14:42PM +0100, Tim Cutts wrote: > Thinking about map has just enabled me to write an absolute gem. A > routine to translate DNA sequence into its protein equivalent using > three lines of code and one lookup table: > > my %convert = ( "AAA", "K", "AAC", "N", "AAG", "K", "AAT", "N", [...] > "TTA", "L", "TTC", "F", "TTG", "L", "TTT", "F" ) ; Firstly, as a style thing (especially for hashes), can I recommend '=>' as a synonym for ',' ('=>' also has the nice side effect of quoting the word to its left) ie my %convert = ( AAA => "K", AAC => "N", AAG => "K", AAT => "N" ... > sub translate { > my $seq = uc(shift); > my @codons = $seq =~ /\G.../g; That's an interesting way of writing that, I'd have probably done my @codons = split /(...)/, $seq; or my @codons=(); push(@codons, substr($seq,0,3)), $seq=substr($seq,3) while length $seq; Not sure, though... > join('', map { $convert{$_} || 'X' } @codons); > } That's pretty neat. > I'm quite pleased with that. :-) There are probably faster but more > long-winded methods though. Not sure. That's going to be pretty fast with the hash lookup. > I have C code to do the same thing which is a couple of hundred lines > long (although it does use various tricks to translate all six reading > frames simultaneously - the above routine only translates the first > forward frame). OK. This bit is a bit beyond me... Although, I can imagine with the memory allocation etc, the C would have to be bigger. > Ooh, I can go home a happy man today. Cool. :-) MBM -- Matthew Byng-Maddick http://colondot.net/ From mk270@cam.ac.uk Thu Jul 05 10:33:22 2001 Received: from pc2-camb6-0-cust74.cam.cable.ntl.com ([213.107.107.74.49671] helo=oh.no.ucant.org) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15I5Vi-0001fe-00 for cam.pm@cam.pm.org; Thu, 05 Jul 2001 10:33:22 +0100 Received: from mk270 (helo=localhost) by oh.no.ucant.org with local-smtp (Exim 3.20 #5) id 15I5Vh-0005cL-00 for cam.pm@cam.pm.org; Thu, 05 Jul 2001 10:33:21 +0100 Date: Thu, 5 Jul 2001 10:33:21 +0100 (BST) From: Martin Keegan X-Sender: mk270@oh.no.ucant.org To: cam.pm@cam.pm.org Subject: SQL and CGI Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: Hello Happy Cam.pers! A lot of the perlish stuff I do involves web-based access to SQL databases. I use the CGI and DBI modules, and am pretty happy with them. There are four things that I am missing: a wrapper function which sprintfs correctly $dbh->quoted() arguments into a query string wrapper functions for sql queries which return single values, etc a 2 dimensional SQL result -> 2 dimensional HTML table + style system a SQL table schema -> CGI form system I plead ignorance. Does any of these things actually exist? Mk From S.R.E.Turner@statslab.cam.ac.uk Thu Jul 05 10:51:00 2001 Received: from palace.statslab.cam.ac.uk ([131.111.20.12.25875] ident=mail) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15I5mm-0001hy-00 for cam.pm@cam.pm.org; Thu, 05 Jul 2001 10:51:00 +0100 Received: from gamma.statslab.cam.ac.uk ([131.111.20.18]) by palace.statslab.cam.ac.uk with smtp (Exim 3.12 #1 (Debian)) id 15I5ml-0003ED-00 for ; Thu, 05 Jul 2001 10:50:59 +0100 Date: Thu, 5 Jul 2001 10:50:59 +0100 (BST) From: Stephen Turner To: cam.pm@cam.pm.org Subject: Re: map In-Reply-To: <20010704161442.A1520@trill.eu.incyte.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org X-Reply-To: Stephen Turner List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Wed, 4 Jul 2001, Tim Cutts wrote: > > I have C code to do the same thing which is a couple of hundred lines > long While I of course agree that Perl is the only choice for your task, I think that you're being a _bit_ unfair on C. Here's a first pass: typedef struct { char *from; char to; } Table; Table convert[] = {{"AAA", 'K'}, {"AAC", 'N'}, {"AAG", 'K'}, {"AAT", 'N'}, {"ACA", 'T'}, {"ACC", 'T'}, {"ACG", 'T'}, {"ACT", 'T'}, {"AGA", 'R'}, {"AGC", 'S'}, {"AGG", 'R'}, {"AGT", 'S'}, {"ATA", 'I'}, {"ATC", 'I'}, {"ATG", 'M'}, {"ATT", 'I'}, {"CAA", 'Q'}, {"CAC", 'H'}, {"CAG", 'Q'}, {"CAT", 'H'}, {"CCA", 'P'}, {"CCC", 'P'}, {"CCG", 'P'}, {"CCT", 'P'}, {"CGA", 'R'}, {"CGC", 'R'}, {"CGG", 'R'}, {"CGT", 'R'}, {"CTA", 'L'}, {"CTC", 'L'}, {"CTG", 'L'}, {"CTT", 'L'}, {"GAA", 'E'}, {"GAC", 'D'}, {"GAG", 'E'}, {"GAT", 'D'}, {"GCA", 'A'}, {"GCC", 'A'}, {"GCG", 'A'}, {"GCT", 'A'}, {"GGA", 'G'}, {"GGC", 'G'}, {"GGG", 'G'}, {"GGT", 'G'}, {"GTA", 'V'}, {"GTC", 'V'}, {"GTG", 'V'}, {"GTT", 'V'}, {"TAA", '*'}, {"TAC", 'Y'}, {"TAG", '*'}, {"TAT", 'Y'}, {"TCA", 'S'}, {"TCC", 'S'}, {"TCG", 'S'}, {"TCT", 'S'}, {"TGA", '*'}, {"TGC", 'C'}, {"TGG", 'W'}, {"TGT", 'C'}, {"TTA", 'L'}, {"TTC", 'F'}, {"TTG", 'L'}, {"TTT", 'F'}, {"XXX", 'X'}}; char *translate(char *from) { char *c, *ans = (char *)calloc(1, strlen(from) / 3 + 1); int i, j, done; for (c = from, j = 0; *c && *(c + 1) && *(c + 2); c += 3) { for (i = 0, done = 0; !done; i++) { if ((*c == convert[i].from[0] && *(c + 1) == convert[i].from[1] && *(c + 2) == convert[i].from[2]) || convert[i].from[0] == 'X') { ans[j++] = convert[i].to; done = 1; } } } return(ans); } -- Stephen Turner http://www.statslab.cam.ac.uk/~sret1/ Statistical Laboratory, Wilberforce Road, Cambridge, CB3 0WB, England "This is Henman's 8th Wimbledon, and he's only lost 7 matches." BBC, 2/Jul/01 From cam-pm@lists.colondot.net Thu Jul 05 11:03:34 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15I5yw-0001k1-00 for cam.pm@cam.pm.org; Thu, 05 Jul 2001 11:03:34 +0100 Date: Thu, 5 Jul 2001 11:03:34 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: SQL and CGI Message-ID: <20010705110334.B5861@colon.colondot.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mk270@cam.ac.uk on Thu, Jul 05, 2001 at 10:33:21AM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Thu, Jul 05, 2001 at 10:33:21AM +0100, Martin Keegan wrote: > Hello Happy Cam.pers! eek!!! :-) > A lot of the perlish stuff I do involves web-based access to SQL > databases. I use the CGI and DBI modules, and am pretty happy with them. > There are four things that I am missing: > a wrapper function which sprintfs correctly $dbh->quoted() arguments > into a query string I'm not sure I understand what you mean here... Why would you want to do this? > wrapper functions for sql queries which return single values, etc eg: sub get_single { my $dbh=shift; my $sql=shift; my $sth=$dbh->prepare($sql); if($sth->execute(@_) && $sth->rows()) { my($ret)=$sth->fetchrow_array(); $sth->finish(); return $ret; } $sth->finish(); return undef; } > a 2 dimensional SQL result -> 2 dimensional HTML table + style system this is similar to the below... > a SQL table schema -> CGI form system My last boss attempted to do this. It was ugly and crap. > I plead ignorance. Does any of these things actually exist? Well, some are trivial to write yourself, others I have yet to find an implementation of that I like, and that works in every situation (by which I mean that I have some way of tweaking it if it doesn't work). MBM -- Matthew Byng-Maddick http://colondot.net/ From mk270@cam.ac.uk Thu Jul 05 11:28:43 2001 Received: from pc2-camb6-0-cust74.cam.cable.ntl.com ([213.107.107.74.51975] helo=oh.no.ucant.org) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15I6NH-0001na-00 for cam.pm@cam.pm.org; Thu, 05 Jul 2001 11:28:43 +0100 Received: from mk270 (helo=localhost) by oh.no.ucant.org with local-smtp (Exim 3.20 #5) id 15I6NG-0005dV-00 for cam.pm@cam.pm.org; Thu, 05 Jul 2001 11:28:42 +0100 Date: Thu, 5 Jul 2001 11:28:42 +0100 (BST) From: Martin Keegan X-Sender: mk270@oh.no.ucant.org To: cam.pm@cam.pm.org Subject: Re: SQL and CGI In-Reply-To: <20010705110334.B5861@colon.colondot.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Thu, 5 Jul 2001, Matthew Byng-Maddick wrote: > > A lot of the perlish stuff I do involves web-based access to SQL > > databases. I use the CGI and DBI modules, and am pretty happy with them. > > There are four things that I am missing: > > a wrapper function which sprintfs correctly $dbh->quoted() arguments > > into a query string > > I'm not sure I understand what you mean here... Why would you want to do > this? To avoid the $sql_statement = sprintf( "INSERT INTO users VALUES (%s, %s, %s, %S)", $dbh->quote( $a ), $dbh->quote( $b ), $dbh->quote( $c ), $dbh->quote( $d ) ); Even with map { $dbh->quote( $_ ) } ( $a, $b, $c, $d ) it's still klunky. > > wrapper functions for sql queries which return single values, etc > > eg: > > sub get_single { > my $dbh=shift; > my $sql=shift; > > my $sth=$dbh->prepare($sql); > if($sth->execute(@_) && $sth->rows()) { > my($ret)=$sth->fetchrow_array(); > $sth->finish(); > return $ret; > } > $sth->finish(); > return undef; > } Yes, precisely. > > a 2 dimensional SQL result -> 2 dimensional HTML table + style system > > this is similar to the below... > > > a SQL table schema -> CGI form system > > My last boss attempted to do this. It was ugly and crap. Well, there's a demand for a good one. > > I plead ignorance. Does any of these things actually exist? > > Well, some are trivial to write yourself, others I have yet to find an > implementation of that I like, and that works in every situation (by which > I mean that I have some way of tweaking it if it doesn't work). All of these things are pretty easy to write; the issue for me is that I don't to cut and paste the code from project to project, I want it in a proper perl module written by someone who understands writing perl modules which I can apt-get or download from CPAN, and I want it out there so that there's just one fewer hurdle to getting things done for people trying to write the sorts of applications which require this functionality. I guess I should probably start writing my own perl module then. Mk From cam-pm@lists.colondot.net Thu Jul 05 11:56:16 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15I6nw-0001rC-00 for cam.pm@cam.pm.org; Thu, 05 Jul 2001 11:56:16 +0100 Date: Thu, 5 Jul 2001 11:56:16 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: SQL and CGI Message-ID: <20010705115616.C5861@colon.colondot.net> References: <20010705110334.B5861@colon.colondot.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mk270@cam.ac.uk on Thu, Jul 05, 2001 at 11:28:42AM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Thu, Jul 05, 2001 at 11:28:42AM +0100, Martin Keegan wrote: > On Thu, 5 Jul 2001, Matthew Byng-Maddick wrote: > > > A lot of the perlish stuff I do involves web-based access to SQL > > > databases. I use the CGI and DBI modules, and am pretty happy with them. > > > There are four things that I am missing: > > > a wrapper function which sprintfs correctly $dbh->quoted() arguments > > > into a query string > > > > I'm not sure I understand what you mean here... Why would you want to do > > this? > To avoid the > $sql_statement = sprintf( "INSERT INTO users VALUES (%s, %s, %s, %S)", > $dbh->quote( $a ), > $dbh->quote( $b ), > $dbh->quote( $c ), > $dbh->quote( $d ) ); > Even with map { $dbh->quote( $_ ) } ( $a, $b, $c, $d ) it's still klunky. sorry, namespace overload: by query string, I thought you meant scalar($r->args) or $ENV{"QUERY_STRING"} (depending on your orientation). how about: | $sql="INSERT INTO users VALUES (?,?,?,?)"; | my $sth=$dbh->prepare($sql); | | $sth->execute($a,$b,$c,$d); ?? which is a standard in the DBI implementation, and is sometimes well implemented in databases which do query cacheing (eg Oracle, Informix) > > > wrapper functions for sql queries which return single values, etc > > eg: > > sub get_single { > > my $dbh=shift; > > my $sql=shift; > > > > my $sth=$dbh->prepare($sql); > > if($sth->execute(@_) && $sth->rows()) { > > my($ret)=$sth->fetchrow_array(); > > $sth->finish(); > > return $ret; > > } > > $sth->finish(); > > return undef; > > } > Yes, precisely. Personally, I'd write a library of your own to do this, I know this sounds like reinventing the wheel, but the different exceptions that can be raised etc, make this a problem where everybody's idea of a good solution will be different. In my example above, you can't tell the difference between no row, and an invalid sql query, so a different implementation, which should be run in eval{} is. sub get_single { my $dbh=shift; my $sql=shift; my $sth=$dbh->prepare($sql); if(!$sth) { die "Couldn't prepare \`$sql'\n"; } if($sth->execute(@_)) { if($sth->rows) { my($ret)=$sth->fetchrow_array(); $sth->finish(); return $ret; } die "No rows returned\n"; } $sth->finish(); die "Query \`$sql' failed\n"; } This gives you better exception handling. You may want this, you may not. after all, you could then write a wrapper that does: sub get_single_wrapper { my $ret; if(eval {$ret=get_single(@_);1;}) { return $ret; } else { mail_admin("SQL query failed: $_[1] from ".caller(), $@); return undef; } } or you may want it to completely change the template, (eg, in development, come up with an "it failed here" kind of template, which then prints the text of the die...) > > > a 2 dimensional SQL result -> 2 dimensional HTML table + style system > > this is similar to the below... > > > a SQL table schema -> CGI form system > > My last boss attempted to do this. It was ugly and crap. > Well, there's a demand for a good one. Oh, definitely, there just doesn't seem to be any nice way of doing it, I've seen some attempts with php etc, but certainly if you have a database that doesn't enforce referential integrity(, then you deserve to lose anyway, but) then you have other problems here. > > > I plead ignorance. Does any of these things actually exist? > > Well, some are trivial to write yourself, others I have yet to find an > > implementation of that I like, and that works in every situation (by which > > I mean that I have some way of tweaking it if it doesn't work). > All of these things are pretty easy to write; the issue for me is that I > don't to cut and paste the code from project to project, I want it in a > proper perl module written by someone who understands writing perl modules > which I can apt-get or download from CPAN, and I want it out there so that > there's just one fewer hurdle to getting things done for people trying to > write the sorts of applications which require this functionality. :-) > I guess I should probably start writing my own perl module then. Very much so. :-) Bear in mind that designing good interfaces is decidedly non-trivial. Spend some time first thinking about the limitations of the way that you've chosen to do things, and see if there's any way to make sure it can handle 100% of cases, even if some of them take a bit more work... MBM -- Matthew Byng-Maddick http://colondot.net/ From mk270@cam.ac.uk Thu Jul 05 13:15:07 2001 Received: from pc2-camb6-0-cust74.cam.cable.ntl.com ([213.107.107.74.57351] helo=oh.no.ucant.org) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15I82E-00020u-00 for cam.pm@cam.pm.org; Thu, 05 Jul 2001 13:15:06 +0100 Received: from mk270 (helo=localhost) by oh.no.ucant.org with local-smtp (Exim 3.20 #5) id 15I82E-0005fu-00 for cam.pm@cam.pm.org; Thu, 05 Jul 2001 13:15:06 +0100 Date: Thu, 5 Jul 2001 13:15:06 +0100 (BST) From: Martin Keegan X-Sender: mk270@oh.no.ucant.org To: cam.pm@cam.pm.org Subject: Re: SQL and CGI In-Reply-To: <20010705115616.C5861@colon.colondot.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Thu, 5 Jul 2001, Matthew Byng-Maddick wrote: > sorry, namespace overload: by query string, I thought you meant > scalar($r->args) or $ENV{"QUERY_STRING"} (depending on your orientation). Yeah, sorry. > | $sql="INSERT INTO users VALUES (?,?,?,?)"; > | my $sth=$dbh->prepare($sql); > | > | $sth->execute($a,$b,$c,$d); > > ?? which is a standard in the DBI implementation, and is sometimes well > implemented in databases which do query cacheing (eg Oracle, Informix) What if I want "INSERT INTO users (username, password, snood, offog) VALUES (%s, %s, %s, %s)"? > Oh, definitely, there just doesn't seem to be any nice way of doing it, I've > seen some attempts with php etc, but certainly if you have a database that > doesn't enforce referential integrity(, then you deserve to lose anyway, but) > then you have other problems here. What is referential integrity (I Am Not A Compsci) and how is it relevant here? > Bear in mind that designing good interfaces is decidedly non-trivial. Spend Strangely, I am already aware of that. > some time first thinking about the limitations of the way that you've chosen > to do things, and see if there's any way to make sure it can handle 100% of > cases, even if some of them take a bit more work... Not following from your points above: is there a HelloWorld.pm? Mk From cam-pm@lists.colondot.net Thu Jul 05 13:46:12 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15I8WK-00025g-00 for cam.pm@cam.pm.org; Thu, 05 Jul 2001 13:46:12 +0100 Date: Thu, 5 Jul 2001 13:46:12 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: SQL and CGI Message-ID: <20010705134612.A7873@colon.colondot.net> References: <20010705115616.C5861@colon.colondot.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mk270@cam.ac.uk on Thu, Jul 05, 2001 at 01:15:06PM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Thu, Jul 05, 2001 at 01:15:06PM +0100, Martin Keegan wrote: >On Thu, 5 Jul 2001, Matthew Byng-Maddick wrote: >>sorry, namespace overload: by query string, I thought you meant >>scalar($r->args) or $ENV{"QUERY_STRING"} (depending on your orientation). >Yeah, sorry. :-) np >>| $sql="INSERT INTO users VALUES (?,?,?,?)"; >>| my $sth=$dbh->prepare($sql); >>| >>| $sth->execute($a,$b,$c,$d); >>?? which is a standard in the DBI implementation, and is sometimes well >>implemented in databases which do query cacheing (eg Oracle, Informix) >What if I want >"INSERT INTO users (username, password, snood, offog) VALUES (%s, %s, %s, >%s)"? "INSERT INTO users (username, password, snood, offog) VALUES (?,?,?,?)" and the same thing. >>Oh, definitely, there just doesn't seem to be any nice way of doing it, I've >>seen some attempts with php etc, but certainly if you have a database that >>doesn't enforce referential integrity(, then you deserve to lose anyway, but) >>then you have other problems here. >What is referential integrity (I Am Not A Compsci) and how is it relevant >here? see also foreign keys. Where you want to make sure that an id (which should be a key in another table) actually exists in the other table. And that if you delete the entry, then everything that refers to it is also deleted, or that the operation is blocked until nothing refers to it. >>Bear in mind that designing good interfaces is decidedly non-trivial. Spend >Strangely, I am already aware of that. :-) >>some time first thinking about the limitations of the way that you've chosen >>to do things, and see if there's any way to make sure it can handle 100% of >>cases, even if some of them take a bit more work... >Not following from your points above: is there a HelloWorld.pm? Not that I am aware of, but have a look at a few, also try running h2xs as: h2xs -X -n Your::Module MBM -- Matthew Byng-Maddick http://colondot.net/ From tim.cutts@incyte.com Thu Jul 05 16:01:10 2001 Received: from master.incyte.com ([198.31.37.253.57556] helo=dipsy.eu.incyte.com) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15IAcw-0002OE-00 for cam.pm@cam.pm.org; Thu, 05 Jul 2001 16:01:10 +0100 Received: from localhost ([127.0.0.1] helo=trill.eu.incyte.com) by dipsy.eu.incyte.com with esmtp (Exim 2.12 #3) id 15IAcM-0004Qv-00; Thu, 5 Jul 2001 16:00:34 +0100 Received: from timc by trill.eu.incyte.com with local (Exim 3.22 #1) id 15IAcL-0001Fd-00; Thu, 05 Jul 2001 16:00:33 +0100 Date: Thu, 5 Jul 2001 16:00:33 +0100 From: Tim Cutts To: Stephen Turner Cc: cam.pm@cam.pm.org Subject: Re: map Message-ID: <20010705160033.A4786@trill.eu.incyte.com> Mail-Followup-To: Tim Cutts , Stephen Turner , cam.pm@cam.pm.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.18i Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Thu, Jul 05, 2001 at 10:50:59AM +0100, Stephen Turner wrote: > On Wed, 4 Jul 2001, Tim Cutts wrote: > > > > I have C code to do the same thing which is a couple of hundred lines > > long > > While I of course agree that Perl is the only choice for your task, I think > that you're being a _bit_ unfair on C. Here's a first pass: Yes, indeed, it's possible to write a fairly short C version like that, but it's quite slow owing to a large amount of conditional code. It also only translates one reading frame. The long code I was talking about translates all six reading frames in a single pass. It's pretty ugly, but those who are interested will find it in the file translate.c in my tpatterns program, which you can download from: http://www.cyclin.demon.co.uk/software/tpatterns It includes such lovely bits of code as: for (n = 0; n<64; n++) { r = (~((n & 0x0C) | ((n & 0x03) << 4) | ((n >> 4) & 0x03))) & 0x3F; ((char *)dest)[r] = ((char*)source)[n]; } You'll have to look at the original if you want to know what that's for. The original is commented. :-) Some of the loops are unrolled, too, which makes it longer. Tim. -- Tim Cutts PhD Tel: +44 1223 454918 Senior Bioinformatics Scientist Incyte Genomics Botanic House, 100 Hills Road, Cambridge, CB2 1FF, UK From lejm3@hermes.cam.ac.uk Sun Jul 08 00:14:36 2001 Received: from green.csi.cam.ac.uk ([131.111.8.57.26529] ident=exim) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15J1HY-0007nI-00 for cam.pm@cam.pm.org; Sun, 08 Jul 2001 00:14:36 +0100 Received: from lejm3 (helo=localhost) by green.csi.cam.ac.uk with local-esmtp (Exim 3.22 #1) id 15J1HY-00017z-00 for cam.pm@cam.pm.org; Sun, 08 Jul 2001 00:14:36 +0100 Date: Sun, 8 Jul 2001 00:14:35 +0100 (BST) From: Lucy McWilliam X-X-Sender: To: Subject: Not entirely off topic... Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: Beer Festival, Sunday (err...later today), Cambridge Corn Exchange. www.camra.org.uk/cambridge L. From mjg17@eng.cam.ac.uk Mon Jul 09 09:58:46 2001 Received: from spanner.eng.cam.ac.uk ([129.169.8.9.6159] ident=[root]) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15JWsQ-000Abu-00 for cam.pm@cam.pm.org; Mon, 09 Jul 2001 09:58:46 +0100 Received: from cramp.eng.cam.ac.uk (via root@cramp.eng.cam.ac.uk [129.169.9.4]) by spanner.eng.cam.ac.uk with ESMTP id JAA14877 for ; Mon, 9 Jul 2001 09:58:43 +0100 (BST) Received: from heimdal.eng.cam.ac.uk (via IDENT:mjg17@heimdal.eng.cam.ac.uk [129.169.9.46]) by cramp.eng.cam.ac.uk with ESMTP id JAA18728 for ; Mon, 9 Jul 2001 09:58:40 +0100 (BST) Date: Mon, 9 Jul 2001 09:58:39 +0100 (BST) From: Michael Gray To: Subject: Re: SQL and CGI In-Reply-To: <20010705134612.A7873@colon.colondot.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Thu, 5 Jul 2001, Matthew Byng-Maddick wrote: > On Thu, Jul 05, 2001 at 01:15:06PM +0100, Martin Keegan wrote: > > > >Not following from your points above: is there a HelloWorld.pm? > > Not that I am aware of, but have a look at a few, also try running h2xs > as: > > h2xs -X -n Your::Module From my boomarks: http://www.urth.org/~autarch/perl_modules.html http://world.std.com/~swmcd/steven/perl/module_mechanics.html http://www.mathforum.com/~ken/perl_modules.html HTH -- Michael From pak21@srcf.ucam.org Mon Jul 09 12:49:09 2001 Received: from lilac.csi.cam.ac.uk ([131.111.8.44.38879] ident=exim) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15JZXE-000BZw-00 for cam.pm@cam.pm.org; Mon, 09 Jul 2001 12:49:04 +0100 Received: from student.cusu.cam.ac.uk ([131.111.179.82] helo=kern.srcf.societies.cam.ac.uk ident=mail) by lilac.csi.cam.ac.uk with esmtp (Exim 3.22 #1) id 15JZXD-0002gf-00 for cam.pm@cam.pm.org; Mon, 09 Jul 2001 12:49:03 +0100 Received: from pak21 by kern.srcf.societies.cam.ac.uk with local (Exim 3.12 #1 (Debian)) id 15JZXD-00056U-00 for ; Mon, 09 Jul 2001 12:49:03 +0100 Date: Mon, 9 Jul 2001 12:49:03 +0100 From: Philip Kendall To: Cambridge Perl Mongers Subject: Unexpected warning? Message-ID: <20010709124903.A19326@srcf.ucam.org> Mail-Followup-To: Cambridge Perl Mongers Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: I'm probably missing something here, but why does the following: --- cut here --- #!/usr/local/bin/perl use warnings; use strict; use Data::Dumper; use IO::File; my @array = ( "foo", "bar" ); my $fh = new IO::File( "> /dev/stdout" ) or die "Couldn't open: $!"; print $fh Data::Dumper->Dump( \@array ); $fh->close or die "Couldn't close: $!"; --- cut here --- give me: Bareword found where operator expected at ./bar.pl line 13, near "$fh Data::Dumper" (Missing operator before Data::Dumper?) Cheers, Phil -- Philip Kendall http://www.srcf.ucam.org/~pak21/ From mk270@cam.ac.uk Mon Jul 09 13:03:56 2001 Received: from pc2-camb6-0-cust74.cam.cable.ntl.com ([213.107.107.74.16910] helo=oh.no.ucant.org) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15JZlc-000Bbv-00 for cam.pm@cam.pm.org; Mon, 09 Jul 2001 13:03:56 +0100 Received: from mk270 (helo=localhost) by oh.no.ucant.org with local-smtp (Exim 3.20 #5) id 15JZla-00052G-00 for cam.pm@cam.pm.org; Mon, 09 Jul 2001 13:03:54 +0100 Date: Mon, 9 Jul 2001 13:03:54 +0100 (BST) From: Martin Keegan X-Sender: mk270@oh.no.ucant.org To: Cambridge Perl Mongers Subject: Re: Unexpected warning? In-Reply-To: <20010709124903.A19326@srcf.ucam.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Mon, 9 Jul 2001, Philip Kendall wrote: > print $fh Data::Dumper->Dump( \@array ); should be print $fh ( Data::Dumper->Dump( \@array ) ); It's to do with the weird printing to filehandles "no comma" syntax perl has, I believe. Note that it's not print( $fh foo ) or print( $fh, foo ). Mk From pak21@srcf.ucam.org Mon Jul 09 15:30:29 2001 Received: from mauve.csi.cam.ac.uk ([131.111.8.38.33426] ident=exim) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15Jc3R-000CCv-00 for cam.pm@cam.pm.org; Mon, 09 Jul 2001 15:30:29 +0100 Received: from student.cusu.cam.ac.uk ([131.111.179.82] helo=kern.srcf.societies.cam.ac.uk ident=mail) by mauve.csi.cam.ac.uk with esmtp (Exim 3.22 #1) id 15Jc3R-0004y7-00 for cam.pm@cam.pm.org; Mon, 09 Jul 2001 15:30:29 +0100 Received: from pak21 by kern.srcf.societies.cam.ac.uk with local (Exim 3.12 #1 (Debian)) id 15Jc3Q-0000Rp-00 for ; Mon, 09 Jul 2001 15:30:28 +0100 Date: Mon, 9 Jul 2001 15:30:28 +0100 From: Philip Kendall To: Cambridge Perl Mongers Subject: Re: Unexpected warning? Message-ID: <20010709153028.A722@srcf.ucam.org> Mail-Followup-To: Cambridge Perl Mongers References: <20010709124903.A19326@srcf.ucam.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mk270@cam.ac.uk on Mon, Jul 09, 2001 at 01:03:54PM +0100 Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Mon, Jul 09, 2001 at 01:03:54PM +0100, Martin Keegan wrote: > On Mon, 9 Jul 2001, Philip Kendall wrote: > > > print $fh Data::Dumper->Dump( \@array ); > > should be > > print $fh ( Data::Dumper->Dump( \@array ) ); So why doesn't print $fh Dumper( \@array ); give a warning? I'm just confused as to why sometimes I get the warning (try something like print $fh ::function_in_package_main; ) and sometimes I don't... Phil -- Philip Kendall http://www.srcf.ucam.org/~pak21/ From lejm3@hermes.cam.ac.uk Fri Jul 13 10:56:24 2001 Received: from red.csi.cam.ac.uk ([131.111.8.70.57220] ident=exim) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15KzgO-0004A0-00 for cam.pm@cam.pm.org; Fri, 13 Jul 2001 10:56:24 +0100 Received: from lejm3 (helo=localhost) by red.csi.cam.ac.uk with local-esmtp (Exim 3.22 #1) id 15KzgN-0006YN-00 for cam.pm@cam.pm.org; Fri, 13 Jul 2001 10:56:23 +0100 Date: Fri, 13 Jul 2001 10:56:23 +0100 (BST) From: Lucy McWilliam X-X-Sender: To: Subject: Perl Runs Wsedish Pension System Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: Hi peeps. I've been busy and you've all gone quiet. To keep it vaguely on topic, this is rather amusing - can anyone say CAPSA? http://perl.oreilly.com/news/swedishpension_0601.html L. Queen Victoria: "I am not a moose." From mk270@cam.ac.uk Mon Jul 16 16:17:33 2001 Received: from pc2-camb6-0-cust74.cam.cable.ntl.com ([213.107.107.74.28435] helo=oh.no.ucant.org) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15MA7p-0007V5-00 for cam.pm@cam.pm.org; Mon, 16 Jul 2001 16:17:33 +0100 Received: from mk270 (helo=localhost) by oh.no.ucant.org with local-smtp (Exim 3.20 #5) id 15MA7o-00040i-00 for cam.pm@cam.pm.org; Mon, 16 Jul 2001 16:17:32 +0100 Date: Mon, 16 Jul 2001 16:17:32 +0100 (BST) From: Martin Keegan X-Sender: mk270@oh.no.ucant.org To: cam.pm@cam.pm.org Subject: perl6 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: Some of the list members seem to be familiar with the planned direction of perl6... can anyone tell me whether it will have anything like C's structs? Mk From S.R.E.Turner@statslab.cam.ac.uk Mon Jul 16 16:20:25 2001 Received: from palace.statslab.cam.ac.uk ([131.111.20.12.38405] ident=mail) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15MAAb-0007Vn-00 for cam.pm@cam.pm.org; Mon, 16 Jul 2001 16:20:25 +0100 Received: from gamma.statslab.cam.ac.uk ([131.111.20.18]) by palace.statslab.cam.ac.uk with smtp (Exim 3.12 #1 (Debian)) id 15MAAa-0007jJ-00 for ; Mon, 16 Jul 2001 16:20:24 +0100 Date: Mon, 16 Jul 2001 16:20:24 +0100 (BST) From: Stephen Turner To: cam.pm@cam.pm.org Subject: Re: perl6 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org X-Reply-To: Stephen Turner List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Mon, 16 Jul 2001, Martin Keegan wrote: > > Some of the list members seem to be familiar with the planned direction of > perl6... can anyone tell me whether it will have anything like C's > structs? > Why do you need structs when you've got objects? All I know about Perl 6 is in Larry's "Apocalypses" at http://www.perl.com/pub/au/Wall_Larry Does anyone know any more? -- Stephen Turner http://www.statslab.cam.ac.uk/~sret1/ Statistical Laboratory, Wilberforce Road, Cambridge, CB3 0WB, England "This is Henman's 8th Wimbledon, and he's only lost 7 matches." BBC, 2/Jul/01 From pak21@srcf.ucam.org Mon Jul 16 16:30:28 2001 Received: from mauve.csi.cam.ac.uk ([131.111.8.38.12937] ident=exim) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15MAKK-0007XI-00 for cam.pm@cam.pm.org; Mon, 16 Jul 2001 16:30:28 +0100 Received: from student.cusu.cam.ac.uk ([131.111.179.82] helo=kern.srcf.societies.cam.ac.uk ident=mail) by mauve.csi.cam.ac.uk with esmtp (Exim 3.22 #1) id 15MAKJ-0002rB-00 for cam.pm@cam.pm.org; Mon, 16 Jul 2001 16:30:27 +0100 Received: from pak21 by kern.srcf.societies.cam.ac.uk with local (Exim 3.12 #1 (Debian)) id 15MAKJ-0001bs-00 for ; Mon, 16 Jul 2001 16:30:27 +0100 Date: Mon, 16 Jul 2001 16:30:27 +0100 From: Philip Kendall To: cam.pm@cam.pm.org Subject: Re: perl6 Message-ID: <20010716163027.A4890@srcf.ucam.org> Mail-Followup-To: cam.pm@cam.pm.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from S.R.E.Turner@statslab.cam.ac.uk on Mon, Jul 16, 2001 at 04:20:24PM +0100 Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Mon, Jul 16, 2001 at 04:20:24PM +0100, Stephen Turner wrote: > On Mon, 16 Jul 2001, Martin Keegan wrote: > > > > > Some of the list members seem to be familiar with the planned direction of > > perl6... can anyone tell me whether it will have anything like C's > > structs? I assume Class::Struct will get ported at some stage (not that I've ever used it). > Why do you need structs when you've got objects? Compile-time checking that you're accessing valid property names, rather than run time? > All I know about Perl 6 is in Larry's "Apocalypses" at > http://www.perl.com/pub/au/Wall_Larry > Does anyone know any more? As Lucy pointed out when I asked this question, there's also Damien Conway's Exegesis 2 (there is no Exegesis 1): http://www.perl.com/pub/a/2001/05/08/exegesis2.html and his talk to YAPC::NA: http://www.yetanother.org/damian/talks/Perl6.pdf Phil -- Philip Kendall http://www.srcf.ucam.org/~pak21/ From lejm3@hermes.cam.ac.uk Mon Jul 16 17:35:57 2001 Received: from orange.csi.cam.ac.uk ([131.111.8.77.13536] ident=exim) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15MBLh-0007e2-00 for cam.pm@cam.pm.org; Mon, 16 Jul 2001 17:35:57 +0100 Received: from lejm3 (helo=localhost) by orange.csi.cam.ac.uk with local-esmtp (Exim 3.22 #1) id 15MBLh-0003LE-00 for cam.pm@cam.pm.org; Mon, 16 Jul 2001 17:35:57 +0100 Date: Mon, 16 Jul 2001 17:35:57 +0100 (BST) From: Lucy McWilliam X-X-Sender: To: Subject: Re: perl6 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Mon, 16 Jul 2001, Martin Keegan wrote: > Some of the list members seem to be familiar with the planned direction of > perl6... can anyone tell me whether it will have anything like C's > structs? Have a look at dev.perl.org. I think RFC 122 is what you're after. BTW, anyone up for putting some theory into practice[1] and have a meet up? L. Thank $deity for mooses. [1] I study yeast. And I drink beer. From mk270@cam.ac.uk Mon Jul 16 17:48:40 2001 Received: from pc2-camb6-0-cust74.cam.cable.ntl.com ([213.107.107.74.32531] helo=oh.no.ucant.org) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15MBY0-0007fg-00 for cam.pm@cam.pm.org; Mon, 16 Jul 2001 17:48:40 +0100 Received: from mk270 (helo=localhost) by oh.no.ucant.org with local-smtp (Exim 3.20 #5) id 15MBXz-000433-00 for cam.pm@cam.pm.org; Mon, 16 Jul 2001 17:48:39 +0100 Date: Mon, 16 Jul 2001 17:48:39 +0100 (BST) From: Martin Keegan X-Sender: mk270@oh.no.ucant.org To: cam.pm@cam.pm.org Subject: Re: perl6 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Mon, 16 Jul 2001, Lucy McWilliam wrote: > > Some of the list members seem to be familiar with the planned direction of > > perl6... can anyone tell me whether it will have anything like C's > > structs? > > Have a look at dev.perl.org. I think RFC 122 is what you're after. BTW, > anyone up for putting some theory into practice[1] and have a meet up? As an amateur historian of internet-mediated social groupings and environments, I'd of course object :) But then you mention beer. Mk From mk270@cam.ac.uk Mon Jul 16 17:50:12 2001 Received: from pc2-camb6-0-cust74.cam.cable.ntl.com ([213.107.107.74.33299] helo=oh.no.ucant.org) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15MBZT-0007gO-00 for cam.pm@cam.pm.org; Mon, 16 Jul 2001 17:50:12 +0100 Received: from mk270 (helo=localhost) by oh.no.ucant.org with local-smtp (Exim 3.20 #5) id 15MBZT-00043D-00 for cam.pm@cam.pm.org; Mon, 16 Jul 2001 17:50:11 +0100 Date: Mon, 16 Jul 2001 17:50:11 +0100 (BST) From: Martin Keegan X-Sender: mk270@oh.no.ucant.org To: cam.pm@cam.pm.org Subject: Re: perl6 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Mon, 16 Jul 2001, Stephen Turner wrote: > > Some of the list members seem to be familiar with the planned direction of > > perl6... can anyone tell me whether it will have anything like C's > > structs? > > > > Why do you need structs when you've got objects? Unless I'm very much mistaken, the way to get objects in perl is to bless a reference to a hash and have that hash's keys "do the Right Thing" when used as accessor/member functions, and I'd prefer it if the whole notion were just built into the syntax. Mk From cam-pm@lists.colondot.net Mon Jul 16 20:25:47 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15ME03-0007uj-00 for cam.pm@cam.pm.org; Mon, 16 Jul 2001 20:25:47 +0100 Date: Mon, 16 Jul 2001 20:25:47 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: perl6 Message-ID: <20010716202547.A30231@colon.colondot.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mk270@cam.ac.uk on Mon, Jul 16, 2001 at 05:50:11PM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Mon, Jul 16, 2001 at 05:50:11PM +0100, Martin Keegan wrote: > On Mon, 16 Jul 2001, Stephen Turner wrote: > > > Some of the list members seem to be familiar with the planned direction of > > > perl6... can anyone tell me whether it will have anything like C's > > > structs? > > Why do you need structs when you've got objects? > Unless I'm very much mistaken, the way to get objects in perl is to bless > a reference to a hash and have that hash's keys "do the Right Thing" when you can bless() any reference. I'm not sure that I follow what you mean here. The OO idea is that the object methods act on *this object*. So bless() and the -> syntax is all you need for OO programming. Of course, "real" OO languages provide ways to keep some of the internals of an object class private (and this is actually possible in Perl, though slightly horrid syntactically[1]), and Perl doesn't make this easy. However, there's no reason that you need to bless a hashref, it just happens to be easiest to do it that way. > used as accessor/member functions, and I'd prefer it if the whole notion > were just built into the syntax. I'm not sure I follow what you mean here. The -> syntax is part of Perl. bless($ref, $package) basically says: if I use $ref in a syntax with $ref->function(@args) then execute &{$package."::function"}($ref,@args) [1] From Damian Conway's Object Oriented Programming in Perl book: (disclaimer: I don't have a copy to hand, and I actually prefer not to use private-alikes, so I may have got this wrong...) | package Foo::Bar; | | sub new { | my $pack=shift; | return bless {@_}, $pack; | } | | { | sub method1 { | my $self=shift; | # some method here... | } | | sub method2 { | my $self=shift; | # a different object method here... | } | } the idea being that the method1 and method2 don't appear directly in the symbol table.... MBM -- Matthew Byng-Maddick http://colondot.net/ From cam-pm@lists.colondot.net Tue Jul 17 08:03:35 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15MOtL-00093M-00 for cam.pm@cam.pm.org; Tue, 17 Jul 2001 08:03:35 +0100 Date: Tue, 17 Jul 2001 08:03:35 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: perl6 Message-ID: <20010717080335.A34738@colon.colondot.net> References: <20010716202547.A30231@colon.colondot.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010716202547.A30231@colon.colondot.net>; from cam-pm@lists.colondot.net on Mon, Jul 16, 2001 at 08:25:47PM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Mon, Jul 16, 2001 at 08:25:47PM +0100, Matthew Byng-Maddick wrote: > [1] From Damian Conway's Object Oriented Programming in Perl book: > (disclaimer: I don't have a copy to hand, and I actually prefer not to > use private-alikes, so I may have got this wrong...) OK, I did get it wrong. Although I think there may be some horriblenesses with this. > | package Foo::Bar; > | > | sub new { > | my $pack=shift; > | return bless {@_}, $pack; > | } > | > | { | | # what in fact should happen here: | | my $private_class_global1=$val1; | my $private_class_global2=$val2; | my $private_class_global3=$val3; | | # which then go out of scope at the end of the bracing, but | # which are available to method1 and method2 below. I think | # one might even put new() within the bracing too. | | # I think using this method, method1() and method2() become | # a kind of closure, but it's too early in the morning. | > | sub method1 { > | my $self=shift; > | # some method here... > | } > | > | sub method2 { > | my $self=shift; > | # a different object method here... > | } > | } Ignore this. > the idea being that the method1 and method2 don't appear directly in > the symbol table.... You can still get private methods for an individual sub by defining them within that sub, but then they're not necessarily useful, as you can't get at them from another sub within the class... :-( MBM (feeling like a right arse for this... :-( ) -- Matthew Byng-Maddick http://colondot.net/ From pete@flatline.org.uk Wed Jul 18 13:53:27 2001 Received: from [195.8.181.200.55055] (helo=mccoy.flatline.org.uk ident=mail) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15MqpT-000F9N-00 for cam.pm@cam.pm.org; Wed, 18 Jul 2001 13:53:27 +0100 Received: from pete by mccoy.flatline.org.uk with local-esmtp (Exim 3.12 #1 (Debian)) id 15MqpS-0002KM-00; Wed, 18 Jul 2001 13:53:26 +0100 Date: Wed, 18 Jul 2001 13:53:26 +0100 (BST) From: Peter Clay To: cam.pm@cam.pm.org Subject: Re: perl6 In-Reply-To: <20010716202547.A30231@colon.colondot.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Mon, 16 Jul 2001, Matthew Byng-Maddick wrote: > I'm not sure that I follow what you mean here. The OO idea is that the > object methods act on *this object*. So bless() and the -> syntax is all > you need for OO programming. Of course, "real" OO languages provide ways > to keep some of the internals of an object class private (and this is > actually possible in Perl, though slightly horrid syntactically[1]), and > Perl doesn't make this easy. And many "real" OO languages provide strong static typechecking, which I think is what Martin wants. Unfortunately static tyepchecking is anathema to Perl.. As MBM has managed to show, you can almost get this sort of thing with closures, but it's hard to get right and not a "natural" syntactic idiom. I keep meaning to look more at CLOS (Common Lisp Object System), as it seems to do the right stuff. Let's think of a suitable idiom and work out the implementation later :) Pete -- Undiscovered band of the minute: Berths and the Beanbag Furnished From mk270@cam.ac.uk Wed Jul 18 14:09:35 2001 Received: from pc2-camb6-0-cust74.cam.cable.ntl.com ([213.107.107.74.7173] helo=oh.no.ucant.org) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15Mr54-000FBk-00 for cam.pm@cam.pm.org; Wed, 18 Jul 2001 14:09:35 +0100 Received: from mk270 (helo=localhost) by oh.no.ucant.org with local-smtp (Exim 3.20 #5) id 15Mr4y-00052Y-00 for cam.pm@cam.pm.org; Wed, 18 Jul 2001 14:09:28 +0100 Date: Wed, 18 Jul 2001 14:09:28 +0100 (BST) From: Martin Keegan X-Sender: mk270@oh.no.ucant.org To: cam.pm@cam.pm.org Subject: Re: perl6 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Wed, 18 Jul 2001, Peter Clay wrote: > > I'm not sure that I follow what you mean here. The OO idea is that the > > object methods act on *this object*. So bless() and the -> syntax is all > > you need for OO programming. Of course, "real" OO languages provide ways > > to keep some of the internals of an object class private (and this is > > actually possible in Perl, though slightly horrid syntactically[1]), and > > Perl doesn't make this easy. > > And many "real" OO languages provide strong static typechecking, which I > think is what Martin wants. Unfortunately static tyepchecking is anathema > to Perl.. Nah, I just want sane syntax for my variables: $employee.hoopiness = 12; I don't give a damn about the type checking; I'm actively against it. I want to be able to create a new attribute on the fly. Mk From cam-pm@lists.colondot.net Wed Jul 18 14:18:29 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15MrDh-000FD5-00 for cam.pm@cam.pm.org; Wed, 18 Jul 2001 14:18:29 +0100 Date: Wed, 18 Jul 2001 14:18:29 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: perl6 Message-ID: <20010718141829.D57297@colon.colondot.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mk270@cam.ac.uk on Wed, Jul 18, 2001 at 02:09:28PM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Wed, Jul 18, 2001 at 02:09:28PM +0100, Martin Keegan wrote: > On Wed, 18 Jul 2001, Peter Clay wrote: > > > I'm not sure that I follow what you mean here. The OO idea is that the > > > object methods act on *this object*. So bless() and the -> syntax is all > > > you need for OO programming. Of course, "real" OO languages provide ways > > > to keep some of the internals of an object class private (and this is > > > actually possible in Perl, though slightly horrid syntactically[1]), and > > > Perl doesn't make this easy. > > And many "real" OO languages provide strong static typechecking, which I > > think is what Martin wants. Unfortunately static tyepchecking is anathema > > to Perl.. > Nah, I just want sane syntax for my variables: $employee.hoopiness = 12; "Hey you sass that hoopy frood Martin Keegan? ..." $employee.knowledge_of_location_of_towel anyone? This, in perl6 would (I think) denote a method call, but from perl5.5, you have a syntax which allows you to write accessors in this way: sub :lvalue AUTOLOAD { ... } > I don't give a damn about the type checking; I'm actively against it. I > want to be able to create a new attribute on the fly. right. you might, in this case have to think about doing: $employee.{'hoopiness'} = 12; This'd definitely work... although, you can use the autoload to make any unknown methods into auto hash keys... MBM -- Matthew Byng-Maddick http://colondot.net/ From mk270@cam.ac.uk Wed Jul 18 14:30:20 2001 Received: from pc2-camb6-0-cust74.cam.cable.ntl.com ([213.107.107.74.9221] helo=oh.no.ucant.org) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15MrPA-000FFd-00 for cam.pm@cam.pm.org; Wed, 18 Jul 2001 14:30:20 +0100 Received: from mk270 (helo=localhost) by oh.no.ucant.org with local-smtp (Exim 3.20 #5) id 15MrP9-000536-00 for cam.pm@cam.pm.org; Wed, 18 Jul 2001 14:30:19 +0100 Date: Wed, 18 Jul 2001 14:30:19 +0100 (BST) From: Martin Keegan X-Sender: mk270@oh.no.ucant.org To: cam.pm@cam.pm.org Subject: Re: perl6 In-Reply-To: <20010718141829.D57297@colon.colondot.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Wed, 18 Jul 2001, Matthew Byng-Maddick wrote: > $employee.knowledge_of_location_of_towel anyone? > > This, in perl6 would (I think) denote a method call, but from perl5.5, you > have a syntax which allows you to write accessors in this way: > > sub :lvalue AUTOLOAD { ... } This is precisely what I want to avoid. I've written some MUDs in perl and they all rely heavily on the AUTOLOAD hack to give me structs. I fail to see why I need to execute a whole Menge of code just to get subobnoxious syntax for non-scalar structures. Mk From pak21@srcf.ucam.org Thu Jul 19 16:55:13 2001 Received: from lilac.csi.cam.ac.uk ([131.111.8.44.53404] ident=exim) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15NG8v-000Hdv-00 for cam.pm@cam.pm.org; Thu, 19 Jul 2001 16:55:13 +0100 Received: from student.cusu.cam.ac.uk ([131.111.179.82] helo=kern.srcf.societies.cam.ac.uk ident=mail) by lilac.csi.cam.ac.uk with esmtp (Exim 3.22 #1) id 15NG8u-0004eI-00 for cam.pm@cam.pm.org; Thu, 19 Jul 2001 16:55:12 +0100 Received: from pak21 by kern.srcf.societies.cam.ac.uk with local (Exim 3.12 #1 (Debian)) id 15NG8u-0000vz-00 for ; Thu, 19 Jul 2001 16:55:12 +0100 Date: Thu, 19 Jul 2001 16:55:12 +0100 From: Philip Kendall To: cam.pm@cam.pm.org Subject: Re: perl6 Message-ID: <20010719165511.A3128@srcf.ucam.org> Mail-Followup-To: cam.pm@cam.pm.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from lejm3@hermes.cam.ac.uk on Mon, Jul 16, 2001 at 05:35:57PM +0100 Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Mon, Jul 16, 2001 at 05:35:57PM +0100, Lucy McWilliam wrote: Ooops. Meant to answer this one a while back, but... errr.. forgot. > BTW, anyone up for putting some theory into practice[1] and have > a meet up? Yes :-) Can't do this Sunday or next weekend, but other than that... Phil -- Philip Kendall http://www.srcf.ucam.org/~pak21/ From cam-pm@lists.colondot.net Thu Jul 19 17:13:06 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15NGQE-000HgP-00 for cam.pm@cam.pm.org; Thu, 19 Jul 2001 17:13:06 +0100 Date: Thu, 19 Jul 2001 17:13:06 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: perl6 Message-ID: <20010719171306.F65429@colon.colondot.net> References: <20010719165511.A3128@srcf.ucam.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010719165511.A3128@srcf.ucam.org>; from pak21-campm@srcf.ucam.org on Thu, Jul 19, 2001 at 04:55:12PM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Thu, Jul 19, 2001 at 04:55:12PM +0100, Philip Kendall wrote: > On Mon, Jul 16, 2001 at 05:35:57PM +0100, Lucy McWilliam wrote: > Ooops. Meant to answer this one a while back, but... errr.. forgot. Didn't we all. :-) We must have a meet. > > BTW, anyone up for putting some theory into practice[1] and have > > a meet up? > Yes :-) > Can't do this Sunday or next weekend, but other than that... damn. Those are times that I can do... ...oooh. shiny new laptop. :-) MBM -- Matthew Byng-Maddick http://colondot.net/ From tim.cutts@incyte.com Thu Jul 19 17:14:30 2001 Received: from master.incyte.com ([198.31.37.253.29004] helo=dipsy.eu.incyte.com) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15NGRa-000Hgt-00 for cam.pm@cam.pm.org; Thu, 19 Jul 2001 17:14:30 +0100 Received: from localhost ([127.0.0.1] helo=trill.eu.incyte.com) by dipsy.eu.incyte.com with esmtp (Exim 2.12 #3) id 15NGRR-00043P-00 for cam.pm@cam.pm.org; Thu, 19 Jul 2001 17:14:21 +0100 Received: from timc by trill.eu.incyte.com with local (Exim 3.22 #1) id 15NGRQ-0003Bl-00 for cam.pm@cam.pm.org; Thu, 19 Jul 2001 17:14:20 +0100 Date: Thu, 19 Jul 2001 17:14:20 +0100 From: Tim Cutts To: cam.pm@cam.pm.org Subject: Re: perl6 Message-ID: <20010719171420.F11305@trill.eu.incyte.com> Mail-Followup-To: Tim Cutts , cam.pm@cam.pm.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010719165511.A3128@srcf.ucam.org> User-Agent: Mutt/1.3.18i Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Thu, Jul 19, 2001 at 04:55:12PM +0100, Philip Kendall wrote: > > Can't do this Sunday or next weekend, but other than that... > I'm away for mych of the next two weeks (as is Lucy - I know she's gone to the Bioinformatics Open Source and Intelligent Systems in Molecular Biology conferences in Copenhagen) so about two weeks from now would be good. Tim. -- Tim Cutts PhD Tel: +44 1223 454918 Senior Bioinformatics Scientist Incyte Genomics Botanic House, 100 Hills Road, Cambridge, CB2 1FF, UK From nick@plum.flirble.org Thu Jul 19 17:18:03 2001 Received: from plum.flirble.org ([195.40.6.20.7443] ident=exim) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15NGV1-000Hhg-00 for cam.pm@cam.pm.org; Thu, 19 Jul 2001 17:18:03 +0100 Received: from nick by plum.flirble.org with local (Exim 3.20 #3) id 15NGUw-000DUp-00; Thu, 19 Jul 2001 17:17:58 +0100 Date: Thu, 19 Jul 2001 17:17:58 +0100 From: Nicholas Clark To: Tim Cutts , cam.pm@cam.pm.org Subject: Re: perl6 Message-ID: <20010719171757.J24761@plum.flirble.org> References: <20010719165511.A3128@srcf.ucam.org> <20010719171420.F11305@trill.eu.incyte.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010719171420.F11305@trill.eu.incyte.com>; from tim.cutts@incyte.com on Thu, Jul 19, 2001 at 05:14:20PM +0100 X-Organisation: Tetrachloromethane Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Thu, Jul 19, 2001 at 05:14:20PM +0100, Tim Cutts wrote: > I'm away for mych of the next two weeks (as is Lucy - I know she's gone > to the Bioinformatics Open Source and Intelligent Systems in Molecular > Biology conferences in Copenhagen) so about two weeks from now would be > good. When all the people you don't want are in Amsterdam? :-) Nick From cam-pm@lists.colondot.net Thu Jul 19 17:19:37 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15NGWX-000HiQ-00 for cam.pm@cam.pm.org; Thu, 19 Jul 2001 17:19:37 +0100 Date: Thu, 19 Jul 2001 17:19:37 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: perl6 Message-ID: <20010719171937.G65429@colon.colondot.net> References: <20010719165511.A3128@srcf.ucam.org> <20010719171420.F11305@trill.eu.incyte.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010719171420.F11305@trill.eu.incyte.com>; from tim.cutts@incyte.com on Thu, Jul 19, 2001 at 05:14:20PM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Thu, Jul 19, 2001 at 05:14:20PM +0100, Tim Cutts wrote: > On Thu, Jul 19, 2001 at 04:55:12PM +0100, Philip Kendall wrote: > > Can't do this Sunday or next weekend, but other than that... > I'm away for mych of the next two weeks (as is Lucy - I know she's gone > to the Bioinformatics Open Source and Intelligent Systems in Molecular > Biology conferences in Copenhagen) so about two weeks from now would be > good. Lucy, as our great leader, do you want to announce a date and venue, please? MBM -- Matthew Byng-Maddick http://colondot.net/ From tim.cutts@incyte.com Thu Jul 19 18:00:10 2001 Received: from master.incyte.com ([198.31.37.253.44099] helo=dipsy.eu.incyte.com) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15NH9l-000HnL-00 for cam.pm@cam.pm.org; Thu, 19 Jul 2001 18:00:10 +0100 Received: from localhost ([127.0.0.1] helo=trill.eu.incyte.com) by dipsy.eu.incyte.com with esmtp (Exim 2.12 #3) id 15NH9j-00049l-00 for cam.pm@cam.pm.org; Thu, 19 Jul 2001 18:00:07 +0100 Received: from timc by trill.eu.incyte.com with local (Exim 3.22 #1) id 15NH9i-0003F0-00 for cam.pm@cam.pm.org; Thu, 19 Jul 2001 18:00:06 +0100 Date: Thu, 19 Jul 2001 18:00:06 +0100 From: Tim Cutts To: cam.pm@cam.pm.org Subject: Re: perl6 Message-ID: <20010719180006.C12345@trill.eu.incyte.com> Mail-Followup-To: Tim Cutts , cam.pm@cam.pm.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010719171937.G65429@colon.colondot.net> User-Agent: Mutt/1.3.18i Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Thu, Jul 19, 2001 at 05:19:37PM +0100, Matthew Byng-Maddick wrote: > On Thu, Jul 19, 2001 at 05:14:20PM +0100, Tim Cutts wrote: > > On Thu, Jul 19, 2001 at 04:55:12PM +0100, Philip Kendall wrote: > > > Can't do this Sunday or next weekend, but other than that... > > I'm away for mych of the next two weeks (as is Lucy - I know she's gone > > to the Bioinformatics Open Source and Intelligent Systems in Molecular > > Biology conferences in Copenhagen) so about two weeks from now would be > > good. > > Lucy, as our great leader, do you want to announce a date and venue, please? I think she's already gone - didn't she mention she was leaving for Copenhagen yesterday or today? Tim. -- Tim Cutts PhD Tel: +44 1223 454918 Senior Bioinformatics Scientist Incyte Genomics Botanic House, 100 Hills Road, Cambridge, CB2 1FF, UK From cam-pm@lists.colondot.net Thu Jul 19 22:03:39 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15NKxP-000I7q-00 for cam.pm@cam.pm.org; Thu, 19 Jul 2001 22:03:39 +0100 Date: Thu, 19 Jul 2001 22:03:39 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: perl6 Message-ID: <20010719220339.B69614@colon.colondot.net> References: <20010719171937.G65429@colon.colondot.net> <20010719180006.C12345@trill.eu.incyte.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010719180006.C12345@trill.eu.incyte.com>; from tim.cutts@incyte.com on Thu, Jul 19, 2001 at 06:00:06PM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Thu, Jul 19, 2001 at 06:00:06PM +0100, Tim Cutts wrote: > On Thu, Jul 19, 2001 at 05:19:37PM +0100, Matthew Byng-Maddick wrote: > > Lucy, as our great leader, do you want to announce a date and venue, > > please? > I think she's already gone - didn't she mention she was leaving for > Copenhagen yesterday or today? Oops. I guess not next weekend, then, but the one after (4th August). MBM -- Matthew Byng-Maddick http://colondot.net/ From KIO@plextek.co.uk Fri Jul 20 09:30:30 2001 Received: from [62.254.209.241.41489] (helo=mailgate.plextek.co.uk) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15NVg6-000J9E-00 for cam.pm@cam.pm.org; Fri, 20 Jul 2001 09:30:30 +0100 Received: from mailgate.plextek.co.uk (unverified) by mailgate.plextek.co.uk (Content Technologies SMTPRS 4.1.2) with SMTP id for ; Fri, 20 Jul 2001 09:24:33 +0100 Received: from GWMain-Message_Server by mailgate.plextek.co.uk with Novell_GroupWise; Fri, 20 Jul 2001 09:29:45 +0100 Message-Id: X-Mailer: Novell GroupWise 5.5.4 Date: Fri, 20 Jul 2001 09:29:20 +0100 From: "Kevin O'Rourke" To: Subject: Hello Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: Hi, I've just subscribed to the list, so I thought I'd say hello before = settling back and lurking quietly in the shadows. I'm still pretty much a Perl beginner and I have to do most of my Perl in = my spare time as my real job is C programming for DSPs, the big difference = is that you don't usually debug Perl with an oscilloscope! I can often be found hanging around at http://www.perlmonks.org and I have = a personal homepage at http://www.koshka1.demon.co.uk.=20 Bye for now, Kevin. -- Kevin O'Rourke Project Engineer, Plextek Phone: +44 1799 533 312 From cam-pm@lists.colondot.net Fri Jul 20 10:14:53 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15NWN3-000JFE-00 for cam.pm@cam.pm.org; Fri, 20 Jul 2001 10:14:53 +0100 Date: Fri, 20 Jul 2001 10:14:53 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: Hello Message-ID: <20010720101453.B73728@colon.colondot.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from KIO@plextek.co.uk on Fri, Jul 20, 2001 at 09:29:20AM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Fri, Jul 20, 2001 at 09:29:20AM +0100, Kevin O'Rourke wrote: > I've just subscribed to the list, so I thought I'd say hello before > settling back and lurking quietly in the shadows. Since Lucy (our great leader) is apparently away, I guess it could be said to fall to me to welcome you and everybody else who has subscribed recently. > I'm still pretty much a Perl beginner and I have to do most of my Perl Doesn't matter :-) > in my spare time as my real job is C programming for DSPs, the big > difference is that you don't usually debug Perl with an oscilloscope! "The most effective debugging tool is still careful thought, coupled with judiciously placed print statements." - Brian Kernighan, 1978 (shamelessly nicked from simon c's sigfile. :-) I'm trying to picture how one could apply that to an oscilloscope. :-) > I can often be found hanging around at http://www.perlmonks.org and I > have a personal homepage at http://www.koshka1.demon.co.uk. we need to do something about the cam.pm webpages, I guess we will once we've done our first meet[1]... :-) [1] which will happen soon, honest. :-) MBM -- Matthew Byng-Maddick http://colondot.net/ From pak21@srcf.ucam.org Fri Jul 20 11:38:43 2001 Received: from mauve.csi.cam.ac.uk ([131.111.8.38.6355] ident=exim) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15NXgB-000JOn-00 for cam.pm@cam.pm.org; Fri, 20 Jul 2001 11:38:43 +0100 Received: from student.cusu.cam.ac.uk ([131.111.179.82] helo=kern.srcf.societies.cam.ac.uk ident=mail) by mauve.csi.cam.ac.uk with esmtp (Exim 3.22 #1) id 15NXgA-0001mp-00 for cam.pm@cam.pm.org; Fri, 20 Jul 2001 11:38:42 +0100 Received: from pak21 by kern.srcf.societies.cam.ac.uk with local (Exim 3.12 #1 (Debian)) id 15NXgA-00038a-00 for ; Fri, 20 Jul 2001 11:38:42 +0100 Date: Fri, 20 Jul 2001 11:38:42 +0100 From: Philip Kendall To: cam.pm@cam.pm.org Subject: Re: Hello Message-ID: <20010720113842.A10280@srcf.ucam.org> Mail-Followup-To: cam.pm@cam.pm.org References: <20010720101453.B73728@colon.colondot.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010720101453.B73728@colon.colondot.net>; from cam-pm@lists.colondot.net on Fri, Jul 20, 2001 at 10:14:53AM +0100 Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Fri, Jul 20, 2001 at 10:14:53AM +0100, Matthew Byng-Maddick wrote: > > (shamelessly nicked from simon c's sigfile. :-) On that subject... sub UNIVERSAL::AUTOLOAD{ $UNIVERSAL::AUTOLOAD =~ s/::/ /; print "$UNIVERSAL::AUTOLOAD "}; hacker perl another just; Anyone willing to give me some hints on how that one works? Phil -- Philip Kendall http://www.srcf.ucam.org/~pak21/ From cam-pm@lists.colondot.net Fri Jul 20 11:55:37 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15NXwX-000JQr-00 for cam.pm@cam.pm.org; Fri, 20 Jul 2001 11:55:37 +0100 Date: Fri, 20 Jul 2001 11:55:37 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: Hello Message-ID: <20010720115537.D73728@colon.colondot.net> References: <20010720101453.B73728@colon.colondot.net> <20010720113842.A10280@srcf.ucam.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010720113842.A10280@srcf.ucam.org>; from pak21-campm@srcf.ucam.org on Fri, Jul 20, 2001 at 11:38:42AM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Fri, Jul 20, 2001 at 11:38:42AM +0100, Philip Kendall wrote: > On Fri, Jul 20, 2001 at 10:14:53AM +0100, Matthew Byng-Maddick wrote: > > (shamelessly nicked from simon c's sigfile. :-) > On that subject... > sub UNIVERSAL::AUTOLOAD{ $UNIVERSAL::AUTOLOAD =~ s/::/ /; print > "$UNIVERSAL::AUTOLOAD "}; hacker perl another just; > Anyone willing to give me some hints on how that one works? UNIVERSAL is a special package, it provides the base function. so, if no package is specified, it will try ::AUTOLOAD and then UNIVERSAL::AUTOLOAD. so, reformatting: | sub UNIVERSAL::AUTOLOAD { | $UNIVERSAL::AUTOLOAD =~ s/::/ /; | print "$UNIVERSAL::AUTOLOAD "; | } | | hacker perl another just; the value of $UNIVERSAL::AUTOLOAD will be (like every other autoloader) the name of the function: (in this case, potentially, ::just ::another, etc). we parse this as | hacker(perl(another(just()))); This needs to be evaluated as just() another(just()) perl(another(just())) and the above expression. Hence: just another perl hacker Does that help? MBM -- Matthew Byng-Maddick http://colondot.net/ From pak21@srcf.ucam.org Fri Jul 20 12:06:50 2001 Received: from navy.csi.cam.ac.uk ([131.111.8.49.34972] ident=exim) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15NY7O-000JSn-00 for cam.pm@cam.pm.org; Fri, 20 Jul 2001 12:06:50 +0100 Received: from student.cusu.cam.ac.uk ([131.111.179.82] helo=kern.srcf.societies.cam.ac.uk ident=mail) by navy.csi.cam.ac.uk with esmtp (Exim 3.22 #1) id 15NY7N-0003ev-00 for cam.pm@cam.pm.org; Fri, 20 Jul 2001 12:06:49 +0100 Received: from pak21 by kern.srcf.societies.cam.ac.uk with local (Exim 3.12 #1 (Debian)) id 15NY7N-0004F4-00 for ; Fri, 20 Jul 2001 12:06:49 +0100 Date: Fri, 20 Jul 2001 12:06:49 +0100 From: Philip Kendall To: cam.pm@cam.pm.org Subject: Re: Hello Message-ID: <20010720120649.A14578@srcf.ucam.org> Mail-Followup-To: cam.pm@cam.pm.org References: <20010720101453.B73728@colon.colondot.net> <20010720113842.A10280@srcf.ucam.org> <20010720115537.D73728@colon.colondot.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010720115537.D73728@colon.colondot.net>; from cam-pm@lists.colondot.net on Fri, Jul 20, 2001 at 11:55:37AM +0100 Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Fri, Jul 20, 2001 at 11:55:37AM +0100, Matthew Byng-Maddick wrote: > > | sub UNIVERSAL::AUTOLOAD { > | $UNIVERSAL::AUTOLOAD =~ s/::/ /; > | print "$UNIVERSAL::AUTOLOAD "; > | } > | > | hacker perl another just; > > the value of $UNIVERSAL::AUTOLOAD will be (like every other autoloader) > the name of the function: (in this case, potentially, ::just ::another, etc). > > we parse this as > > | hacker(perl(another(just()))); Do we? I tried: | sub UNIVERSAL::AUTOLOAD { | die "$UNIVERSAL::AUTOLOAD"; | } | | hacker perl another just; which gave: $ perl japh.pl cass26:pak:~/tmp$ perl japh.pl just::another at japh.pl line 2. where as using the bracketed form hacker(perl(another(just()))) gives: $ perl japh.pl cass26:pak:~/tmp$ perl japh.pl main::just at japh.pl line 2. This is where I got confused :-) (In fact, using the `hacker(perl(another(just()))))' form in the original program gives an output of `main just main another main perl main hacker', which I understand...). Is this something to do with indirect objects again? Phil -- Philip Kendall http://www.srcf.ucam.org/~pak21/ From KIO@plextek.co.uk Fri Jul 20 13:07:37 2001 Received: from [62.254.209.241.62994] (helo=mailgate.plextek.co.uk) by colon.colondot.net with esmtp (Exim 3.22 #1) id 15NZ4D-000Jgx-00 for cam.pm@cam.pm.org; Fri, 20 Jul 2001 13:07:37 +0100 Received: from mailgate.plextek.co.uk (unverified) by mailgate.plextek.co.uk (Content Technologies SMTPRS 4.1.2) with SMTP id for ; Fri, 20 Jul 2001 13:02:10 +0100 Received: from GWMain-Message_Server by mailgate.plextek.co.uk with Novell_GroupWise; Fri, 20 Jul 2001 13:07:22 +0100 Message-Id: X-Mailer: Novell GroupWise 5.5.4 Date: Fri, 20 Jul 2001 13:06:42 +0100 From: "Kevin O'Rourke" To: Subject: Re: Hello Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: >>> cam-pm@lists.colondot.net 07/20/01 10:14am >>> >> in my spare time as my real job is C programming for DSPs, the big >> difference is that you don't usually debug Perl with an oscilloscope! > > "The most effective debugging tool is still careful thought, coupled = with=20 > judiciously placed print statements." - Brian Kernighan, 1978 > > I'm trying to picture how one could apply that to an oscilloscope. :-) The debug terminal output is usually one of the first things to die on the = DSP, so instead of print statements you twiddle I/O lines or flash LEDs. I'm sure it's good training in debugging, but it's not much fun! Kevin. -- Kevin O'Rourke Project Engineer, Plextek Phone: +44 1799 533 312 = = = = = = = = = = = = = = = = =20 From cam-pm@lists.colondot.net Fri Jul 20 13:20:31 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15NZGh-000Jis-00 for cam.pm@cam.pm.org; Fri, 20 Jul 2001 13:20:31 +0100 Date: Fri, 20 Jul 2001 13:20:31 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: Hello Message-ID: <20010720132031.F73728@colon.colondot.net> References: <20010720101453.B73728@colon.colondot.net> <20010720113842.A10280@srcf.ucam.org> <20010720115537.D73728@colon.colondot.net> <20010720120649.A14578@srcf.ucam.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010720120649.A14578@srcf.ucam.org>; from pak21-campm@srcf.ucam.org on Fri, Jul 20, 2001 at 12:06:49PM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Fri, Jul 20, 2001 at 12:06:49PM +0100, Philip Kendall wrote: > On Fri, Jul 20, 2001 at 11:55:37AM +0100, Matthew Byng-Maddick wrote: > > | sub UNIVERSAL::AUTOLOAD { > > | $UNIVERSAL::AUTOLOAD =~ s/::/ /; > > | print "$UNIVERSAL::AUTOLOAD "; > > | } > > | > > | hacker perl another just; > > the value of $UNIVERSAL::AUTOLOAD will be (like every other autoloader) > > the name of the function: (in this case, potentially, ::just ::another, etc). > > > > we parse this as > > | hacker(perl(another(just()))); > Do we? No. Further experimentation: | [mbm@colon]:~$ perl | a b c d ; | Can't locate object method "c" via package "d" at - line 1. so for some reason, it's parsing this as | b::a( b, d::c( d ) ) (I wrote everything else before, but: )It's the hack that allows "new" to be like a keyword. > Is this something to do with indirect objects again? sort of. MBM -- Matthew Byng-Maddick http://colondot.net/ From cam-pm@lists.colondot.net Fri Jul 20 13:21:42 2001 Received: from mbm by colon.colondot.net with local (Exim 3.22 #1) id 15NZHq-000JjZ-00 for cam.pm@cam.pm.org; Fri, 20 Jul 2001 13:21:42 +0100 Date: Fri, 20 Jul 2001 13:21:42 +0100 From: Matthew Byng-Maddick To: cam.pm@cam.pm.org Subject: Re: Hello Message-ID: <20010720132142.G73728@colon.colondot.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from KIO@plextek.co.uk on Fri, Jul 20, 2001 at 01:06:42PM +0100 Organization: Colondot.net Sender: cam.pm-admin@cam.pm.org Errors-To: cam.pm-admin@cam.pm.org X-BeenThere: cam.pm@cam.pm.org X-Mailman-Version: 2.0.5 Precedence: bulk Reply-To: cam.pm@cam.pm.org List-Help: List-Post: List-Subscribe: , List-Id: Cambridge(UK) PerlMongers List-Unsubscribe: , List-Archive: On Fri, Jul 20, 2001 at 01:06:42PM +0100, Kevin O'Rourke wrote: > >>> cam-pm@lists.colondot.net 07/20/01 10:14am >>> > >> in my spare time as my real job is C programming for DSPs, the big > >> difference is that you don't usually debug Perl with an oscilloscope! > > "The most effective debugging tool is still careful thought, coupled with > > judiciousl