vendredi 16 février 2018

Perl replace string

is it possible to replace in Perl with an 'if'? I am new in Perl and I want to replace if 'true' from an Database with 'erledigt;'

 while (my($username, $description, $checked, $record_date) = $query4->fetchrow_array){
  if ($checked == 'true')
  { print $fh4 'erledigt'
  }
  else
  {
  print $fh4 ($checked)
  }
  {
  print $fh4 "$username;$description;$checked;$record_date\n"; 
}
} 

I got in every line 'erledigt' but not replaced for 'true'.

I'm glad if someone helps me :)

Aucun commentaire:

Enregistrer un commentaire