Fwd: Answer to my own problem
Peter Scott
Peter at PSDT.com
Wed Sep 18 19:27:23 CDT 2002
Hah, I guess the mailing list thought you were trying to enter a
command. Hopefully the indentation will stop that this time.
>Date: Wed, 18 Sep 2002 19:16:47 -0500
>From: owner-victoria-pm at pm.org
>X-Authentication-Warning: mail.pm.org: majordomo set sender to
> owner-victoria-pm at pm.org using -f
>To: victoria-pm-approval at pm.org
>Subject: BOUNCE victoria-pm at pm.org: Admin request of type /^sub\b/i at
> line 3
>
> >From peter at psdt.com Wed Sep 18 19:16:46 2002
>Received: from cascara.uvic.ca (root at cascara.uvic.ca [142.104.5.28])
> by mail.pm.org (8.11.6/8.11.3) with ESMTP id g8J0GjA30721
> for <victoria-pm at pm.org>; Wed, 18 Sep 2002 19:16:45 -0500
>Received: from wm2.uvic.ca (ntsrvr5.comp.uvic.ca [142.104.5.65])
> by cascara.uvic.ca (8.12.4/8.12.4) with ESMTP id g8J05Wof484896
> for <victoria-pm at pm.org>; Wed, 18 Sep 2002 17:05:32 -0700
>X-WebMail-UserID: nkuipers
>Date: Wed, 18 Sep 2002 17:05:32 -0700
>Sender: nkuipers <nkuipers at uvic.ca>
>From: nkuipers <nkuipers at uvic.ca>
>To: victoria-pm at pm.org
>X-EXP32-SerialNo: 00003609
>Subject: Answer to my own problem
>Message-ID: <3D89190E at wm2.uvic.ca>
>Mime-Version: 1.0
>Content-Type: text/plain; charset="ISO-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Mailer: WebMail (Hydra) SMTP v3.62
>X-UVic-Virus-Scanned: OK - Passed virus scan by Sophos v3.59 (sophie)
>on cascara
>X-Scanned-By: MIMEDefang 2.19 (www . roaringpenguin . com / mimedefang)
>
>Involved setting pos before calling it on a match location. Simple.
>
>sub scan_for_stops {
> my ($seqref, $patternref, $type) = @_;
> my $frame = 1;
> my ($codon, $list);
>
> SCANNER:
> my $stoplocations = "$type$frame(";
> pos $$seqref = $frame;
> while ( $$seqref =~ m/(\w{3})/g and $codon = $1 ) {
> if ( $codon =~ m/$$patternref/ ) {
> $stoplocations .= (pos($$seqref) - 2) . '&'
> }
> }
> $stoplocations =~ s/&$//; #just some formatting...
> $stoplocations .= ") "; #...to make it look nice
> $list .= $stoplocations;
> $frame++;
> goto SCANNER unless $frame > 3;
>
> $list =~ s/ $//;
> return $list;
>}
I doubt your pattern is so long that you save more in passing a
reference than you do in dereferencing.
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com/
More information about the Victoria-pm
mailing list