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

List all the features of perl programming?

948


What is it meants by '$_'?

945


What can be done for efficient parameter passing in perl?

946


Explain use of ‘my’ keyword in perl?

975


What does `new $cur->{LINK}' do? (Assume the current package has no new() function of its own.)

982


How to open and read data files with Perl

1090


What interface used in PERL to connect to database? How do you connect to database in Perl?

1034


What does the qx{ } operator do?

969


How to implement a stack in Perl?

1077


What is perl unshift array function?

1108


what is perl language?

971


Explain perl. When do you use perl for programming?

915


Which guidelines by Perl modules must be followed?

1069


Explain the meaning of perl one-liner?

1110


What are the various perl data types based on the context?

987