I was trying to execute the followin perl code snipet on a Windows XP system. I used 
chomp to trim the trailing spaces, new line character and carriage return. But chomp 
does not trim carriage return ('\r') character, due to which the code does not come 
out of the loop.

while( $pass1 eq "" || $pass1 !~ /^[a-zA-Z0-9-_]{3,16}$/ ) {
        print "Enter a password for the administrator account: ";
        $pass1 = <STDIN>;
        chomp $pass1;
        if(! $pass1 ) {
          print "\n\nIt's just plain stupid to not have a password.  Try again!\n";
        } elsif ( $pass1 !~ /^.{3,16}$/ ) {
          print "The password must be 3-16 characters in length.";
        }
}

Is there a way to chomp carriage return character.

Regards
Manjula

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to