[Bioperl-l] substitutions

Hilmar Lapp hlapp@gnf.org
Mon, 9 Sep 2002 22:56:49 -0700


On Monday, September 9, 2002, at 10:00  PM, Aaron J Mackey wrote:

>
> Turns out, to pass both SeqIO.t and LocationFactory.t you need this:
>
> Index: Bio/Factory/FTLocationFactory.pm
> ===================================================================
> RCS file:
> /home/repository/bioperl/bioperl-
> live/Bio/Factory/FTLocationFactory.pm,v
> retrieving revision 1.5
> diff -u -b -B -r1.5 FTLocationFactory.pm
> --- Bio/Factory/FTLocationFactory.pm    10 Sep 2002 02:24:36 
> -0000      1.5
> +++ Bio/Factory/FTLocationFactory.pm    10 Sep 2002 04:48:54 -0000
> @@ -196,6 +196,8 @@
>      # remove enclosing parentheses if any
>      $start =~ s/^\((.*)\)$/$1/;
>      $end   =~ s/^\((.*)\)$/$1/ if $end;
> +    $start =~ s/^\(//;
> +    $end   =~ s/\)$// if $end;
>

Are you absolutely sure you need the two additional substitutions? 
This defies all logic, as the previous two substitutions take care 
of that.

Can you try

$ perl -e '$a = "(200.300)"; $a =~ s/^\((.*)\)$/$1/; print "$a\n";'

on your system and let me know what it prints?

I've checked this on 5.6.0 on OSX and linux and 5.6.1 on Irix -- it 
works perfectly and removes both parentheses as you'd think it does. 
Should there be a difference between 5.6.1 on Irix and Linux?

	-hilmar

--
-------------------------------------------------------------
Hilmar Lapp                            email: lapp at gnf.org
GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
-------------------------------------------------------------