in reply to Re^2: checking values of variables
in thread checking values of variables
While your suggested code is a good solution; I was thinking along the lines of being able to match more than just an empty string for each case. So List::MoreUtils could be used to express the code this way:
or without List::MoreUtils:help() unless all { $_ } $server, $user, $database, ...
but I still think that the original code makes it very clear what is going on and provides future flexibility. I tend to believe that code golf and maintainablity are often at odds.help() unless $server && $user && $database ..
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: checking values of variables
by AnomalousMonk (Archbishop) on Aug 12, 2013 at 19:33 UTC | |
Re^4: checking values of variables
by Laurent_R (Canon) on Aug 12, 2013 at 18:54 UTC |
In Section
Seekers of Perl Wisdom