in reply to Re^2: Globbing uncertainty
in thread Globbing uncertainty
For example, I've had trouble with ActiveState's glob vs BSD glob vs Posix glob and some pretty strange things have happened when my code wouldn't run on some other guy's windows box as a PerlApp.exe. Anyway haven been bitten a couple of times with cross platform weirdness, I am leery of glob(). Yes, to say open the file, you do indeed have to concatenate the $dirpath name. "$dirpath/$file". Lots of times I need to process the $filename (maybe update some serial number in it), which if full path, needs Basename or such to get the filename, or I need a more complex regex than what the simple glob() thing does or some other file test (like on modification date). Things like: Re: opening accented file names come up also.
Anyway, the OP now knows a couple of ways. And can choose the tool that best fits the job at hand. I certainly am not saving never use glob() or always use readdir(). Always and never are two words that don't fit with programming.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Globbing uncertainty
by Anonymous Monk on Nov 11, 2010 at 23:48 UTC |