Look at our pick-primers.pl script: I added some ASCII characters to draw a box around the welcome screen. Now it looks like:
print STDERR " +----------------------------------------------+ | Pick Primer Tool v.01 | | | | Parameters: | | contig1 direction1 contig2 direction2 | | | | direction1,2 = U or C | +----------------------------------------------+ "; |
Nice, isn’t it? Yes, we can do much better, like (google ASCII-art for more fun):
-._ _.--'"`'--._ _.--'"`'--._ _.--'"`'--._ _ '-:`.'|`|"':-. '-:`.'|`|"':-. '-:`.'|`|"':-. '.` : '. '. '. | | | |'. '. | | | |'. '. | | | |'. '.: '. '. : '. '.| | | | '. '.| | | | '. '.| | | | '. '. : '. `. ' '. `.:_ | :_.' '. `.:_ | :_.' '. `.:_ | :_.' '. `.' `. `-..,..-' `-..,..-' `-..,..-' ` `
but this is not the main aim of this post. Rather I’d like you think how to make a subroutine that creates a frame around a multiline text. We can call it “boxprint”, and it will expect a multi-line text. We can invoke it with something like:
boxprint(" Pick Primer Tool v.01 Parameters: contig1 direction1 contig2 direction2 direction1,2 = U or C "); |
and we expect to obtain a boxed message.
You can use this page to create the script and test it live…
The solution is published here:
http://codepad.org/dXepm4PK