Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 132
  • Last Modified:

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
0
txholdem
Asked:
txholdem
  • 5
  • 4
  • 3
1 Solution
 
shlomoyCommented:
which name is not recognized?

perl?
call?

0
 
txholdemAuthor Commented:
actually I just realize that it's the file path thats causing the problem. I did not use double back-slashes.
Thanks anyway.
0
 
txholdemAuthor Commented:
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.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

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

Thanks
0
 
shlomoyCommented:
> 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.
0
 
SapaCommented:
unlink eval {<$tmpdir\\*.out>};

or

unlink glob("$tmpdir\\*.out");

- Sapa
0
 
SapaCommented:
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
0
 
shlomoyCommented:
> 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.
0
 
SapaCommented:
"no t-shirt beyond 100k points anyway".

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

- Sapa
0
 
txholdemAuthor Commented:
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.
0
 
shlomoyCommented:
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 :-)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 5
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now