perl question

Hello, I have below a script from a previous question-- I need to open an output file to put the results into. I want the outfile file to have the header "Chain A :" at the start of the results eg. ChainA :1,2,5,7,6,9 etc..... can anyone help?

use strict;
use warnings;
$_ = '---bbbb--bbbb';
my @pos;
while (/\G.*?-/g) {
  push @pos, pos;
print join ', ', @pos;
print "\n";
Who is Participating?
leflonConnect With a Mentor Commented:
Hi paulieomeara,

you can

open(OUTFILE,">test.out") || die "can not open test.out";
print OUTFILE "Chain !: ".join(',',@pos);

paulieomearaAuthor Commented:
Thanks Lefton...don't know why it didn't work for me before but hey...all good!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.