casiano has asked for the wisdom of the Perl Monks concerning the following question:
I can't understand the behavior of mkdir. When called mkdir(@a) it does not work. This seem to be different when using a scalar variable mkdir($a) or a constant argument mkdir('dir'). See the following session with the debugger:
pp2@nereida:~/LGRID_Machine/examples$ perl -wde 0 main::(-e:1): 0 DB<1> @a = ('/tmp/DIRECT', 18) DB<2> x @a 0 '/tmp/DIRECT' 1 18 DB<3> x mkdir(@a) # seems ok 0 1 DB<4> !!ls -ltr /tmp/DIRECT # ... but no: ls: /tmp/DIRECT: No existe el fichero o el directorio (Command exited 2) DB<5> x mkdir('/tmp/DIRECT', 18) # try without a var 0 1 DB<6> !!ls -ltrd /tmp/DIRECT # now it works! d--------- 2 pp2 pp2 4096 2008-03-04 11:43 /tmp/DIRECT DB<7> q
Many thanks
Casiano
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: mkdir with a list variable
by Corion (Patriarch) on Mar 04, 2008 at 12:05 UTC | |
by casiano (Pilgrim) on Mar 04, 2008 at 12:17 UTC | |
by tirwhan (Abbot) on Mar 04, 2008 at 12:18 UTC | |
by Corion (Patriarch) on Mar 04, 2008 at 12:29 UTC | |
|
Re: mkdir with a list variable
by Tanktalus (Canon) on Mar 04, 2008 at 17:10 UTC |