opening files with open()
open(HANDLE, "/path/to/file") # open for reading
open(HANDLE, "< /path/to/file") # open for reading
open(HANDLE, "> /path/to/file") # open for writing
open(HANDLE, ">> /path/to/file") # open for appending
open(HANDLE, "| shell command") # open pipe for writing
open(HANDLE, "shell command |") # open pipe for reading
Be very careful when passing user data to open() as a file name! Hackers know to try using the special metacharacters listed above.