Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. Hi all this script generate an error if the name of database passed in argument fonction is false , for this i want that my script dont generate
  2.  
  3. any output if there is an error in database name or host , i am beginner in Per if some one wants to help me thanks to appears me how i can
  4.  
  5. change this code
  6.  
  7.  
  8. sub desablestatus {
  9. my $dbname=$_[1];
  10. my $host=$_[0];
  11. my $port="XXXX";
  12. my $options="";
  13. my $tty="";
  14. my $username = "XXXXX";
  15. my $password="XXXXX";
  16. my $hotmail;
  17. my $sth;
  18. my $dbh;
  19.  
  20. $dbh = DBI->connect("dbi:Pg:dbname=$dbname;host=$host","$username","$password");
  21. $dbh->do("update users set status = 'active'");
  22.  
  23.  
  24. }
  25.  
  26. desablestatus ("localhost","mydatabase");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement