Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: $scalar => 'WTF?';

by BrowserUk (Pope)
on Sep 07, 2011 at 00:49 UTC ( #924494=note: print w/ replies, xml ) Need Help??


in reply to $scalar => 'WTF?';

If you enabled warnings, you should have seen:

Useless use of a constant in void context at ...

What you coded is exactly the same as:

my $x, 3;

Which in turn is equivalent to:

my $x; 3;

You declared but did not initialise $x and put a constant in a void context.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: $scalar => 'WTF?';
by {}think (Acolyte) on Sep 07, 2011 at 01:05 UTC
    I remember now, that => is simply a syntactical equivalent of the comma operator! This makes sense! Thanks
    {}think; #Think outside of the brackets

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2016-07-23 19:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (221 votes). Check out past polls.