#!/usr/bin/perl push(@INC,"/data/htdocs/chemistry/cmp") ; require("cgi-lib.pl") ; &ReadParse ; $pattern = $in{'name'} ; # search for name that contains sname print &PrintHeader ; print "\n"; print "\n"; print "Molecular Properties\n" ; print "\n" ; print "\n" ; print "

$pattern

\n" ; open(CMP,"cmp.txt") || die "Can't find cmp.txt: $!\n"; while () { # treat the rest of @ARGV as filenames. if (/^$pattern\t/i) { # If the pattern matches... ($name,$C,$H,$N,$O,$Cl,$Br,$I,$S,$MW,$D,$ND,$BP,$MP,$W1,$AB1,$W2,$AB2,$W3,$AB3, $UVS,$UVRef,$PRef,$IRRef,$NMRRef,$MSRef,$MS1,$MS2,$MS3,$MS4,$CO,$AR,$HT,$QH) = split ; if ( $C != 0 ) { print " C$C" } ; if ( $H != 0 ) { print " H$H" } ; if ( $N != 0 ) { print " N$N" } ; if ( $O != 0 ) { print " O$O" } ; if ( $Cl != 0 ) { print " Cl$Cl" } ; if ( $Br != 0 ) { print " Br$Br" } ; if ( $I != 0 ) { print " I$I" } ; if ( $S != 0 ) { print " S$S" } ; print "___________________ M.W. $MW g/mol
\n" ; if ( $D != 999 && $D != 0 ) { print " density: $D g/mL
\n" } ; if ( $ND != 999 && $ND != 0 ) { print " index refraction, nD(20): $ND
\n" } ; if ( $BP != 999 && $BP != 0 ) { print " boiling point(760): $BP C
\n" } ; if ( $MP != 999 && $MP != 0 ) { print " melting point: $MP C
\n" } ; print "

\n"; if ( $W1 != 0 ) { print " UV wavelengths and molar absorptivities:
" ; print " $W1($AB1),$W2($AB2),$W3($AB3)
\n" ; $sl[1] = "methanol" ; $sl[2] = "cyclohexane" ; $sl[3] = "hexane" ; $sl[4] = "ethanol" ; $sl[5] = "water" ; $sl[6] = "chloroform" ; $sl[7] = "dioxane" ; print " UV solvent: $sl[$UVS]
\n" ; print " UV ref. $UVRef
\n" ; } print "

\n"; print " Properties Ref. $PRef
\n" ; print " IR ref. $IRRef
\n" ; print " NMR ref. $NMRRef
\n" ; print " Mass Spec. ref. $MSRef
\n" ; print "

\n"; print " Four biggest peaks in Mass Spec: $MS1,$MS2,$MS3,$MS4 m/e
\n" ; print "

\n"; print " Functional Types:
\n" ; if ( $CO == 1 ) { print " Carbonyl
\n" } ; if ( $AR == 1 ) { print " Aryl
\n" } ; if ( $QH == 1 ) { print " OH or NH
\n" } ; if ( $HT == 0 ) { print " no C-H protons
\n" } ; if ( $HT == 1 ) { print " saturated CH
\n" } ; if ( $HT == 2 ) { print " unstaurated CH
\n" } ; if ( $HT == 3 ) { print " both saturated and unsaturated CH
\n" } ; } } print "\n" ; print "\n" ;