Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
I have installed CGI::Session module but still i am getting error with this module. I have even checked by restarting the computer. Some body please guide me.
Code:
[root@localhost cgi]# yum install perl CGI::Session
Loaded plugins: langpacks, refresh-packagekit
Package 4:perl-5.18.4-290.fc20.x86_64 already installed and latest version
No package CGI::Session available.
Nothing to do
[root@localhost cgi]# cat adminform2.pl
#!/usr/bin/perl
#NOTE This code has got prolem with session management
use CGI qw(:standard);
use CGI::Session;
use DBI;
my $ID;
my $Name;
my $Phone;
use CGI;
use CGI::Session;
$cgi = new CGI;
my $session = new CGI::Session(undef, $cgi, {Directory=>'/tmp'});
#$cookie = $cgi->cookie(CGISESSID => $session->id );
#print $cgi->header(-cookie=>$cookie);
print "Content-type: text/html\n\n";
print <<HTML_PAGE;
<html>
<head>
<title>Admin Page: Display Records,Edit, Delete and Insert</title>
</head>
<body>
<FORM method="post" action="/cgi-bin/insertbyAdmin.pl">
<TABLE BORDER ="0">
<TR>
<TD>Name</TD>
<TD><input type="text" name="Name" value=""></TD>
</TR>
<TR>
<TD>Phone </TD>
<TD><input type="text" name="Phone" value=""></TD>
</TR>
<TR>
<TD><h1>Insert Next Record: Select Yes or No</h1></TD></TR>
<TR>
<TD><li> <INPUT TYPE="radio" NAME="Yes" value="Yes" unchecked> Yes </TD>
</TR>
<TR>
<TD><li> <INPUT TYPE="radio" NAME="No" value="No.Return to Login" unchecked> No </TD>
</TR>
<TR><TD COLSPAN="2" ALIGN="RIGHT">
<input type="submit" name="submit" value="insertNext">
</TD></TR></TABLE></FORM>
#$ID = $cgi->param( 'ID' ) || '';
$Name = $cgi->param ('Name') || '';
$Phone = $cgi->param( 'Phone' ) || '';
$session->param(name1, $Name);
$session->param(Phone1, $Phone);
#$session->param(semester_, $semester);
<form method ="post" action="/cgi-bin/radioeditordelete.pl">
<TABLE BORDER ="0">
<TR><TD><input type="submit" name="EditDelete" value="EditDeleteRecord"> </TD></TR>
<TD><li> <INPUT TYPE="radio" NAME="EditDelete" value="Edit" unchecked> Edit </TD>
<TD> ID: </TD>
<TD> <input type="text" name="ID1" value=""></TD>
</TR>
<TR>
<TD><li> <INPUT TYPE="radio" NAME="EditDelete" value="Delete" unchecked> Delete</TD>
<TD> ID: </TD>
<TD> <input type="text" name="ID1" value=""></TD>
</TR>
</TABLE></FORM>
HTML_PAGE
$dbh = DBI->connect("dbi:mysql:test", 'root','') or die "Unable to connect: $DBI::errstr\n";
## query the database
$sth = $dbh->prepare("SELECT * FROM samples");
$sth->execute();
print <<HTML_PAGE;
<table>
<tr>
<th>ID</th>
<th>Name</th>
<th>Phone</th>
</tr>
HTML_PAGE
while($row = $sth->fetchrow_hashref) {
#$first_name = chop($row->{first_name});
#$surname= chop($row->{surname});
#$email = cho($row->{email});
#print "<tr><td>" . $first_name . "</td> </tr> ";
#print "<tr><td>" . $surname . "</td> </tr> ";
#print "<tr><td>" . $email . "</td></tr> ";
print "<td>$row->{ID}</td> ";
print "<td>$row->{Name}</td> ";
print "<td>$row->{Phone}</td></tr> ";
print "<br>";
}
print <<HTML;
</table>
</BODY></HTML>
HTML
[root@localhost cgi]# vi adminform2.pl
[root@localhost cgi]# perl adminform2.pl
Can't locate CGI/Session.pm in @INC (you may need to install the CGI::Session module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at adminform2.pl line 5.
BEGIN failed--compilation aborted at adminform2.pl line 5.
[root@localhost cgi]#
I have the same error and I executed:
# yum install perl-CGI::Session
Loaded plugins: fastestmirror, langpacks
base | 3.6 kB 00:00:00
epel/x86_64/metalink | 15 kB 00:00:00
extras | 3.4 kB 00:00:00
mariadb | 2.9 kB 00:00:00
updates | 3.4 kB 00:00:00
webtatic | 3.6 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirror.cenac.ipn.mx
* epel: fedora-epel.mirror.iweb.com
* extras: mirror.cenac.ipn.mx
* updates: mirror.cenac.ipn.mx
* webtatic: sp.repo.webtatic.com
No package perl-CGI::Session available.
Error: Nothing to do
What happen? Could you help me please.
Sure you did not type the command correctly. It is: yum install perl-CGI-Session
Instead of the dash between CGI and Session you typed this ::
Now, you necro'd a four year old thread. I am only pointing out the typo I saw. I did not check that the package is the same name or even still exists.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.