in reply to mkdir with a list variable
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: mkdir with a list variable
by casiano (Pilgrim) on Mar 04, 2008 at 12:17 UTC | |
|
Re^2: mkdir with a list variable
by tirwhan (Abbot) on Mar 04, 2008 at 12:18 UTC | |
by Corion (Patriarch) on Mar 04, 2008 at 12:29 UTC |