On Mon, Mar 24, 2008 at 8:33 AM, <[EMAIL PROTECTED]> wrote:
> No it is not a homework. It's a official script which I want to make it
> into production???
snip
> > Diff /tmp/dev_path_PRS.DB.01.12.000 /tmp/dep_path_D.PRS.DB.01.12.000.8
snip
Diff is not a Perl command; however, there is a diff (note the
lowercase d) in UNIX. If you are having problems with UNIX commands
you should ask your questions in a UNIX forum. You can run external
commands (like diff) from inside of Perl in a number of ways. The
ways most likely to be useful are qx// and open:
my @output = qx/diff /tmp/dev_path_PRS.DB.01.12.000
/tmp/dep_path_D.PRS.DB.01.12.000.8/;
or
open my $fh, "-|", "diff /tmp/dev_path_PRS.DB.01.12.000
/tmp/dep_path_D.PRS.DB.01.12.000.8/"
or die "could not execute diff: $!";
while (<$fh>) {
#do something with a line from the output of diff
}
--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/