in reply to Converting Filehandle to Array call in Object Creation

I think that IO::Scalar might be what you're looking for:
use IO::Scalar; my $data = <<EOF; AAAAAAAAAAAAAAA AAAAAAAGGAAACCA EOF my $SH = new IO::Scalar \$data; my $in = Bio::AlignIO->new(-fh => $SH, -format => 'fasta');

Replies are listed 'Best First'.
Re^2: Converting Filehandle to Array call in Object Creation
by ikegami (Patriarch) on Apr 15, 2005 at 14:27 UTC
    The requirements were to start with an array. I suppose you could create $data by joining the contents of the array, but I don't think that's enough because what I said to holli applies to you too.
      Ah. y, i was concentrating more on the variable to filehandle issue rather than the actual data format.. Could still join it, though--just need an extra step to the join.. something like:
      my @data = qw/AAAAAAAAAAAAAAA AAAAAAAGGAAACCA/; my $ct = 0; my $data = join '', map { sprintf ">Seq%d\n%s\n", ++$ct, $_ } @data; my $SH = new IO::Scalar \$data;