I had a play with Randal's script for creating a mini-cpan yesterday, [click here]. Unfortunately after creating the appropriate directories, and updating the script, I ran said script and joyfully watched as all these archives were successfully loaded into my mini-cpan. Then I watched in horror, when after over 2 hours later every single entry got deleted. Surely Randal couldn't have made such a silly mistake as to allow everything to be deleted?
Alas Randal had only tested on a UNIX box. Due to the inconsistent way File::Spec and Find::Find handle file paths on other operating systems, the whole script broke :(
I was going to see if I could write a patch, but after wading through the 2 modules, I felt it was far safer to amend the script. So if you want to run the script on a Windows box, add the following line between lines 69 and 70 in Randal's script:
$local_file =~ s|\\|/|g;
The moral of this story is be very careful if you're relying on portability when using File::Spec and Find::Find output together.
Update: fixed the regex.
Re:"o" for a variable
barbie on 2002-10-08T18:10:56
My misunderstanding. I didn't realise that it should just be use when variables are involved. I had wrongly assumed it should be applied to anything that should be compiled once.Something else I can now add to my beginner's guide to regexes
;) Thanks Matt.