in reply to Re^4: Make $^V and "my" implicit
in thread Make $^V and "my" implicit
I was looking specifically at this line:
my @sorted = sort { ($a->{order} // 0) <=> ($b->{order} // 0) } @aoh;
In that case, || would indeed give the same result. The same goes if one were dealing with char data and used $foo || ''. Granted, in those cases the assignment would be redundant, but the warning would be avoided when the value in question is not defined. (Which ignores the question of whether or not it should be avoided since it might be an indication of working with bad data to begin with.)
That said, you and I can both point to cases where what you are saying would be true, especially in the case of char data and having '' (empty string) replaced by a non-empty default would be an error. But in my experience that is the exception to the general use-case and is not a serious problem to deal with.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Make $^V and "my" implicit
by ikegami (Patriarch) on Feb 05, 2014 at 18:29 UTC | |
|
Re^6: Make $^V and "my" implicit
by Tux (Canon) on Feb 04, 2014 at 08:11 UTC |