in reply to Help in putting "$" as part of output

I took another look at your code. I took out the file opens so that that wouldn't clog up my directory. Here is the only part of the code that is "runnable". Your "for" loop works, but what the stuff above, presumably from the input file means is a mystery.
#!usr/bin/perl use warnings; use strict; # I have no idea what the input file (here __DATA__) is supposed # to mean and be used? print "*** no idea what this stuff means***\n"; while (<DATA>) ##I just print this stuff.... { print; } print "********\n"; print "\n\n"; my $head1='$contrl scftyp=rhf RUNTYP=energy coord=unique MULT=1 icharg +=0 $end'; my $head2="H 1 0.00 0.00 "; my $head3="H 1 0.00 0.00 "; my $head4="H 1 0.00 0.00 "; my $foot='$END'."\n"; for(my $R=0.05;$R<=10.50;$R=$R+0.05) { my $filename=sprintf("H4_Linear_RHF_%05.2f",$R); printf ("%s %05.2f %s", "Writing bond length", $R, "to file $file +name\n"); my $Rstring=sprintf("%.2f",$R); my $R1string=sprintf("%.2f",$R*2); my $R2string=sprintf("%.2f",$R*3); my $s= "$head1\n $head2 $Rstring\n $head3 $R1string\n $head4 $R2st +ring\n$foot"; print "$s"; } =EXAMPLE PRINTOUT.... This uses the POD (Plain Old Documentation) tags to "cheat" and add an example printout to the code. Of course this has to be before the __DATA__ segment. If there was no __DATA__ segment, then a simple "__END__" would work. *** no idea what this stuff means*** $contrl scftyp=rhf RUNTYP=energy coord=unique MULT=1 icharg=0 $end $system memory=8000000 $end $SYSTEM TIMLIM=600 MEMORY=200000 $END $BASIS EXTFIL=.T. GBASIS=full $END $Data H4 Linear RHF/aug-ccpvtz C1 H 1 0.00 0.0 0.00 H 1 0.00 0.0 2.88 H 1 0.00 0.0 5.76 H 1 0.00 0.0 8.64 $END ******** Writing bond length 00.05 to file H4_Linear_RHF_00.05 $contrl scftyp=rhf RUNTYP=energy coord=unique MULT=1 icharg=0 $end H 1 0.00 0.00 0.05 H 1 0.00 0.00 0.10 H 1 0.00 0.00 0.15 $END Writing bond length 00.10 to file H4_Linear_RHF_00.10 $contrl scftyp=rhf RUNTYP=energy coord=unique MULT=1 icharg=0 $end H 1 0.00 0.00 0.10 H 1 0.00 0.00 0.20 H 1 0.00 0.00 0.30 $END Writing bond length 00.15 to file H4_Linear_RHF_00.15 $contrl scftyp=rhf RUNTYP=energy coord=unique MULT=1 icharg=0 $end H 1 0.00 0.00 0.15 H 1 0.00 0.00 0.30 H 1 0.00 0.00 0.45 $END Writing bond length 00.20 to file H4_Linear_RHF_00.20 $contrl scftyp=rhf RUNTYP=energy coord=unique MULT=1 icharg=0 $end H 1 0.00 0.00 0.20 H 1 0.00 0.00 0.40 H 1 0.00 0.00 0.60 $END Writing bond length 00.25 to file H4_Linear_RHF_00.25 $contrl scftyp=rhf RUNTYP=energy coord=unique MULT=1 icharg=0 $end H 1 0.00 0.00 0.25 H 1 0.00 0.00 0.50 H 1 0.00 0.00 0.75 $END ... many lines deleted .... =cut __DATA__ $contrl scftyp=rhf RUNTYP=energy coord=unique MULT=1 icharg=0 $end $system memory=8000000 $end $SYSTEM TIMLIM=600 MEMORY=200000 $END $BASIS EXTFIL=.T. GBASIS=full $END $Data H4 Linear RHF/aug-ccpvtz C1 H 1 0.00 0.0 0.00 H 1 0.00 0.0 2.88 H 1 0.00 0.0 5.76 H 1 0.00 0.0 8.64 $END