perl 题目

发布时间:2014-10-22 14:50:51编辑 分享查询网我要评论
本篇文章主要介绍了"perl 题目",主要涉及到perl 题目方面的内容,对于perl 题目感兴趣的同学可以参考一下。

1. 数组和列表量的区别   在标量环境下,数组返回数组长度。而列表值返回最后一个值。  列表(),会将小括号的东西放到堆栈中,使用时一个个弹出。 2. use strict 和 use warnings 的作用 use strict帮你寻找因为错误拼写造成的错误,解决命名变量问题。use strict 迫使你把变量的范围缩到最小,使你不必担心同名变量在程序的其它部份发生不良作用。 use warnings;的话perl在编译的时候会将警告信息打印出来,否则不打印。 3. while(<>) 和forreach(<>)的区别? While(<>)一次处理一行输入。 Foreach(<>) 一次处理全部输入。 4. 怎么查看引用的类型?  使用ref函数。Ref函数会先判读标量变量是否包含一个引用,然后再判读指向什么类型的引用。 $a = 10;        ## ref($a) 返回false $ra = \$a;      ##ref($ra) == ‘SCALAR’ $rarray = [‘a’,’b’,’c’];    ##ref($array) == ‘ARRAY’; $rhash = {‘a’,’A’,’b’,’B’,’c’,’C’};  ##ref($rhash) == ‘HASH’ What arguments do you frequently use for the Perl interpreter and what do they mean?  What does the command ‘use strict’ do and why should you use it?  What do the symbols $ @ and % mean when prefixing a variable?  What elements of the Perl language could you use to structure your code to allow for maximum re-use and maximum readability?  What are the characteristics of a project that is well suited to Perl?  Why do you program in Perl?  Explain the difference between my and local.  Explain the difference between use and require.  What’s your favorite module and why?  What is a hash?  Write a simple (common) regular expression to match an IP address, e-mail address, city-state-zipcode combination.  What purpose does each of the following serve: -w, strict, -T ?  What is the difference between for & foreach, exec & system?  Where do you go for Perl help?  Name an instance where you used a CPAN module.  How do you open a file for writing?  How would you replace a char in string and how do you store the number of replacements?  When would you not use Perl for a project? 5  perl 中引号特殊符号 q  是单引号  qq 是双引号  qw 单词列表引号  qr 正则表达式引号  qx 反引号  其中qq,qw又较为常用  

上一篇:[置顶] 全面的framebuffer详解


关键词: perl 题目