in reply to Reading DIR content and printing it
Note that neither opendir, readdir, nor File::Find will print the "contents" of the files, just the names thereof.#!/usr/bin/perl use strict; use warnings; my $dir = '/usr/lib/perl5/5.8.8/CGI'; @ARGV = $dir unless @ARGV; use File::Find; find sub { print $File::Find::name, -d && $dir, "\n" }, @ARGV;
|
|---|