<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>use Vs require in perl Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/use-vs-require-in-perl/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/use-vs-require-in-perl/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 27 Feb 2021 09:52:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Difference between use and require in Perl &#8211; use Vs require in perl</title>
		<link>https://www.scmgalaxy.com/tutorials/difference-between-use-and-require-in-perl/</link>
					<comments>https://www.scmgalaxy.com/tutorials/difference-between-use-and-require-in-perl/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Thu, 05 Apr 2012 11:41:21 +0000</pubDate>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[Perl Guide]]></category>
		<category><![CDATA[Perl Tutorial]]></category>
		<category><![CDATA[Perl use and require Difference]]></category>
		<category><![CDATA[Require]]></category>
		<category><![CDATA[Use]]></category>
		<category><![CDATA[use and require Difference in Perl]]></category>
		<category><![CDATA[use Vs require in perl]]></category>
		<category><![CDATA[What]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2012/04/05/difference-between-use-and-require-in-perl/</guid>

					<description><![CDATA[<p>&#124;&#124; use Vs require in perl &#124;&#124; What is the difference between use and require? Except of course that use [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/difference-between-use-and-require-in-perl/">Difference between use and require in Perl &#8211; use Vs require in perl</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-3846 aligncenter" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2012/04/perl-use-require-difference.png" alt="perl-use-require-difference" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2012/04/perl-use-require-difference.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2012/04/perl-use-require-difference-300x200.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p><strong>|| use Vs require in perl || What is the difference between use and require?</strong></p>
<p>Except of course that use is evaluated at compile time where as require is evaluated at run time in other word, A use anywhere in the code will be evaluated when the code is run compiled, but require &#8211; import&#8217;s can only get evaluated when encoutered.</p>
<p><strong>The differences are many and often subtle:</strong></p>
<ol>
<li>use only expects a bareword, require can take a bareword or an expression</li>
<li>use is evaluated at compile-time, require at run-time</li>
<li>use implicitly calls the import method of the module being loaded, require does not</li>
<li>use excepts arguments in addition to the bareword (to be passed to import), require does not</li>
<li>use does not behave like a function (i.e can&#8217;t be called with parens, can&#8217;t be used in an expression, etc), whereas require does</li>
</ol>
<p>do $file is like eval `cat $file`, except the former:<br />
1.1: searches @INC and updates %INC.<br />
1.2: bequeaths an *unrelated* lexical scope on the eval&#8217;ed code.</p>
<p><strong>require $file is like do $file, except the former:</strong><br />
2.1: checks for redundant loading, skipping already loaded files.<br />
2.2: raises an exception on failure to find, compile, or execute $file.</p>
<p><strong>require Module is like require &#8220;Module.pm&#8221;, except the former:</strong><br />
3.1: translates each &#8220;::&#8221; into your system&#8217;s directory separator.<br />
3.2: primes the parser to disambiguate class Module as an indirect object.</p>
<p><strong>use Module is like require Module, except the former:</strong><br />
4.1: loads the module at compile time, not run-time.<br />
4.2: imports symbols and semantics from that package to the current one.</p>
<p><strong>Command to learn more about use and require</strong><br />
&gt; perldoc -f require<br />
&gt; perldoc -f use</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/difference-between-use-and-require-in-perl/">Difference between use and require in Perl &#8211; use Vs require in perl</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/difference-between-use-and-require-in-perl/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
