Trailing Spaces -- Format Perl

K

KVN Chary

Hello,

my $var1 = "temp";
my $var2 = "123";
my $space = " ";

format STDOUT =
@<<<<<<<<< @<<< @<<<<<<<<<<<<<<<<<<<<<<<<<
$var1,$var2,$space
..

I need to put 26 spaces at the end of line. But this code doesn't work?
How can I do this using FORMAT Perl Command?

Thanks
KVN
 
J

John W. Krahn

KVN said:
my $var1 = "temp";
my $var2 = "123";
my $space = " ";

format STDOUT =
@<<<<<<<<< @<<< @<<<<<<<<<<<<<<<<<<<<<<<<<
$var1,$var2,$space
.

I need to put 26 spaces at the end of line. But this code doesn't work?
How can I do this using FORMAT Perl Command?

Are you sure that you need to use format? :)

formline '@<<<<<<<<< @<<< @<<<<<<<<<<<<<<<<<<<<<<<<<', $var1, $var2, $space;

print STDOUT pack 'A42', $^A;



John
 
B

Billy N. Patton

KVN said:
Hello,

my $var1 = "temp";
my $var2 = "123";
my $space = " ";

format STDOUT =
@<<<<<<<<< @<<< @<<<<<<<<<<<<<<<<<<<<<<<<<
$var1,$var2,$space
.

I need to put 26 spaces at the end of line. But this code doesn't work?
How can I do this using FORMAT Perl Command?

Thanks
KVN

You might try:
printf "%-8s %-3s ",$var1,$var2
print ' ' x 26 , "\n";

--
___ _ ____ ___ __ __
/ _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
/ _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
/___/
Texas Instruments ASIC Circuit Design Methodlogy Group
Dallas, Texas, 214-480-4455, (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top