Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

barbie (2653)

barbie
  reversethis-{ku. ... m} {ta} {eibrab}
http://barbie.missbarbell.co.uk/

Leader of Birmingham.pm [pm.org] and a CPAN author [cpan.org]. Co-organised YAPC::Europe in 2006 and the 2009 QA Hackathon, responsible for the YAPC Conference Surveys [yapc-surveys.org] and the QA Hackathon [qa-hackathon.org] websites. Also the current caretaker for the CPAN Testers websites and data stores.

If you really want to find out more, buy me a Guinness ;)

Links:
Memoirs of a Roadie [missbarbell.co.uk]
[pm.org]
CPAN Testers Reports [cpantesters.org]
YAPC Conference Surveys [yapc-surveys.org]
QA Hackathon [qa-hackathon.org]

Journal of barbie (2653)

Tuesday October 08, 2002
11:16 AM

mini-CPAN on Windows

[ #8245 ]
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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I've seen /o used without variables before and it always looks odd to me, and I make sure I question the developer about it so that we both have a better understanding of why it ended up there. Was it just a "knee jerk" reaction - i.e. something you just always add to regexps because you once read it made them faster? Or was it an artifact of old code that is now removed? Or just a lack of understanding of what /o does? Or an honest mistake as you hurriedly made the code work?

    Either way, /o isn't required
    • 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.