Hi,
I am still a little unclear on how to use SWITCH (similar to case in other languages) after looking through the Perl documentation. Basically, base on the string value in a variable called, "$tmp_mode", the script should perform different file I/O task. For example, if $tmp_mode eq "input" then open(FILE, "$file_name"
; or if $tmp_mode eq "output" then open(FILE, ">$file_name"
. I can simply use if... but would like to know how can it be done in a case-like fashion.
Thanks
Mike
I am still a little unclear on how to use SWITCH (similar to case in other languages) after looking through the Perl documentation. Basically, base on the string value in a variable called, "$tmp_mode", the script should perform different file I/O task. For example, if $tmp_mode eq "input" then open(FILE, "$file_name"
Thanks
Mike