in reply to Getting the output of a shell command
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Getting the output of a shell command
by ellem (Hermit) on Jun 04, 2001 at 22:08 UTC |