#!/usr/bin/perl ## Library import use Net::SSH::Expect; use strict; use warnings; use autodie; print "\n [INFO] script Execution Started \n"; my $ssh = Net::SSH::Expect->new (host => "ip addr", password=> 'pwd', user => 'username', raw_pty => 1); my $login_output = $ssh->login(); print "\n [INFO] add host rules \n"; open (ENABLE, "exec("config"); my $cmd = $ssh->exec("server www.google.com"); my $cmd = $ssh->exec("exit"); } close(ENABLE);