At 5:38 PM +0530 11/13/09, Subhashini wrote:
#!/usr/bin/perl
use strict;
print "ENTER THE WORD IN ENGLISH";
print "\n";
$english=<STDIN>;
print "word =====";
print "$english";
print "\n";
print "***********************************   FRENCH -TO - ENGLISH -
TRANSLATION    ************************************************";
system ("dict -d fd-eng-fra $english > /tmp/myoutput");
~

~

It stil doesn't work


What happens? Do you get an error message? Does the file get created? Is the file empty? Do you get any output on your screen?

What happens when you execute the line

     dict -d fd-eng-fra potato > /tmp/myoutput

from a command-line prompt in a shell session? Does the file /tmp/myoutput get created? Do you see any output on your screen?

Try this in your Perl program:

    my $translation = qx(dict -d fd-eng-fra $english);

The standard output of the dict program will be captured and assigned to the $translation variable.


--
Jim Gibson
j...@gibson.org

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to