I'm reading a file and processing according to the need. As the output has tables, few columns are misaligned. I'm using while loop for processing of input read file.
Regexp:
$_ =~ s/$var/$mod{$var}/;
print "$_";
Please suggest me better way to format the output.
col1 (40spaces) col2(nspaces) coln(nspaces)
Here it is how i done it: open(MYFILE,'log') while() { if(condition) my($var) = (split ())[]; $var =~ s/xyz/xy/; if($var = condition) $var = $1; } $_ =~ s/$var/$mod{$var}/; print "$_"
i need the output table 2nd column to be 40 spaces