update: I knew I was posting with too much zeal lately. Just a great way to show what you don't know (or think you do). See tye's comment below for the real deal.
btrott beat me to it, but I can add that or works because of precedence. You see, as everyone has said, the problem is that when the right side of the || get evaluated the handle doesn't exist yet because the my hasn't done it's magic yet. Using or avoids this because it's less important in terms of its precedence and therefore let's my do its thang (no typo) before checking out what it has to - and now $dbh does exist and can be checked. see perlman:perlop to read about the || and or operators and their respective precedence.
<myExperience> $mostLanguages = 'Designed for engineers by engineers.'; $perl = 'Designed for people who speak by a linguist.'; </myExperience>
In reply to RE: RE: my and its use
by jptxs
in thread my and its use
by tame1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |