Shlomi Fish committed e57dede

Add more examples to the open.

  • Participants
  • Parent commits 277fed7

Comments (0)

Files changed (1)

File src/tutorials/bad-elements/index.html.wml

-the ultimately <b>wrong</b>, insecure and/or outdated styles are:
+some <b>wrong</b>, insecure and/or outdated styles are:
 \# Bareword filehandle (type glob), two arguments open (insecure) and no
 \# error handling
 open INPUT, "&lt;$filename";
 \# Also opens from $INPUT.
 open INPUT;
+\# Bareword filehandle with three args open and no exception thrown.
+open INPUT, "&lt;", $filename;
+\# Bareword filehandle with two-args open and exception (rare, but possible):
+open INPUT, "&lt;$filename"
+    or die "Cannot open $filename - $!";
+\# Lexical file handle with two-args open (instead of three-args open)
+\# and no exception
+open my $input_fh, "&lt;$filename";