sub ShellInput{ my $host = hostname; print "($host): "; chop(my $shell=); # Checks if use was used then read the argument: if($shell =~ /use/){ if ($shell =~ /use \s*(.+)$/) { my $module = $1; print "Module: $module \n"; ShellInput(); } } }