seeking the wisdom of the perl. hi monks, please help out. i was able to run this with CENTOS but not with FreeBSD. somehow it does not want to accept the variables (atleast for the configuration part) but it does print it out OK in the HTML part.
#!/usr/bin/perl use strict; use CGI qw(:standard escapeHTML); # #decalare varialbes # my $line1= param('Line1'); my $line2= param('Line2'); my $MAC= param('MAC_Addr'); # #Print HTML to allow user to check their work # print header(), start_html, p (tt(escapeHTML($line1))),p (tt(escapeHTML($line2))),p (tt(escapeHTML +($MAC))); # #Open Text file and name it the MAC address based on user input, then +assign variables to provisioning fields in config file for ATA # open CONFIG, ">/usr/local/www/apache22/cgi-bin/data/$MAC.txt" or die $!; # #Line 1 provisioning information and formatting for config file. # print CONFIG 'Display_Name1 '; print CONFIG "\"$line1\"\;\n"; print CONFIG 'User_ID[1] '; print CONFIG "\"$line1\"\;\n"; print CONFIG 'Password[1] '; print CONFIG "\"$line1\"\;\n"; print CONFIG 'Use_Auth_ID[1] "Yes";'; print CONFIG "\n"; print CONFIG 'Auth_ID[1] '; print CONFIG "\"$line1\"\;\n"; # #Line 2 Provisioning information and formatting for config file. # print CONFIG 'Display_Name2 '; print CONFIG "\"$line2\"\;\n"; print CONFIG 'User_ID[2] '; print CONFIG "\"$line2\"\;\n"; print CONFIG 'Password[2] '; print CONFIG "\"$line2\"\;\n"; print CONFIG 'Use_Auth_ID[2] "Yes";'; print CONFIG "\n"; print CONFIG 'Auth_ID[2] '; print CONFIG "\"$line2\"\;\n"; # #close file for editing # close CONFIG; # #need to generate config file using Cisco's tool, which is stored in / +usr/sbin/ as spc.bin # system("/usr/sbin/spc.bin /usr/local/www/apache22/cgi-bin/data/$MAC.tx +t /usr/local/www/apache22/cgi-bin/data/$MAC.cfg"); pcystem("/usr/sbin/cp_conf.sh");

In reply to noob, need help by radriano

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.