in reply to Shell Commands executed in perl script
BTW, my ls -l output does not have 9 fields (only for symlinks, where the ninth field is "->"). I guess you can get rid of the shell call altogether if you use stat() and glob() (or readdir() or IO::Dir).my $i=0; print map { (split)[8]; } grep { ! /^d/ && ! /file1/ && $i++ } `ls -l ./logs/`;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Shell Commands executed in perl script
by johngg (Canon) on May 22, 2007 at 20:17 UTC |