预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共18页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

PERL复习题 (答案不是标准答案,仅供参考) 一、选择题 1.WhatisthesimplesttypeofdatathatPerlcanworkwith? Aelement Bscalar Cvector Dcomponent 2.Whichoperatorcanbeusedtotakethebottomitemfromanarray? Apop Bpush Cpull Dplant 3.Whichoperatorisusedtoarrangeitemsincharacterorder? Aascend Bsort Carrange Ddescend 4.Ratherthanusingprint,whatisoftenusedinPerlwhenformattingisimportant? Aprintf Bformat Calign Dshow 5.WhichmodifiercanbeusedwhenmatchinginPerltoignorecase? As Bv Ci Dc 6.Whichoperatorcanbeusedtobreakupastringintomorethanonepartbaseduponaseparator? Achop Bsplit Cdivide Dparse 7.WhatoptiondoyouusewhenstartingPerltotellittoruninwarningmode?_-w\usewarnings (Fillintheblank.) 8.Whichcontrolstructurecanbeusedtoexecuteonlyaconditionisfalse? Auntil Bunless Cwhile Dwithout 9.WhichofthefollowingcommandsshouldbeusedtoopenafilehandlenamedKARENtoan existingfilenamedsw? AopenKAREN“>sw”; BopenKAREN,“>sw”; Copen“sw”KAREN; Dopen“>sw”,KAREN; 10.WithinPerl,whichoperatorisusedtochangetheworkingdirectory? Acd Bchdir Cpwd Dwd 11.Whichoperatorcanbeusedtoaccessthefirstiteminanarray? Ashift Bstart Cright$ Dleft$ 12.Withinaloop,whichoperatorimmediatelyendsexecutionoftheloop? Anext Blast Credo Dleave 13.Whichfunctioncanbeusedtomakesureyourprogramexitswithanonzerostatusevenif thereastandarderror? Ahash Bnoexit Cnozero Ddie 14.Whichofthefollowingoperatorsworkmostlikesimplesearching/patternmatching? A/f B/g Cs/// Dm// 15.WhichkeywordisusedinPerltodefineasubroutine? Abranch Bsub Csplit Dmake 16.YouwanttoclosethedirectoryhandleEVAN.Whichofthefollowingshouldyouuseto accomplishthis? AcloseEVAN; BclosedirEVAN; Cclose_directoryEVAN; Dnoneoftheabove 17.Whichofthefollowinglinesofcodeaccomplishesthesamethingas$price=$price+9;? A$price+9; B$price=+9; C$price+=9; D9+$price 18.Whatvaluedovariableshavebeforetheyarefirstassigned? Aundef Bnull C0 Dnil 19.WhichPerlfunctioncanbeusedtolaunchachildprocesstorunaprogram? Asplit Bspin Cfork Dsystem 20.WhichPerlfunctioncanbeusedtoidentifythefirstfoundoccurrenceofasubstring? Afind Bindex Cloc