On Wed, Mar 25, 2009 at 05:57:45PM -0700, Bill Ward wrote: > I'm not really liking any of the names that have been proposed so I'm going > back to the original message to give my thoughts. > > The "English" name of $^O is $OSNAME, so there's precedent for OS. I think > it should use OS and not something like System.
That doesn't really narrow it down ;) ByOS PerOS ForOS OSSpecific OSMagic MagicOS ... > As for where to put it, the way this would be useful to me would not be as > any sort of object (which rules out Class::) but as a sort of assertion or > query about the operating system. You wouldn't need to instantiate any > objects of this class, it would just be for asking "what OS am I running > on?" so OO is really not needed except maybe for some @ISA magic. This isn't about yes/no assertions. This is about always providing _an_ implementation of some code, but possibly providing a better one on some OS if it can be done. An actual example: Linux has pselect() and ppoll(), which allow safe mixed IO-and-signal handling. Portably these don't exist. A Linux implementation of IO::Async::Loop could use these to mix file IO and signals safely; a portable base can't, so would have to "make do" with something less. > use OS has_symlinks; # would fail under Windows > use OS::linux; # would fail under any non-Linux OS That's not at all where I'm aiming here... > What specific OS-related questions do you want this for? Obviously not > filesystem naming rules... IT's the magic used to allow another class to provide per-OS customisations. E.g. see my IO::Async example above :) -- Paul "LeoNerd" Evans leon...@leonerd.org.uk | CPAN ID: PEVANS
signature.asc
Description: Digital signature