Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
my $self = shift; my $q = $self->query(); my $template = $self->load_tmpl("directory_tt.html"); my $dir = $q->param('dir') ? $q->param('dir') : 'c:/projects/p +ractice/dir'; my $parent_dir = $q->param('parent') ? $q->param('parent') : ' +c:/projects/practice/dir'; opendir(DIR, $dir) or die "cannot open dir $dir"; my (@dir, @files); while (defined(my $file = readdir(DIR))){ next if $file =~/^\./; my $full_path = "$dir/$file"; if (-d $full_path){ $file = "<IMG src=/icons/folder.gif> <a h +ref=readDir.pl?rm=displayFiles&dir=$full_path>$file</a>"; my %row = ( file => $file) +; push (@dir, \%row); } else{^M $file = qq|<IMG src=/icons/layout.png> + <a href="$full_path">$file</a>|; my %row = ( file => $file) +; push (@files, \%row); } } $template->param(parent=>$dir); $template->param(dir=>\@dir); $template->param(files => \@files); $template->param(dir_name=>$dir);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: href = file doesnt work within script
by duct_tape (Hermit) on Dec 24, 2003 at 16:06 UTC | |
by Anonymous Monk on Dec 24, 2003 at 16:13 UTC | |
by kutsu (Priest) on Dec 24, 2003 at 16:25 UTC | |
by Anonymous Monk on Dec 24, 2003 at 19:40 UTC | |
|
Re: href = file doesnt work within script
by kutsu (Priest) on Dec 24, 2003 at 16:01 UTC | |
|
Re: href = file doesnt work within script
by Anonymous Monk on Dec 24, 2003 at 15:41 UTC |