Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: what is the meaning of ();

by martin (Friar)
on Jul 25, 2008 at 23:23 UTC ( #700251=note: print w/replies, xml ) Need Help??

in reply to what is the meaning of ();

The array @incdirs is defined as a lexically scoped variable and initialized to be empty. The empty pair of parentheses mean an empty list here. Lexically scoped means this variable is visible only in the block where it is defined.

Replies are listed 'Best First'.
Re^2: what is the meaning of ();
by Anonymous Monk on Jul 25, 2008 at 23:34 UTC
    Thanks Martin!

      Note that, as runrig implied, the = () is redundant. Arrays and hashes start out life empty - there is no need to explicitly empty them. Scalars on the other hand start out with the value undef. It is common to declare and initialise scalars at the same time and to do so immediately before the scalar's value is first used where possible (to reduce scope of the variable to a minimum).

      Perl reduces RSI - it saves typing

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://700251]
[Corion]: Weird. HTML::Selector:: XPath is on v0.22 on but v0.20 on - I wonder what part of the pipeline I have to kick; most likely the metacpan indexer...
[LanX]: ♪..♫ I shot pmdev, but I didn't shoot no janitor ...♩..♬

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2017-03-23 13:48 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (286 votes). Check out past polls.