I'm  trying to print the content of a variable only if it contains three
digits (1 2 3) and blank in between. Can anyone feature out why I don't
get the right result with both expressions?

@clean = split (/ +/, $clean);
 $arrlength = @clean;
 $cleanprint = join(" ", @clean);

##########################################################
# This does not yield the required result. 
 print INPUT ("$cleanprint") if  ($result = $cleanprint =~
/([\d]{1,2}])(\s)\1\2\1/);
 No output at all

###########################################################
#This does half-way. It prints any string that contains at least 2
digits. Why?
print INPUT ("$cleanprint") unless ($arrlength <  3);

Output looks like this:
1 2 3       # correct
3 5 9      # Correct
6 4         # Why does it print 2 digits?
###########################################################








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

Reply via email to