defined &

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kardon33
    New Member
    • May 2007
    • 158

    defined &

    Could you explain this code it would realy help thank you.

    unless(defined( &_ARTNET_H_) ) {
    eval 'sub OpPoll () {0x2000;}' unless defined(&OpPoll );
    }
  • miller
    Recognized Expert Top Contributor
    • Oct 2006
    • 1086

    #2
    Hello kardon,

    The best place to learn about this is to just read perldoc.

    perldoc defined

    I don't know the specifics of what this is aiming to accomplish. However, a literal translation is if the subroutine _ARTNET_H_ is undefined, define a new subroutine OpPoll() to the value 0x2000. Why they are wanting to do this, I can't say. But this is the type of thing that you often see in modules that are attempting to work in more than work environment. Say Mac, Windows, Unix, etc.

    - Miller

    Comment

    Working...