mkdir has a prototype of $;$:
perl -we "print prototype('CORE::mkdir')"
$;$
This means that the first variable in the call to it will be put into scalar context. Most likely, you have now a subdirectory named "2" in ~/LGRID_Machine/examples, because @a evaluated to the number of elements (2).
To solve your larger problem of calling arbitrary builtins with the appropriate parameters, I think you will have to explicitly pass the parameters:
mkdir $a[0], $a[1];
instead of
mkdir @a;
Creating the appropriate calls can maybe be done by inspecting prototype("CORE::$function"), but some functions (like print) don't even have a prototype because they are super special.
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.