Ro has asked for the wisdom of the Perl Monks concerning the following question:
# i have all the correct headers use filefind, /opt/bin/perl bla bla $jscriptdir = "/home/javascript/"; $output = "/home/web/foo/index.htm"; $reading = "/home/javascript/jumper.js"; # Open file, match comment string, write to html open(JS,"<$reading") or die "Can't Open $reading: $!"; open(NEW,">$output") or die "Can't Open $output: $!"; print NEW "<html><title>Comment Extractor</title></html>\n"; print NEW "<body>\n"; print NEW "<h1>Comment Extractor</h1>\n"; print NEW "<hr>\n"; $script_title = rindex($reading, "/"); print NEW substr($reading, $script_title+1); while (<JS>) { if ($_ =~ /\*\*/) { print NEW substr($_,4) . "<br>"; } } print NEW "</body></html>\n"; close NEW; close JS;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Find, read, write out contents of a certain file type recursively...
by gjb (Vicar) on Nov 14, 2002 at 19:44 UTC | |
|
Re: Find, read, write out contents of a certain file type recursively...
by jdporter (Paladin) on Nov 14, 2002 at 20:01 UTC | |
|
Re: Find, read, write out contents of a certain file type recursively...
by Ro (Initiate) on Nov 14, 2002 at 20:21 UTC | |
by graff (Chancellor) on Nov 15, 2002 at 05:13 UTC | |
|
Re: Find, read, write out contents of a certain file type recursively...
by dingus (Friar) on Nov 15, 2002 at 09:20 UTC |