But an assignment doesn't make much sense, in this case. Assignment in an if-condition is useful only if you need to reuse that condition value, e.g. instead of
if (complicated == condition) {
do something with the same complicated == condition
}
we can write
$value = complicated == condition;
if ($value) {
do something with the same $value
}
or shorter, similiar to your code:
if ($value = complicated == condition) {
do something with the same $value
}
so that one doesn't need parse the complicated == condition again to see that it's the same in both places. But in your example that would be pointless because what I dubbed "complicated == condition" is just a single value which seems to remain unchanged.
And now for something completely different: In the OP, you mentioned a library. Have you heard about / looked into Koha, an open source LMS written in Perl?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.