Perl and CGI

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsWeb Design & DevelopmentPerl and CGI

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old August 6th, 2009, 12:15 PM
dkhanna01 dkhanna01 is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Aug 2009
Posts: 1 dkhanna01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 41 sec
Reputation Power: 0
Perl cgi popup_menu and param issues

I have written this code:
#!/usr/bin/perl

use strict;
use warnings;
use CGI;
use CGI qw(param);
use CGI::Carp qw(fatalsToBrowser);
use CGI qw/:standard/;

use CGI qw(:standard marquee object embed);

use Term::ANSIColor qw(:constants);


print "Content-type: text/html; charset=iso-8859-1\n\n";


my $brlist = `/home/e027449/bin/lockctrl -s -show -br | awk '{print \$1}'`;
my $brlist = "\n".$brlist;
my @vlist = split("\n",$brlist);

my $q = new CGI;

my(@FILE) = @vlist;
print $q->start_html(-title=>'Select branch');

print $q->h3({-style=>'Color: red;'},'Select branch from the Drop Down List below...');

### start your code ####
print $q->start_form();
print $q->popup_menu(-name=>'list',
-id=>'list',
-values=>\@vlist,
-default=>'stp_rel_08_02_copy_only');
print p($q->submit (-name=>'Lock',-value=>'Lock'), $q->submit (-name=>'UnLock',-value=>'UnLock'), $q->submit (-name=>'Status', -value=>'Status'), $q->submit (-name=>'ManualCron',-value=>'ManualCron'));
### end your code ######
print "Selected value: ".$q->param('list');

print $q->end_form();
my $branch = $q->param('list');

my $lock = $q->param('Lock');
print "check 12121: $lock\n";
my $unlock = $q->param('UnLock');
my $state = $q->param('Status');
my $cron = $q->param('ManualCron');

#print "check 22222:$branch\n";

if ($lock) {
print "executing lock\n";
my $status = `/home/e027449/bin/lockctrl -s -lock -br $branch -repository stp`;
#my $status = system("$script");
if (! $status ){
print $q->h2 ("$branch Branch is now locked");
}
else {
print "Lock not executing\n";
}
}
elsif ($unlock) {
print "executing unlock\n";
my $script = "/usr/local/adm/branch_key $branch 'unlock'";
my $status = system($script);
if (! $status ){
print $q->h2 ("$branch Branch is now unlocked");
}
}
elsif ($state) {
print "executing status\n";
my $script = "/home/e027449/bin/lockctrl -s -show -br $branch";
my $status = system($script);
}
elsif ($cron) {
my $script = "/usr/local/adm/email.cronbuild405 '$branch Manual CronBuild' > /tmp/buildlog405.$branch.$$ 2>&1";
my $status = system($script);
if (! $status ){
print $q->h2 ("Manual Cron for $branch Branch is done please check your email for results");
}
}
else {
print "select something\n";
}

$q->delete_all();
print $q->hidden(mode=>'save');
print $q->end_html();


Now I'm not getting any value in $branch or $lock etc whenever I select any value from the drop down list

while executing on command line I'm geeting warning messages like:

Use of uninitialized value in concatenation (.) or string at ./testenv line 38
Use of uninitialized value in concatenation (.) or string at ./testenv line 44

Which is:

print "Selected value: ".$q->param('list');
print "check 12121: $lock\n"

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentPerl and CGI > Perl cgi popup_menu and param issues


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap