Se connecter avec
S'enregistrer | Connectez-vous

PHP -> PERL

Dernière réponse : dans Programmation

Bonjour,

J'aurai besoin que vous m'aidiez pour transposer un fichier php en perl. Donc j'ai fait un fichier en php, et sur mon serveur il n'y a que le perl qui fonctionne pour cette application, mais je n'y connais rien en perl, vous pourriez m'aider ?

Voici mon script :
  1. <?php
  2. $clientList=array();
  3. function onNewClient($uid){
  4. global $clientList;
  5. $clientList[$uid]=array();
  6. sendMessage("WELCOME=".$uid,$uid);
  7. }
  8. function onLostClient($uid){
  9. global $clientList;
  10. unset($clientList[$uid]);
  11. sharePersonalData("USERLIST=","[".$uid."] && !".$uid,"[".$uid."]","=");
  12. sendGroupCount("ROOMLIST=","!".$uid,"",",","=",false);
  13. }
  14. function onClientMessage($uid,$msg){
  15. global $clientList;
  16. $comp=split("=",$msg);
  17. if($comp[0]=="INIT"){
  18. $clientList[$uid]["COLOR"]=$comp[1];
  19. $clientList[$uid]["PSEUDO"]=$comp[2];
  20. $clientList[$uid]["XPOS"]=$comp[3];
  21. $clientList[$uid]["YPOS"]=$comp[4];
  22. setPersonalData($clientList[$uid]["PSEUDO"].",".$clientList[$uid]["COLOR"].",".$uid.",".$clientList[$uid]["XPOS"].",".$clientList[$uid]["YPOS"],$uid);
  23. }else if($comp[0]=="MSG"){
  24. sendMessage("MSG=".$clientList[$uid]["PSEUDO"].">".$comp[1]."=".$clientList[$uid]["COLOR"],"[".$uid."] && !$uid");
  25. }else if($comp[0]=="CLICK"){
  26. $clientList[$uid]["XPOS"]=$comp[1];
  27. $clientList[$uid]["YPOS"]=$comp[2];
  28. setPersonalData($clientList[$uid]["PSEUDO"].",".$clientList[$uid]["COLOR"].",".$uid.",".$clientList[$uid]["XPOS"].",".$clientList[$uid]["YPOS"],$uid);
  29. sendMessage("CLICK=".$uid."=".$comp[1]."=".$comp[2],"[".$uid."] && !$uid");
  30. }else if($comp[0]=="SETROOM"){
  31. sharePersonalData("USERLIST=","[".$uid."] && !".$uid,"[".$uid."] && !".$uid,"=");
  32. removeClientGroup($uid,$uid);
  33. addClientGroup($comp[1],$uid);
  34. sharePersonalData("USERLIST=","[".$uid."]","[".$uid."]","=");
  35. sendGroupCount("ROOMLIST=","","",",","=",false);
  36. }
  37. }
  38. ?>

Autres pages sur : php perl

Lassé par la pub ? Créez un compte

Même pour les serveurs de socket :-o ?

Je pense que tu as tord là, mon script PHP je le fais démarrer à partir de putty, où je me connecte sur mon shell linux de powerserv35.net. Avec ça je lance l'application PHP mais elle ne démarre pas, il n'y a que le PERL qui démarre. Or là j'ai pas besoin d'une base de donnée (donc de serveur Apache), mais d'un shell linux.
Lassé par la pub ? Créez un compte
Tom's guide dans le monde