<br><br><div class="gmail_quote">On Thu, Jan 14, 2010 at 9:07 AM, Michael R. Wolf <span dir="ltr"><<a href="mailto:michaelrwolf@att.net">michaelrwolf@att.net</a>></span> wrote:<br><br>> use strict;<br>> use warnings;<br>
> ...<br>> my $x => rand;<br>> die 'Did you notice fat comma instead of assignment? Variable did not > get<br>set' unless defined $x;<br><br>> In retrospect, what had me miss it was:<br>> 1 - the visual similarity between '=' and '=>'<br>
> 2 - the similarity of meaning between "gets" (assignment) and "gets<br>> associated with" (fat comma's common use in creating hash key/value > pairs)<br><br>> Can you think of a good use of fat comma (or skinny comma, for that<br>
> matter) in this context? Or, framed differently, why shouldn't (or can't) it<br>> get a warning like "Strange mixture of declaration, stringification, and<br>> function call in void context"?<br>
<br>I can't think of good use for fat/skinny comma in that context but<br>maybe a more devious mind is needed..<br><br>It does seem odd that rand (srand too) don't warn since other<br>arithmetic functions do:<br><br>
perl -wle 'my $x => sin'<br> Useless use of sin in void context ...<br> Use of uninitialized value $_ in sin ...<br><br> and similiar warnings for cos, exp, int, log ..<br><br>-- <br>Charles DeRykus<br><br>
<br></div>