Can someone tell me why this script will not work when called by another script.
It works when I set the variables inside the script.
this is what and how the parms are passed.
UnSignup.pl?name=Kari+Borer&remove=2002-04-14&rows=Submit&.cgifields=remove
#!/usr/bin/perl -w #Volunteer.pl - Delete dates from Volunteer use strict; use warnings; use diagnostics; use DBI; use CGI; my $query = CGI::new(); my ($dbh, $sth, $sql, $date, $col); my @remove_dates = $query->param("remove"); my $name = $query->param("name"); #my @remove_dates = ("2002-04-21,"); #my $name = "Kari Borer"; $dbh = DBI->connect ("DBI:mysql:host=localhost;database=mnlight_MNLIGH +TNING", "mnlight","password", {PrintError=> 0, RaiseError=> 1}); print $query->start_html; # undo the the dates signed up this session. foreach $date ( @remove_dates ) { $sql = "update Volunteer set Volunteer = 'TBD' WHERE Date = '$ +date' and Volunteer = '$name'"; $sth = $dbh->prepare($sql) || die "prepare: $$sql: $DBI::errst +r"; $sth->execute || die "execute: $sql->[0]: $DBI::errstr"; print $query->h1({-align=>'center'}, "You are no longer signed + up for this date $date"); } #end foreach loop $sth->finish (); $dbh->disconnect (); print $query->h2({-align=>'center'}, $query->a({href=>'../BobSchedule.pl'}, 'BOBS SCHEDULE'), + '&nbsp',); $query->end_html; exit(0)

In reply to Failing when called by another script by mnlight

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.