in reply to Writing to file part duex

(It's "deux".)

but I don't know how to get the same series of bases in the substitution.

s/([actg]{6})/...$1.../

Also I need to capture the locus name and place it before the ^^

You should have gotten a warning saying you were matching against an undefined value.
my ($locus) = /LOCUS\s*(\w+)/;

Replies are listed 'Best First'.
Re^2: Writing to file part deux
by Anonymous Monk on Jul 23, 2009 at 23:25 UTC
    I had tried my ($locus) = /LOCUS\s*(\w+)/; But it still doesn't capture it.
    I have just realized this is because the variable is being overwritten since it is searching line by line in the <$in>.
    How do I get around that?
      my $locus; while (...) { ... ($locus) = /.../; ... }
        I tried that but it still gives me initialized value $locus for each line of the <$in>...