LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 10-27-2014, 02:08 AM   #1
zak100
Member
 
Registered: Jul 2009
Posts: 262

Rep: Reputation: 2
problem with perl CGI::Session module


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>&nbsp;";
#print "<tr><td>" . $surname . "</td> </tr>&nbsp;";
#print "<tr><td>" . $email . "</td></tr> &nbsp;";
print "<td>$row->{ID}</td> &nbsp;";
print "<td>$row->{Name}</td> &nbsp;";
print "<td>$row->{Phone}</td></tr> &nbsp;";
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]#
Some body please guide me.
Zulfi.
 
Old 10-27-2014, 08:41 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,138

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Try
Code:
yum install perl-CGI-Session
 
Old 10-27-2014, 11:15 PM   #3
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Thanks for helping me. This problem is solved now.

Zulfi.
 
Old 02-08-2018, 11:15 AM   #4
xo)mora
LQ Newbie
 
Registered: Dec 2013
Posts: 24
Blog Entries: 1

Rep: Reputation: Disabled
Question No package perl-CGI::Session available

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.
 
Old 02-09-2018, 05:23 AM   #5
jkirchner
Member
 
Registered: Apr 2007
Location: West Virginia
Distribution: Pop!_OS
Posts: 945

Rep: Reputation: 297Reputation: 297Reputation: 297
Quote:
Originally Posted by xo)mora View Post
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.

Last edited by jkirchner; 02-09-2018 at 05:55 AM.
 
Old 02-09-2018, 10:45 AM   #6
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Thanks jkirchner for solving this prob on my behalf.

Zulfi.
 
Old 02-09-2018, 11:09 AM   #7
xo)mora
LQ Newbie
 
Registered: Dec 2013
Posts: 24
Blog Entries: 1

Rep: Reputation: Disabled
Thank a lot jkirchne.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with session (CGI::Session) shifter Programming 1 03-20-2010 10:14 AM
Perl: Storing Cart-Like items in Mysql without CGI::Session zachet Programming 5 03-11-2010 11:29 AM
How to program the CGI module in Perl (newbie question) resetreset Programming 3 12-01-2008 02:08 AM
perl CGI::Session sci3ntist Programming 1 03-07-2008 08:39 AM
CGI Perl problem with :session -debug craig467 Programming 2 07-20-2006 08:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration