The first if Statement I am checking for Repeating characters such as "aa"
"%%"

In the second if statement I am that there are at least 2 non-alpha
characters in the first 8 letters.


I hope this explains it a bit better...

Again, Thanks in advance.

Scott

Some Questions

> -----Original Message-----
> From: Batchelor, Scott [mailto:[EMAIL PROTECTED]]
> Sent: 17 May 2002 17:40
> To: '[EMAIL PROTECTED]'
> Subject: Help please
> 
> 
> Can anyone tell me why the heck my if statements aren't 
> working in this
> subroutine.  Everything else seems to work fine.
> 
> Please excuse the debug code...

Have a flick through this and see if it helps.


#!perl

use strict;
use warnings;
my $pwmin = 2;
my $pwmax = 100;

pass_verify_syntax("hello");

sub 'pass_verify_syntax {
        print "Sub Called\n";
        my($p) = @_;
       print "$p"; 
        
        length($p) < $pwmin &&
        print "Password too short.  Minimum is $pwmin characters.\n";
  
        length($p) > $pwmax &&
        print "Password too long.  Maximum is $pwmax characters.\n";
   
        print "$p\n";
        if ($p =~ /([^a-zA-Z])\1/) {
                print "Password cannot contain repeating characters.($1)\n";
                 }
  
                 # I was unsure what you where doing here so I changed
                 # it 
                 #if ((substr($p, 0,6)) =~ tr/a-zA-Z//c<2){
                 #
                 #      die "is this working\n";
                 #}
                     # I changed it to this. What where you doing above?

                $p =~ tr/A-Za-z//c;        
                 
  foreach (unpack('C*', $p)) {
        my $char = pack("C", $_);
        my $pwchars = "abcdefghijklmnopqrstuvwxyz"; #&'log("verifying
character '$char'");
    
        if (index($pwchars, $char) == -1) {
      
                print "Password contains invalid character: '$char'\n";
    }
  }
  
  return 'ok';
}> 


****************************************************************************
*********
COLT Telecommunications
Registered in England No. 2452736
Registered Office: Bishopsgate Court, 4 Norton Folgate, London E1 6DQ
Tel. +44 20 7390 3900

This message is subject to and does not create or vary any contractual
relationship between COLT Telecommunications, its subsidiaries or 
affiliates ("COLT") and you. Internet communications are not secure
and therefore COLT does not accept legal responsibility for the
contents of this message.  Any view or opinions expressed are those of
the author. The message is intended for the addressee only and its
contents and any attached files are strictly confidential. If you have
received it in error, please telephone the number above. Thank you.
****************************************************************************
*********


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to