[Bioperl-l] Get tag value into a variable

Paulo Almeida palmeida at igc.gulbenkian.pt
Wed Jan 26 06:25:06 EST 2005


Hi,

This is probably a perl problem, rather than a bioperl problem, but I'm
having trouble storing a tag from a feature in a variable. I do this:

print $feat->get_tag_values($tag) , "\n" if $tag eq 'coded_by';
my $coded = $feat->get_tag_values($tag);
print $coded , "\n" if $tag eq 'coded_by';

and the output is this:

AK021294.1:<1..381
1

The first line is correct, and I suppose the second takes the value '1'
because $feat->get_tag_values($tag) was successful, but how can I put
the actual tag in a variable, for later use? (my current solution is to
print the tag to a file and then read it from there, which is less than
elegant, to say the least). I'm attaching the full code, in case someone
wants to test it.

Thanks,
Paulo

-- 
Paulo Almeida
Instituto Gulbenkian de Ciencia
Apartado 14, 2781-901, Oeiras, PORTUGAL
tel  +351 21 446 46 35
fax  +351 21 440 79 70
http://www.igc.gulbenkian.pt


More information about the Bioperl-l mailing list