Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Global symbol "$isenchere" requires explicit package name at UserAction.pm line 416.

by *alexandre* (Scribe)
on Nov 22, 2017 at 15:15 UTC ( [id://1204025]=perlquestion: print w/replies, xml ) Need Help??

*alexandre* has asked for the wisdom of the Perl Monks concerning the following question:

Hi I could not fond what the error mind with the $isecnchere variable
sub payedSuccess { my $article = $query->param("article"); my $id_a_livre = $query->param("id_a_livre"); my $buyer = $query->param("buyer"); my $note = $query->param("note"); my $session = new CGI::Session( "driver:File", $session_id, {Dir +ectory=>"$session_dir"} ); my $username = $session->param("username"); if ($username) { my ($userID)=sqlSelect("id_personne", "personne", "nom_utilis +ateur = '$username'"); my ($isenchere)=sqlSelect("enchere", "article", "id_article = + '$isenchere'"); if ($isenchere eq '1') { ($ARTICLE{'max_enchere'})=sqlSelect("MAX(prix)", "ench +ere", "ref_article = '$article'"); ($ARTICLE{'ref_enchereur'},$ARTICLE{'id_enchere'})=sql +Select("ref_enchereur,id_enchere", "enchere", "ref_article = '$articl +e' AND prix = '$ARTICLE{'max_enchere'}'"); + }else { $ARTICLE{'ref_enchereur'} = sqlSelect("id_personne", "pers +onne", "nom_utilisateur = '$buyer'"); } my ($articleUserID)=sqlSelect("id_personne", "personne,articl +e,met_en_vente", "met_en_vente.ref_article = id_article AND id_artic +le = $article AND ref_vendeur = id_personne"); if ($userID eq $articleUserID) { my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isd +st)=localtime(); my $date = sprintf "%4d-%02d-%02d \n",$year+1900,$mon ++1,$mday; my $time = sprintf("%4d:%02d:%02d",$hour,$min,$sec); # sqlUpdate("article", "id_article=$article",(ref_statu +t => "14")); my $condition; ($condition) = sqlSelect("ref_condition_livraison", "a +rticle", "id_article = $article"); sqlUpdate("a_livre", "id_a_livre=$id_a_livre",(ref_sta +tut => "14", ref_mode_livraison => $condition)); ($ARTICLE{'email'})=sqlSelect("email", "personne", "id +_personne = $ARTICLE{'ref_enchereur'}"); + # article livré #article livré mail my $Message = new MIME::Lite From =>'robot@djmarketpl +ace.biz', To =>$ARTICLE{'email'}, Subject =>$SERVER{'article +_deliver'} , Type =>'TEXT', Data =>"$SERVER{'article_deliver'}"; $Message->attr("content-type" => "text/html; chars +et=iso-8859-1"); $Message->send_by_smtp('localhost:25'); loadMyEnchereDeal(); } else { #modification d'un article d'un autre user } } }
thx
  • Comment on Global symbol "$isenchere" requires explicit package name at UserAction.pm line 416.
  • Download Code

Replies are listed 'Best First'.
Re: Global symbol "$isenchere" requires explicit package name at UserAction.pm line 416.
by Mr. Muskrat (Canon) on Nov 22, 2017 at 15:27 UTC
    my  ($isenchere)=sqlSelect("enchere", "article", "id_article = '$isenchere'");

    You're defining it on the left side and passing it as a part of an argument to sqlSelect on the right...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1204025]
Approved by Mr. Muskrat
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-18 20:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found