in reply to Re^5: Regex help/ Lua parse
in thread Regex help/ Lua parse
and, in simple situationsif (x = y) { print x; }
are ok, butif (x = y) { print x; }
is not. In this stripped down form I can see how the last example, although interpreted properly by Perl, can look like a random if (x = y) and an unrelated block of { print x; }. I'm not entirely sure of what kind of examples you are asking for, but from this node:if (x = y) { print x; }
...if ($Age < 13) && ($Age > 0)) { print "What are you doing here, $firstName? This Web site is strictly PG-13. Shame on you for being so naughty as to come here!"; } elsif ($Age < 18) && ($Age > 12)) { print "Not to long ago, we’d have have chased you away from our Web site. But now that you’re a teenager and mature enough for PG-13 materials, we’re glad to see you $firstName."; }
or even:if (($Age < 13) && ($Age > 0)) { print "content"; } elsif (($Age < 18) && ($Age > 12)) { print "content"; }
Thank you again for taking time out to help me grasp the fundamentals. Please let me know if I am missing your point. I enjoy Perl (and learning programming in general) and feel I have been progressing rather quickly, but I want to squash bad habits and form a good foundation in style and understanding before moving to some of the more complex concepts and modules in Perl.if (($Age < 13) && ($Age > 0)) { print "content"; } elsif (($Age < 18) && ($Age > 12)) { print "content"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Regex help/ Lua parse
by kcott (Archbishop) on Oct 28, 2012 at 07:42 UTC |