Below is a code snippet that asks for user input, and if the input is not either “csv” or “newline”, the while loop is called.
For line 5, what is the correct syntax for the while loop where it attempts to match $format to either “csv” or “newline”? Currently it is only seems to be matching “csv”.
1 # Request output format
2 print "Format of email addresses required (csv|newline): ";
3 $format = <>;
4 chop($format);
5 while ($format ne ("csv"||"newline")) {
6 print "Invalid format. Enter in csv or newline: ";
7 $format = <>;
8 chop($format);
9 }
or