Did you cut-and-paste exact code, or did you retype the whole thing? Many of the lines of code you posted would never even compile.
- my = shift; - Huh? That's an error.
- unless ( -f "" )... - Testing if the empty string is a file?
- open(HTML, "<"); - Trying to open for input no file at all, and not checking to see if this phantom open even succeeded.
- if( sh=~/.... - what is 'sh'? Shouldn't you be testing against $_?
- return "" - return empty string if the match succeeded? Hmm...
- my ="/usr/local/.... - Shouldn't you be declaring a variable in there somewhere?
- my ="http://mattwork. - Again, where's the variable name?
- opendir(PRJD, ""); - Are you opening the empty-string directory?
- if(sh=~ /^\./)...</code> - What is 'sh'?
- unless( -d sh)... - What is 'sh'?
- my ="sh/index.html"; - Why are you still using 'my' without declaring a variable?
- my =Get_Title("") - Again, no variable.
- =~ s///i; - Bind s///i to nothing. Even if it were bound to something, it's substituting nothing for nothing. Huh?
If that's the code you downloaded, it's beyond repair.
My recommendation is to buy a copy of "Learning Perl", published by O'Reilly & Associates and read it thoroughly. Also read perlintro. And don't bother with this script, just start over once you've read those. If it were just one buggy line or two that would be different, but most of the lines of code you presented contain problems.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.