I have in my script variables with my $variableA and the use vars qw(............)
, and when i put my variables in use vars qw(....) on 7 variables add , my script don't want to execute.
Don't out none warnings. :(
Update:
This is my script:
#!perl -w use CGI::Carp('fatalsToBrowser'); use CGI qw/:standard/; use strict; use DBI; use vars qw($query $dbase $userdb $passworddb $cgi_url $idProdus); $query = CGI->new(); $cgi_url = "http://localhost/cgi-bin/script.pl"; $dbase= "test"; $userdb = "admin"; $password = "123456"; my $count=0; my $driver = "dbi:mysql:" . $dbase; my $dbh = DBI->connect($driver, $userdb, $passworddb) or die "Error $D +BI::errstr\n"; my $statement = $dbh->prepare("SELECT id_produs, denumire FROM produse +") or die "Error $DBI::errstr\n"; $statement->execute or die "Error $DBI::errstr\n"; print $query->header(-type=>'text/html'); print <<ENDHTML; Pentru a vedea ce aveti in cos dati click <a href="$cgi_url/shop.pl?pr +oduct=viewCart">aici!</a> <br>Pentru check out dati click <a href="$cgi_url/shop.pl?product=chec +kOut">aici!</a><br><form action="$cgi_url/shop.pl" method="get"> <input type="hidden" name="product" value="viewProduct"><select name=" +id"><option value="none">Select product</option> ENDHTML while (($idProdus, $denumireProdus) = $statement->fetchrow_array) { print <<ENDHTML; <option value="$idProdus">$denumireProdus</option> ENDHTML my $count++; } print <<ENDHTML; </select><input type="submit" value="View Product"></form> ENDHTML $statement->finish; $dbh->disconnect; $dbh = DBI->connect($driver, $userdb, $passworddb) or die "Error $DBI: +:errstr\n"; $statement = $dbh->prepare("SELECT denumire, pret, url_demo, descriere +, url_download, foto FROM produse WHERE id_produs = $count") or die +"Error $DBI::errstr\n"; $statement->execute or die "Error $DBI::errstr\n"; ($denumire, $pret, $url_demo, $descriere, $url_download, $foto) = $sta +tement->fetchrow_array(); print <<ENDHTML; <br><br><table border=0> <form action="$cgi_url/shop.pl" method="get"> <input type=hidden name="product" value="add"> <input type=hidden name="canditate" value="1"> <input type=hidden name="idp" value="$count"> <input type=hidden name="title" value="$denumireProd"> <input type=hidden name="descriere" value="$descriere"> <input type=hidden name="price" value="$pret"> <input type=hidden name="fotoProdus" value="$foto"> <tr><td rowspan=3> <img src="$foto"> </td><td> <b>$denumireProd</b></td></tr> <tr><td> $descriere</td></tr> <tr><td align=right> <a href="$url_demo">Try demo!</a> Pret: $pret <input type=submit val +ue="Buy now!"> </td></tr></form></table><hr> ENDHTML $statement->finish; $dbh->disconnect; $newCount = $count - 1; $dbh = DBI->connect($driver, $userdb, $passworddb) or die "Error $DBI: +:errstr\n"; $statement = $dbh->prepare("SELECT denumire, pret, url_demo, descriere +, url_download, foto FROM produse WHERE id_produs = $newCount") or d +ie "Error $DBI::errstr\n"; $statement->execute or die "Error $DBI::errstr\n"; ($denumire, $pret, $url_demo, $descriere, $url_download, $foto) = $sta +tement->fetchrow_array(); print <<ENDHTML; <br><br><table border=0> <form action="$cgi_url/shop.pl" method="get"> <input type=hidden name="product" value="add"> <input type=hidden name="canditate" value="1"> <input type=hidden name="idp" value="$newCount"> <input type=hidden name="title" value="$denumire"> <input type=hidden name="descriere" value="$descriere"> <input type=hidden name="price" value="$pret"> <input type=hidden name="fotoProdus" value="$foto"> <tr><td rowspan=3> <img src="$foto"> </td><td> <b>$denumire</b></td></tr> <tr><td> $descriere</td></tr> <tr><td align=right> <a href="$url_demo">Try demo!</a> Pret: $pret <input type=submit val +ue="Buy now!"> </td></tr></form></table> ENDHTML print <<ENDHTML; <br><br>Total produse gasite: $count<br> ENDHTML exit; $statement->finish; $dbh->disconnect; print <<ENDHTML; Nu exista in baza de date <b>$dbase</b> nici un produs. ENDHTML exit;


This is all my script.

In reply to Re: Re: STRICT question by webstudioro
in thread STRICT question by webstudioro

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.