Remote Login error in Perl

Hi,

This is in PERL.

I am trying to remotely login to a server to access and grep a log file.

This is what I have defined in my Hash

%servers = ('box1' => 'userid1', 'box2' => 'userid2',
                 'box3' => 'userid3', 'box4' => 'userid4');
 
%log     = ('box1' =>  '/abc1/xyz1/log', 'box2' =>  '/abc2/xyz2/log',
               'box3' =>  '/abc3/xyz3/log', 'box4' =>  '/abc4/xyz4/log'); 

Now I execute the following command

$output=`remsh $m -l $servers{$m} "ls -l $log {$m}/print_*$year$month$day*" `;

and I get " remshd: Login incorrect" message.

I tried different id's and passwords that I can use and it still is the same.

Question :- Is the syntax correct (no compile errors though) and How do I code the statement correctly?

Running out Ideas here.

Thanks

Do you have your rsh configured properly on all these boxes? i.e., if you run the following command on your command line:

> remsh box1 -l userid1 ls

It should show you the listing of home directory for userid1 on box1.