On Aug 12, Randy Macdonald said:

However, when I run:

print '<a>';
use NotARealPackage;
print '<b>';

I expect to get:

<a>

but I get no output at all. Why is this?

The 'use' statement is special to Perl. It is executed at compile-time, not at run-time like most of the rest of your code. Because of this, your print() statements are never even executed. In fact, only the first one ends up being compiled -- Perl never REACHES the second one at all, since it has tried to include the NotARealPackage module.

--
Jeff "japhy" Pinyan         %  How can we ever be the sold short or
RPI Acacia Brother #734     %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %    -- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to