Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Explain the difference between use and require?

Answer Posted / vipul dalwala

- a require statement imports the functions and objects
only within their defined packages. The use keyword, on the
other hand, imports the functions and objects so they are
available to the current package as if they had been
defined globally. For example,

require Cwd;
$pwd = Cwd::getcwd();

as opposed to

use Cwd;
$pwd = getcwd();

- use statements are interpreted and executed at the time
the file is parsed, but require statements import modules
at run time, which means you can supply a variable name to
a require statement based on other elements of your program.

Is This Answer Correct ?    9 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is Polymorphism in Perl?

967


What does next statement do in perl?

993


Explain join function in perl?

958


Explain the meaning of perl one-liner?

1064


How do I replace every TAB character in a file with a comma?

966


How and what are closures implemented in perl?

886


Explain the default scope of variables in perl?

943


What happens to objects lost in "unreachable" memory, such as the object returned by Ob->new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ?

989


Can inheritance be used in perl?

995


What is perl shift array function?

964


“Perl regular expressions match the longest string possible”. What is the name of this match?

941


Who created perl?

919


Why aren't Perl's patterns regular expressions?

1168


Explain strftime() function in perl?

940


Explain arrays in perl.

939