Thursday, November 1, 2007

I need PERL for dummies...

Why the first printf worked but not the second??

unless(open(OUTPUT, ">$out_file")) {die "Could not open $out_file!!\n"};
if($style eq 'v') {
@head_v = qw(a b c d e f);
$format_v = ("%s\t" x @head_v)."\n";
printf OUTPUT $format_v, @head_v;
}
if($style eq 'm') {
@head_m = qw(l m n o p q r s t u v w);
$format_m = ("%s\t" x @head_m)."\n";
printf OUTPUT $format_m, @head_m;
}
close(OUTPUT);

No comments: