|
From: Dave C. <da...@da...> - 2002-02-08 07:43:28
|
On Thu, Feb 07, 2002 at 04:28:08PM -0500, Joseph F. Ryan (rya...@os...) wrote: > I also mentioned it in an upcoming article for A List Apart (upcoming > meaning tomorrow). You can take an early peak at it here: > > http://www.alistapart.com/stories/perl/ That looks great. I hope you don't mind if I make a couple of comments on your code :) * Personally, I'd have broken the "find" sub out into a real subroutine. The idea of anonymous subs might be a little weird for your target audience. * Just doing "undef $/" like that is bad practice. You should never change one of Perl's special variables without "local"ising the change. In this case it doesn't matter, but people may cut and past your oode into other scripts. In this example, the perfect place to localise the change is in the "find" sub. I'd do "local $/ = undef" (or even just "local $/" which does the same thing. * You call "stat" in void context. Doesn't that give you an error? In any case, it's not achieving anything useful. * Do the links in the results list work? Looks to me like you're using file paths, not URLs. This may work in your specific circumstances, but it won't in the general case. Hope this is useful, Dave... -- .sig missing... |