Vous êtes sur la page 1sur 1

3/30/2016

proquest.safaribooksonline.com/print?xmlid=9780133593068%2Fch01lev1sec2_html

Username:TempleUniversityBook:PerlbyExample,FifthEdition.Nopartofanychapterorbookmaybereproducedortransmittedinanyformby
anymeanswithoutthepriorwrittenpermissionforreprintsandexcerptsfromthepublisherofthebookorchapter.Redistributionorotherusethat
violatesthefairuseprivilegeunderU.S.copyrightlaws(see17USC107)orthatotherwiseviolatestheseTermsofServiceisstrictlyprohibited.
ViolatorswillbeprosecutedtothefullextentofU.S.FederalandMassachusettslaws.

1.2WhatIsanInterpretedLanguage?
TowritePerlprograms,youneedtwothings:atexteditorandaperlinterpreter,whichyoucandownloadveryquicklyfromanynumberofWeb
sites,includingperl.org,cpan.org,andactivestate.com.Unlikewithcompiledlanguages,suchasC++andJava,youdonotneedtofirst
compileyourprogramintomachinereadablecodebeforeexecutingit.Theperlinterpreterdoesitallithandlesthecompilation,interpretation,
andexecutionofyourprogram.AdvantagesofusinganinterpretedlanguagesuchasPerlisthatitrunsonalmosteveryplatform,isrelatively
easytolearn,andisveryfastandflexible.
LanguagessuchasPython,JavaScript,andPerlareinterpretedlanguagesthatuseanintermediaterepresentation,whichcombinesboth
compilationandinterpretation.Itcompilestheuserscodeintoaninternalcondensedformatcalledbytecode,orthreadedcode,whichisthen
executedbytheinterpreter.WhenyourunPerlprograms,youneedtobeawareoftwophases:thecompilationphase,andthentherunphase
whereyouwillseetheprogramresults.Ifyouhavesyntaxerrors,suchasamisspelledkeywordoramissingquote,thecompilerwillsendan
error.Ifyoupassthecompilerphase,youcouldhaveotherproblemswhentheprogramstartsrunning.Ifyoupassbothofthesephases,you
willprobablystartworkingonformattingtomaketheoutputlooknicer,improvingtheprogramtomakeitmoreefficient,andsoforth.
Theinterpreteralsoprovidesanumberofcommandlineswitches(options)tocontrolitsbehavior.Thereareswitchestochecksyntax,
sendwarnings,loopthroughfiles,executestatements,turnonthedebugger,andsoforth.Youwilllearnabouttheseoptionsthroughoutthe
followingchapters.

http://proquest.safaribooksonline.com/print?xmlid=9780133593068%2Fch01lev1sec2_html

1/1

Vous aimerez peut-être aussi