Hi guys. I have a question, just wondering bout it. JUst say I have a script called firstscript.pl #!/usr/bin/perl print "enter name\n"; $name = <STDIN>; How to pass $name paramter to another script. For example, my second script is called secondscript.pl #!/usr/bin/perl print "the name entered is $name\n"; Pls help guys.. Thank you.
Guys, I have solved the above problem. firstscript.pl #!/usr/bin/perl use CGI; print "enter name\n"; $name = <STDIN>; #system("./pass2.pl $name" == 0); #use pass2.pl (name); our($username) = ($name);do "pass2.pl"; secondscript.pl #!/usr/bin/perl print "the name enter was $username\n";
Now I have a problem, I user the same technique, but this time is not happening. Can u guys look through my code, and see whats the problem firstscript.cgi #!/usr/bin/perl use strict; use CGI; my $q = new CGI; my $name = $q->param( "name" ); my $password = $q->param( "password" ); my $pass = crypt($paswd,"password"); our($username,$paswd) = ($name,$pass);do "secondscript.cgi"; system("sudo su assistant"); secondscript.cgi #!/usr/bin/perl system("sudo /usr/sbin/useradd -m -p $paswd $username"); Since this is regarding creating username and etc, I have done some apache configuration and etc/sudoers configuration. pls help