#!/usr/bin/perl -w use strict; my $EXON_IN; for (my $i=0; $i < 5; $i++){ $EXON_IN = <$i/*test.txt>; print "$i, -$EXON_IN-\n"; }