(using Perl) I have a set of statements:
if(@good_car) {
$goodC = 1;
}
elsif (@notbad_car) {
$okayC = 1;
}
else {
$badC = 1;
}
I was wondering if I could do something like:
$goodC = 1 if (@good_car),
elsif (@notbad_car) $okayC = 1 else $badC = 1;
I can’t imagine this working really because of the elsif, but it would be nice to shorten it down a bit 🙂 Any hints would be great!
1 Answer