Link to home
Start Free TrialLog in
Avatar of txholdem
txholdem

asked on

system(..)

In an NT DOS box, command "call a.bat args" works fine.
In a perl file (b.pl), I do
system("call a.bat args");
I get (perl b.pl):
The name specified is not recognized as internal external command...
How should I do this?

Thanks
Avatar of shlomoy
shlomoy

which name is not recognized?

perl?
call?

Avatar of txholdem

ASKER

actually I just realize that it's the file path thats causing the problem. I did not use double back-slashes.
Thanks anyway.
shlomoy,

I will credit the points if you would tell me how to do this is perl:

perl a.pl arg1 arg2 arg3
in a.pl, how do I obtain arg1, arg2, and arg3?

Thanks in advance.
$ARGV[0] is holding arg1
$ARGV[1] is holding arg2
$ARGV[2] is holding arg3
I already got the answer from another expert.
How about you tell me how to make this line work?

unlink <$tmpdir."\\*.out">;

Thanks
> I already got the answer from another expert.

Where?

> How about you tell me how to make this line work?

Are you toying with me?
You do ask a lot of questions for 30 lowsy points :-)


About the line
     unlink <$tmpdir."\\*.out">;


Here is the perldoc entry for unlink():


       unlink LIST

       unlink  Deletes a list of files.  Returns the number of
               files successfully deleted.

                   $cnt = unlink 'a', 'b', 'c';
                   unlink @goners;
                   unlink <*.bak>;

               Note: `unlink' will not delete directories unless
               you are superuser and the -U flag is supplied to
               Perl.  Even if these conditions are met, be warned
               that unlinking a directory can inflict damage on
               your filesystem.  Use `rmdir' instead.

               If LIST is omitted, uses `$_'.          


can you describe me what $tmpdir is?

I suppose that '\\' is something related to windows... right?

if the meaning of '\\' is another filesystem, than, as you can read from the perldoc entry, unlink will not work.
ASKER CERTIFIED SOLUTION
Avatar of Sapa
Sapa

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
to shlomoy:

what purpose you need these points for? I have 610 question points and don't know what to do with them, in any case I will never ask questions here :-))

- Sapa
> what purpose you need these points for? I have 610 question points and don't know what to do with them, in any case I will never ask questions here :-))

It's the principal...

And besides... no t-shirt beyond 100k points anyway - and I've passed the 100k points as it is, so you can be sure I get no reward from answering questions. Obviously I do it for fun.
"no t-shirt beyond 100k points anyway".

Re-register with new nickname and get t-shirts for every 5k points :-)

- Sapa
I am sorry, I have to give this one to Sapa..
(it should be unlink glob($tmpdir."\\*.out"); though)

Shlomoy,

I closed the question (another thread) on @ARGV earlier, since I was in a hurry. I actually deleted this thread afterwards.. I am not toying with you. Sorry.
ahhh... no point registering again, and sesides - they didn't even give me the 100k points t-shirt... :-(

I do this for fun.

txholdem, take it easy :-)