Difference between "open function" and "touch command" in Perl?

Viewed 5857

What's the difference in the below two cases for file creation.

  open(DATA,">newfile.txt");       #1.using open function
  close(DATA);

  `touch newfile.txt`;             #2.using touch command  

Which one better and fast? Note: When both open function and touch command used in Perl scripts, and the consider its used for creating empty files.

5 Answers
Related