It would make $bar-XX>method() safe if $bar is undefined, but what if $bar is a scalar? Or an unblessed reference? Or an array ref? or a coderef?
The poll question specifically states it's for attempting to call methods on undef. I'm fairly certain that it's not intended to gloss over attempts to call methods on arbitrary scalars and especially not on references of the incorrect type. Those should definitely remain errors.
Would the same operator work for fetching elements of array refs and or keys of hashrefs, or only for methods?
Interesting thought... It would make sense to me, at least, that if an arrayref/hashref is undef, then all of its elements are implicitly undef as well.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|