jsons has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl ##!/opt/gnu/bin/perl #/usr/local/bin/apache/cgi-bin/cadsearch.cgi #push(@INC,"/cgi-bin"); require "cgi-lib.pl"; use File::Find; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use Socket; &ReadParse(*input); $truck=$input{"truckno"}; #ex: 12345 $searchtype=$input{"searchtype"}; #ex: bid $dir=`/filesystem/scripts/find_dir_all.pl $truck $searchtype`; @dir=("$dir/$truck"); $file=$input{"filename"}; #set variable for new dwg convert web app $dwgpdf="http://webserver/dwgbpdf/"; #variable for hyperlink $hlink # finddepth function to locate directory for ($i=0;$i<=$#dir;$i++){ finddepth(\&dwgWanted,$dir[$i]); } # wanted sub to locate files sub dwgWanted{ $hlink="$File::Find::name" if (/^$file.*$ext2.*/ ); print $hlink }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using finddepth with part of directory name
by andyford (Curate) on Oct 19, 2007 at 20:14 UTC | |
by jsons (Initiate) on Oct 22, 2007 at 12:10 UTC |