$|++; # aktiviert Autoflush fuer STDOUT use FindBin (); use lib "$FindBin::Bin"; use strict; use warnings; use XML::Twig; use Term::ANSIColor qw(:constants); my $instance_number=&instance_number; my $sid=&sid; print "\n\t the sid is: $sid \n"; print "\n\t the sid is: $instance_number \n"; ############################################################################### # ask instance number sub instance_number { my $instance_number =""; my $my_length =""; do { print "\nPlease enter the instance number:\n"; $instance_number = ; chomp $instance_number; $my_length = length ($instance_number); } until( ($my_length = 2)==($instance_number= ~/^\d+/) ); return $instance_number; } ############################################################################### # ask install SID sub sid { my $SID =""; my $sid =""; my $my_length =""; do { print "\nPlease enter the SID: 4"; $sid = ; print "\n\n"; chomp $sid; $SID = uc $sid; $my_length = length ($SID); #print $my_length; } until( ($my_length == 3) ); return $SID; }