#!/usr/bin/perl
use strict;
use warnings;
my $var = 'LGMB-RP_06242011_HGWSI_1.fastq.sai.sam.bam.sort.bam';
if( $var =~ /^(.*)\.fastq/ ){
$var = $1;
}
print"$var\n";
$var = 'LGMB-RP_06242011_HGWSI_1.fastq.sai.sam.bam.sort.bam';
$var = "$1.sam" if( $var =~ /^(.*)\.sam/ );
print"$var\n";
$ perl t.pl
LGMB-RP_06242011_HGWSI_1
LGMB-RP_06242011_HGWSI_1.fastq.sai.sam
0 comentários:
Post a Comment