&Chg_User ($other_user); #&Chg_Directory ($dir_location); … … … ## the sub_routines below sub Chg_User { #system("su -c ./script2.pl"); #from cdarke system("su -c 'perl script2.pl'"); #with changes #if ( $chg_result == -1) { # print "wrong password: $!\n"; # exit (-1); #} } sub Chg_Directory { system (“cd”, “$_[0]”); }