#!/usr/bin/perl use strict; use warnings; use File::Listing qw(parse_dir); use IPC::System::Simple qw(capture); my(@dirs) = '/root'; my $cmd = capture("ls -a"); @dirs = map( { my ( $name, $type, $size, $mtime ) = @$_; $type eq 'd' ? $name : () } parse_dir($cmd) ); print $cmd;
In reply to Re: How to efficiently parse "ls -a"?
by Khen1950fx
in thread How to efficiently parse "ls -a"?
by isync
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |