Need help in perl scripting !!?

Hello i am new to perl scripting.
I would like to know how do we check the output of a system command using perl.
For example, if mysql is restarted i want to print success

————————————————-

#!/usr/bin/perl
print "Hello, Perl! \n";
$a=’service mysqld restart’;
if(system("$a")==1)
{
print "success";
}
else
{
print "failed";
}

————————————————

i have written a code but the condition checking…i got stuck…cud anyone help me please

All help much appreciated

Thanks in advance :)

perl ftp problem?

Hi ,
I tried to ftp a file to a server using perl. The file is transfered but the file size is o bytes.

Language : Perl
Ftp port : default 21

I used the put command to transfer the file.

$ftp->put("sample.txt")

Perl programming search and display help?

I need help with a command that will search a document for words ending in "ing" and print them. Any help would be appreciated :)
this is the file:

open (MYFILE, ‘in.txt’);

how to open a file in txt/html/xml format using a perl program?

I am trying to write a program using perl which will display the contents of a file in the same format as it is(i dont want to read the contents of the file on the command prompt)….and then ill search for the particular string in it but thats next part…first i want to

Perl Programming History?

Hi, what UNIX command was used to generate Perl name?