Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replacing batch files with PERL

Status
Not open for further replies.

bazcurtis

Technical User
Jul 11, 2001
134
GB
Hi,

I am trying to rewrite some of my batch files to PERL scripts. I am new PERL and not doing to bad so far :)

I am now at the point where I need to use dos commands, such as 'net use', 'net start'. How do I tell PERL to call these system commands?

I also want to compare two files. Can I still use FC or does PERL have its own?

Any help most welcome.

Best wishes

Michael
 
To shell out system commands, there are two options:
1) Use the system keyword. ex: system ("command");
2) Use backticks (`). ex: `command`;

As for file compare, there are several perl modules for file comparison. What specifically do you use FC for?
 
Thanks for that Tom.

I use FC to compare the size of two zip files and if they are not the same uncompress the new one and install the files from that file. I usually use /l switch.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top