3 ms·
`open my $fh, '-|', 'ls', '-l', $dir` should do the trick I think, but apparently it only works on platforms with a "real fork" (so fine as long as you don't ca
by arnsholt 5y ago
`open my $fh, '-|', 'ls', '-l', $dir` should do the trick I think, but apparently it only works on platforms with a "real fork" (so fine as long as you don't care about Windows, probably).
- dale_glass 5y agoIt does, but it's not convenient. You need a loop, perhaps deal with $/, close it at the end. I'm not saying it can't be done, just that the language is oddly lacking in convenience for this use case.
- dolmen 5y ago$dir = '-r'; You loose.