in reply to Re: What's the best way to avoid name collisions when creating files?
in thread What's the best way to avoid name collisions when creating files?

I concur. :)

You want a truly unique idenfier? "Universally Unique Identifier" pretty much describes it.
  • Comment on Re^2: What's the best way to avoid name collisions when creating files?

Replies are listed 'Best First'.
Re^3: What's the best way to avoid name collisions when creating files?
by philiph (Acolyte) on May 03, 2005 at 13:36 UTC
    Although Data::UUID looks like an interesting solution, one big annoyance for me is it doesn't come standard in my Perl distribution (Fedora Core 1).
      Unfortunately, RedHat is not the most pregressive distribution in the world. In fact, _most_ distributions contain only a pitiful amount of the CPAN modules that exist.

      There are 8000 CPAN packages. That is more than some distributions.

      PAUSE see updates for up to 50 packages a day. That is more than some distributions.

      Because of the sheer volume of packages, CPAN is to some degree a victim of it's own success. If a module isn't used by an application that has 100,000 users, its unlikely to end up being packaged simply because it would be unrealistic for distros to do them all. They'd simply swamp the package management system.

      In fact, I'd go so far as to say you arn't a "real" Perl programmer until you exceed the boundaries of the modules that are available on most distros.
        Certainly it's possible for me to use packages that don't come with the system. It's just difficult. This isn't just a home computer, it's part of a production network at a financial company. I first have to test the package on a spare system. Then I have to get approval from my boss. Then I have to schedule the install for off hours and perform it.

        Basically unless a CPAN module provides clearly necessary functionality, I'm going to try to avoid installing it. Thus while the UUID approach is interesting, I don't see enough in it to justify the work of getting that CPAN module installed, as opposed to trying other alternatives. For example, calculating md5 sums on the messages is much easier because that module comes with the Fedora perl installation.

      $ perl -MCPAN -e 'install Data::UUID'
      should do the trick. Don't be stupid and refuse to use the 7000+ distributions that don't come standard with Perl.

      The Perfect is the Enemy of the Good.

        Mixing CPAN installations with an RPM-managed system can be a pain in the rear. However, a quick google search found several perl-Data-UUID-*.rpm files available, so it's just a matter of installing it.

        If it wasn't already available, it's pretty easy to make a .src.rpm of most CPAN tarballs. Then rebuild the .rpm and install those on whatever machine farm you manage.

        --
        [ e d @ h a l l e y . c c ]