Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2018-02-23 18:48 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (307 votes). Check out past polls.