in reply to Re^3: Perl Parser, need help
in thread Perl Parser, need help

Hi QM.. thanks for everything! After some modification on the matching of the "Sequence : Contig.." part, the script finally working! I disable the warning output, so it looks abit nicer when running the script.. here is the modified one. Thank u again QM! And thanks to everyone who helped!

#!/bin/perl/
my $sequence;

while (my $line = <>)
{
# Sequence keyword
if ($line =~ /^Sequence:\s+(\S+)/)
{
$sequence = $1; # save the sequence
next;
}

# Parameter keyword
next if ($line =~ /^Parameters:\s+(.*)$/);

# print any other non-blank lines
if ($line != /^\s+$/)
{
print "$sequence $line";
next;
}
}

Thanks again everyone!

Replies are listed 'Best First'.
Re^5: Perl Parser, need help
by QM (Parson) on Jun 02, 2005 at 12:46 UTC
    I disable the warning output, so it looks abit nicer when running the script.
    You mean you removed strict and warnings ???

    I can't check it where I am right now, but I don't see anything that would cause you problems, unless you're running on a very old or customized Perl.

    Perhaps you could relate what warnings you're getting, and we might convince you to put strict and warnings back in? Or perhaps it's related to your larger script, and not to this minimal example?

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of