radriano has asked for the wisdom of the Perl Monks concerning the following question:

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");

Replies are listed 'Best First'.
Re: noob, need help
by Anonymous Monk on May 10, 2013 at 22:56 UTC
Re: noob, need help
by radriano (Initiate) on May 14, 2013 at 21:11 UTC
    hi, also I tried it on a fresh centos box. it did not accept the variables. Any configuration that I may have missed?