C
cmic
Hello.
I have the following snippet :
#!/usr/local/bin/perl
use strict;
use warnings;
my @array=(2, 3, 5, 1, 5);;
my ($a, $b, $c);
format STDOUT =
@>>>>>>>>|@<<<|@<<<<<
$b, $a, $c
..
foreach (@array) {
$a=$_; $b=$a+100;$c=$a*2;
write ;
print "VAlue " . $a . "\n";
}
.... which prints :
102|2 |4
VAlue 2
103|3 |6
VAlue 3
but and I want my script to print this instead :
102|2 |4 VAlue 2
103|3 |6 VAlue 3
How to do this ? Or must I use sprintf instead ?
TYA
I have the following snippet :
#!/usr/local/bin/perl
use strict;
use warnings;
my @array=(2, 3, 5, 1, 5);;
my ($a, $b, $c);
format STDOUT =
@>>>>>>>>|@<<<|@<<<<<
$b, $a, $c
..
foreach (@array) {
$a=$_; $b=$a+100;$c=$a*2;
write ;
print "VAlue " . $a . "\n";
}
.... which prints :
102|2 |4
VAlue 2
103|3 |6
VAlue 3
but and I want my script to print this instead :
102|2 |4 VAlue 2
103|3 |6 VAlue 3
How to do this ? Or must I use sprintf instead ?
TYA