Alexis Abril
Alexis Abril

Reputation: 6459

How do I get the output of a Perl script into a file from the DOS prompt?

I'm generating a large XML document via a Perl script in a command window, however, currently it's printing the document to standard out. The Perl script modifiers do not have a switch to allow to write to a file, so I'm curious how to take an input string and write to a file via the base command shell.

My current order of operations:

perl dtd2xsd.pl someBigSchema.dtd

The above returns the requested XSD contents, I'm just stuck on getting that into a file.

Upvotes: 0

Views: 537

Answers (1)

jamessan
jamessan

Reputation: 42667

Simply redirect the output to a file.

perl d2dxsd.pl someBigSchema.dtd > somefile.xsd

Upvotes: 7

Related Questions