It's really much easier than you think.
#!/usr/bin/perl -w use diagnostics ; use strict ; open (DIR, '>> c:\dir\dir.txt') || die "Can't open file; $!" ; print DIR $_ foreach `dir *.pl`; close DIR;
Update: Removed unnecessary comma from print statement.
--
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
In reply to Re: Getting the output of a shell command
by davorg
in thread Getting the output of a shell command
by ellem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |