In a message dated Mon, 7 Jan 2008, Larry Wall writes:
On Mon, Jan 07, 2008 at 11:42:06AM -0500, Trey Harris wrote:
So $?OS isn't "the type of OS", it's *the OS*, and you can manipulate the
OS through it.


Note that $?OS is the OS that is-or-was running at compile time,
whereas $*OS is the OS running right now (at run time).  Those don't
have to be the same, especially for modules distributed in some kind
of universal bytecodeish format.

Understood. My earlier suggestions apply to $*OS and $*OSVER as well though.

That is, $?OS is a compile-time constant, while $*OS is a variable. In fact, if someone invents a way for a process to freeze and restore the execution context in a different place, $*OS could change more than once.

Good point. So you wouldn't want to assign a static behavior to my &trytolink example; instead you'd probably want to do

  Role BestEffortLinkAble {
      method trytolink ($old, $new) { ... }
  }

And mix the role in to $*OS. Then call $*OS.trytolink() to get the proper behavior at the proper time.

Trey

Reply via email to