Personally, I would do it with printf. You can look up formatting options in any C book. (There are quite a few; like pack/unpack, it's like a programming language of it's own.)
$margin = 10; printf "'%${margin}s'\n", 'x'; __output__ ' x'
You don't need references to $_ in the foreach or split lines. The whole point about the default variable is that you can leave out the variable, and focus on the operation. Fewer implementation details, more result.
In related news,.... since you don't need $a or $b, just tell Perl to discard them by taking a slice of the split result:
... (split( /\t/ ))[2,3];
But you only need $c & $d for two lines, to join back together. So why not merge the two lines:
... join '/', (split( /\t/ ))[2,3];
You only use $qq to add the result of the join into @qqq, so save another line:
push @qqq, join '/', (split( /\t/ ))[2,3];
--
TTTATCGGTCGTTATATAGATGTTTGCA
In reply to Re: Printing in succesive columns...
by TomDLux
in thread Printing in succesive columns...
by bioinformatics
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |