#!/usr/bin/perl 
use strict;
open FILE1, ">>script.pml" or die "cant open number";	
print FILE1 "hide all \n";
print FILE1 "bg_color white \n";
print FILE1 "show ribbon, chain a+d \n";
print FILE1 "set transparency, 0.3 \n";
print FILE1 "set surface_quality, 1 \n";
open FILE2, "clud.txt" or die "cant kol2";					
while (my $line = <FILE2>)
			{
					
					while($line=~m/(\d+)\s+(\w+)\s+(\d+)\s+(\w)\t(\w{2}\d{0,1})\s+/g) 
					{	
						if($1==2){
						print FILE1 "show surface, $4/$2`$3/$5 \n";
						print FILE1 "set surface_color, red, $4/$2`$3/$5 \n";			
								}
						if($1==3){
						print FILE1 "show surface, $4/$2`$3/$5 \n";
						print FILE1 "set surface_color, yellow, $4/$2`$3/$5 \n";			
								}
						if($1==11){
						print FILE1 "show surface, $4/$2`$3/$5 \n";
						print FILE1 "set surface_color, green, $4/$2`$3/$5 \n";			
								}
						if($1==12){
						print FILE1 "show surface, $4/$2`$3/$5 \n";
						print FILE1 "set surface_color, blue, $4/$2`$3/$5 \n";			
								}
						if($1==14){
						print FILE1 "show surface, $4/$2`$3/$5 \n";
						print FILE1 "set surface_color, orange, $4/$2`$3/$5 \n";			
								}
						
					}
				
			}
