Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: import list

by chromatic (Archbishop)
on Jun 23, 2012 at 19:08 UTC ( #978002=note: print w/ replies, xml ) Need Help??


in reply to import list

perldoc perlop's Symbolic Unary Operators section explains this unary minus:

Unary "-" performs arithmetic negation if the operand is numeric, including any string that looks like a number. If the operand is an identifier, a string consisting of a minus sign concatenated with the identifier is returned.

In effect, it makes a bareword an unambiguous string constant. There's nothing special about this syntax when used in import lists (except that you'd have to write something like use English '-no_match_vars'; as an equivalent.)


Improve your skills with Modern Perl: the free book.


Comment on Re: import list
Select or Download Code
Replies are listed 'Best First'.
Re^2: import list
by GrandFather (Sage) on Jun 23, 2012 at 22:39 UTC

    Actually the - is just a character inside a qw() so it has no special meaning and no syntax beyond the fact that it isn't a white space character and isn't the closing character for the qw() applies.

    True laziness is hard work

      Yes, true.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://978002]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2015-07-29 01:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls