Thanks a lot .

david wrote:

[EMAIL PROTECTED] wrote:



Hello All:

I am trying to format a check. Everything is fine except I cannot print
the line box surrounding the check items:

+---------------------------+
|                           |
|                           |
+---------------------------+

How do I format the vertical bars especially. I was able to print the
horizontals and the content of the check. Please help.



try:


#!/usr/bin/perl -w

use strict;

my $size = 30; #-- size of the box

print "Enter first name: "; chomp(my $first = <STDIN>);
print "Enter last name:  "; chomp(my $last  = <STDIN>);

print <<CHECK;
[EMAIL PROTECTED]'-' x ($size-2)]}+
|[EMAIL PROTECTED]' ' x ($size-2-length($first))]}|
|[EMAIL PROTECTED]' ' x ($size-2-length($last))]}|
[EMAIL PROTECTED]'-' x ($size-2)]}+
CHECK

#--
#-- same but easier to read:
#--
print '+','-' x ($size-2),'+',"\n";
print '|',$first,' ' x ($size-2-length($first)), '|',"\n";
print '|',$last, ' ' x ($size-2-length($last)),  '|',"\n";
print '+','-' x ($size-2),'+',"\n";

__END__

Enter first name: larry
Enter last name: wall
+----------------------------+
|larry                       |
|wall                        |
+----------------------------+
+----------------------------+
|larry                       |
|wall                        |
+----------------------------+

david







--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to