convert a dos batch file into perl without using any modules.

K

king

The below mentioned thing is a dos batch file.
Can I write the whole thing in perl without using any modules like
file::compare, etc.



check32 pd k0018f00 > test.log
fc /l good1.log test.log > comp.log
find "no differences encountered" comp.log
if errorlevel 1 goto end
echo Passed test.
del test.log
del comp.log
check32 pd k0018090 > test.log
fc /l good2.log test.log > comp.log
find "no differences encountered" comp.log
if errorlevel 1 goto end
echo Passed test.
del test.log
del comp.log
check32 pd k0018088 > test.log
fc /l good3.log test.log > comp.log
find "no differences encountered" comp.log
if errorlevel 1 goto end
echo Passed test.
del test.log
del comp.log
check32 pd k0018170 > test.log
fc /l good4.log test.log > comp.log
find "no differences encountered" comp.log
if errorlevel 1 goto end
echo Passed test.
del test.log
del comp.log
 
B

Ben Morrow

Quoth "king said:
The below mentioned thing is a dos batch file.
Can I write the whole thing in perl without using any modules like
file::compare, etc.

check32 pd k0018f00 > test.log
fc /l good1.log test.log > comp.log
find "no differences encountered" comp.log
if errorlevel 1 goto end
echo Passed test.
<more of the same>

I don't know. What do fc and check32 do? (I presume find finds a string
in a file (what I'd call fgrep) rather than doing what Unix find(1)
does?).

You almost certainly can. Why do you not want to use modules? That is a
very stupid restriction to place on yourself. It's like saying you want
to be able to type with only one finger.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top