Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 (Sexton) 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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2017-06-24 08:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (557 votes). Check out past polls.