Hi everyone, I am new to perl and here is my problem. I have two files. First one is perl script which is reading a text file and parsing some important values and putting into an array for future use. Second file is skill.il which is a Cadence framework file that do some random stuff, I need values from perl script and want to use those values in my skill.il. So I was doing this. I was trying to create a new file(skill.il) and printing out all the lines and commands into this file. For an example I need these lines in my new skill.il file:

libName = "cmos28shp" ; device library name tech_lib = "cmos28shp" techFileID = techOpenTechFile( "cmos28shp" "tech.db" "r") lib = ddGetObj(libName) ;; Verify the library exista +nce if(lib == nil then fprintf(stderr "ERROR: Invalid library. %L .\n" libName) return(nil) else
So I was doing this in perl:
my $outfile = "skillfile.il"; open FH, ">> $outfile"; print FH "libName = "cmos28shp"\n"; print FH 'tech_lib = "cmos28shp"'; close FH;
I am not sure if it's a right way to generate this file, I am also getting errors like these :
Bareword found where operator expected at testfile.pl line 12, near "" +libName = "cmos28shp" (Missing operator before cmos28shp?) String found where operator expected at testfile.pl line 12, near "cmo +s28shp"\n"" syntax error at testfile.pl line 12, near ""libName = "cmos28shp" BEGIN not safe after errors--compilation aborted at testfile.pl line 1 +9.
So I hope if you can show me some direction and suggest me how can I fix this. Thanks


In reply to Creating a file by using perl by freekngeek

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.