This will make @myarray = undef.
I suspect this is just a case of casual, imprecise language, but you are likely to mislead people with that particular phrasing:
my @myarray = undef;
print "\@myarray contains ", 0+@myarray, " elements.\n";
__END__
Produces:
@myarray contains 1 elements.
Because
@myarray = undef;
is the same as
@myarray = ( undef );
which isn't at all the same as
undef @myarray;
undef is a function that undefines what is passed to it and then returns a not-
defined()
scalar value.
-
tye
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.