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

In reply to Re: Help in putting "$" as part of output by Marshall
in thread Help in putting "$" as part of output by arshadmehmood118

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.