ashutoshinbox has asked for the wisdom of the Perl Monks concerning the following question:
when ever i am trying to get it to an array using FH, its making the output to ugly, i mean is there anyway i can make it looks good, as we are getting true value/output at command file, i mean apropriate space and lines. . . . sorry for making earlier description skeptical, actually i want some thing like, all line and column will contain exact value, likehere i am forwarding process status to a file "process", 'ps -ef >process'(this is done by a cron job at every day) here is part my perl code my $uxinfo = "process"; open(INFO, $uxinfo); @uinfo = <INFO>; foreach my $line (@uinfo) { chomp($line); next if ($line eq "" ); print "$line";}} }
but in the output all these things are messing up like following:#ps -ef UID PID PPID C STIME TTY TIME CMD root 1 0 0 2007 ? 00:00:02 init [3] root 2 1 0 2007 ? 00:01:34 [gration/0] root 3 1 0 2007 ? 00:00:01
i want exact value should be in exact column!! thanks to all for your quick feedbacks..UID PID PPID C STIME TTY TIME CMD root 1 0 0 2007 ? 00:00:02 init [3] root 2 1 0 2007 ? 00:01:34 [gration/0] root 3 1 0 2007 ? 00:00:01
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Text format array
by toolic (Bishop) on Jan 17, 2008 at 13:47 UTC | |
|
Re: Text format array
by moritz (Cardinal) on Jan 17, 2008 at 13:42 UTC | |
by ashutoshinbox (Initiate) on Jan 17, 2008 at 14:02 UTC | |
|
Re: Text format array
by roboticus (Chancellor) on Jan 17, 2008 at 14:50 UTC | |
|
Re: Text format array
by KurtSchwind (Chaplain) on Jan 17, 2008 at 16:32 UTC | |
|
Re: Text format array
by chaos_cat (Scribe) on Jan 17, 2008 at 13:50 UTC |