dark314 has asked for the wisdom of the Perl Monks concerning the following question:
I ended up using printf in the following manner, thanks for your replies:---------------------------UPDATE ABOVE-----------------
Note: the -10 indicates to align-left and with 10 places.foreach (@unseen) { printf ("%-10s\t\t%-10s\n",$seen[$i],$unseen[$i]); $i--; }
I'm trying to have the output neatly in two columns but for some reason I am doing something wrong, because when there are no more files on the left side, the formatting screws up!
print "Email folder: $EMAIL_FLDR\n"; print "Spam:\t\tHam:\n"; foreach (@unseen) { print "$seen[$i]\t\t$unseen[$i]\n"; $i--; }
Small snippet of output: (notice the last two files)
Spam: Ham: ./50257_S ./36967_X ./27649_S ./mailtest.pl~ ./32894_S ./mailtest.pl ./71114_S ./rules ./54615_S ./22096_X ./41237_S ./56628_X ./1902_S ./2780_X ./50257_S ./87952_X ./90737_X ./51698_X
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Am i formatting correctly?
by Fletch (Bishop) on Aug 14, 2006 at 18:13 UTC | |
|
Re: Am i formatting correctly? (auto-sizing columns)
by ikegami (Patriarch) on Aug 14, 2006 at 18:54 UTC | |
|
Re: Am i formatting correctly?
by ady (Deacon) on Aug 14, 2006 at 18:19 UTC |