Hello I am currenltly trying to create a web form where a user will take in information from a log (select the log from a drop down menu in our form) be able to type in the Deal number click get information button and have certain fields show up on the screen. I have the following code:

#!/usr/local/bin/perl use CGI; use CGI qw/:standard :html3 :html4 :netscape :all/; use CGI::Carp 'fatalsToBrowser'; use CGI::Push qw/:standard/; use POSIX qw/strftime/; $query = new CGI; print $query->header; print $query->start_html('Digital Markets Deal Log'); print "<H1>Digital Markets Deal Log</H1>\n"; # Print the first form print $query->startform; $date =(`ls FxDe* | grep -v .gz`); ###################################################################### +############################################# # Variables ###################################################################### +############################################# # file locking (flock): 1=shared, 2=exclusive, 8=unlocked use vars qw/$Time $Dealid $Clientid $CurrencyPair $message $line $name + $date @rows/; my $file ="$date"; my $style; ###################################################################### +############################################# print "What is the Deal ID? ",$query->textfield('name',$name,25); print "<P>Select The Date? ", $query->popup_menu('date',["$date"]), "<P>"; print $query->submit('form_1','Get Deal Info'); print $query->endform; print "<HR>\n"; $query->import_names('Q'); if ($Q::form_1) { open(MESSAGE, "$file") || die "Couldn't open $file: $!\n"; my $locked = flock(MESSAGE,1); unless ($locked) { warn("Couldn't get lock for reading: $!"); alarm(0); close MESSAGE; return undef; } while ($line = <MESSAGE>) { chomp $line; ($Time, $Dealid, $Clientid, $CurrencyPair) = split(/\,/, $line); if $name =~ (/$Dealid/) { unshift(@rows, table({-bgcolor=>'454B74', -border=>'0', -cols=>'2'}, Tr( td({-width=>'25%'}, strong("Time: ") ), td($Time) + ), Tr( td({-width=>'25%'}, strong("Deal ID: ") ), td($Dealid +) ), Tr( td({-width=>'25%'}, strong("Client ID: ")), td($Client +id) ), Tr( td({-width=>'25%'}, strong("Currency Pair: ") ), td($C +urrencyPair)) ), # end table ); } # end if } } $style=<<END; <!-- body { scrollbar-face-color: 454B74; scrollbar-shadow-color: 8792BD; scrollbar-highlight-color: ECECEC; scrollbar-3dlight-color: 000000; scrollbar-darkshadow-color: 000000; scrollbar-track-color: 8792BD; scrollbar-arrow-color: FFFFFF; font-family: tahoma, arial, helvetica, sans-serif; font-size: 12 +px; color: 999999; } td { font-family: tahoma, arial, helvetica, sans-serif; font-size: 12 +px; color: 8792BD; } .td2 { font-family: tahoma, arial, helvetica, sans-serif; font-size +: 13px; color: ececec; } .text { font-family: tahoma, arial, helvetica, sans-serif; font-size +: 10px; color: 8792BD; } .mash { font-family: tahoma, arial, helvetica, sans-serif; font-size +: 13px; color: 8792BD; font-weight: bold; } .mash2 { font-family: tahoma, arial, helvetica, sans-serif; font-size +: 15px; color: 8792BD; font-weight: bold; } a:link { font-family: tahoma, arial, helvetica, sans-serif; font-size +: 11px; color: ececec; } a:visited { font-family: tahoma, arial, helvetica, sans-serif; font-si +ze: 11px; color: ffffff; } a:active { font-family: tahoma, arial, helvetica, sans-serif; font-si +ze: 11px; color: 999999; } a:hover { font-family: tahoma, arial, helvetica, sans-serif; font-size +: 13px; color: 999999; } --> END print header(); print start_html(-title=>'', -bgcolor=>'454B74', -style=>{-code=>$styl +e}), div({-align=>'center'}, # this table displays the entries table({-bgcolor=>'454B74', -border=>'2', -bordercolor=>'8792BD', - +cols=>'2', -width=>'550', -height=>'550'}, [@rows] ), # end of table ), # end of div $locked = flock(MESSAGE,8); close(MESSAGE); exit 0; print $query->end_html;

problem is my if statement in
if $name =~ (/$Dealid/) {
gives me a syntax error. Any ideas of what I am doing wrong ?

2004-04-01 Janitored by Arunbear - added code tags, as per Monastery guidelines


In reply to If Statement by kdelph

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.