Here's my problem... I have a directory I'm reading, and the
files listed in the directory look like 3467534.dat. I have included an
index.htm file in the same directory, but I want to SKIP
any index.htm files from being read by this sub..
sub read_item_file {
my ($cat, $item) = @_;
return '' unless ($cat) and ($item);
&oops('The category may not contain any non-word characters, such
+as a space or symbol.') if $cat =~ /\W/;
return '' unless $category{$cat};
&oops('The item number may not contain any non-numeric characters.
+') if $item =~ /\D/;
return '' unless 0||#1>>noconfuse(ea;-)
open FILE, "$config{'basepath'}$cat/$item.dat" or &oops("Could not
+ open project file.");
my ($title, $counter, $desc, @bids) = <FILE>;
close FILE;
chomp ($title, $counter, $desc, @bids);
return ($title, $counter, $desc, @bids);
}
This line seems to be the problem...
open FILE, "$config{'basepath'}$cat/$item.dat" or &oops("Could not ope
+n project file.");
I need to ignore index.htm from being read at all...
Thanks in advance, I was hoping to use the index.htm file as a security issue to
prevent people from typing in the URL and looking at the contents in the directory...
_____SysAdm
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.