perl - How to avoid empty elsif? -



perl - How to avoid empty elsif? -

the below code want, tells me, empty elsif not practice. purpose create sure $type either snap or fs, alter $t if snap.

my $t = ""; if ($type eq "snap") { $t = "-t snapshot"; } elsif ($type eq "fs") { } else { fatalerror("must either snap or fs") }

question

how do same, without empty elsif?

how about:

my $t = ""; if ($type eq "snap") { $t = "-t snapshot"; } elsif ($type ne "fs") { fatalerror("must either snap or fs") }

perl

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -