Learning Perl: 1.6. Exercises

Previous Page

Next Page

 

1.6. Exercises

Normally,each chapter will end with some exercises,with the answers in Appendix A. But you don't need to write the programs needed to complete this section as they are supplied within the chapter text.

If you can't get these exercises to work on your machine,check your work and then consult your local expert. Remember that you may need to tweak each program a little,as described in the text.

  1. [7] Type in the "Hello,world" program and get it to work. (You may name it anything you wish,but a good name might be ex1-1,for simplicity,since it's exercise 1 in Chapter 1.)

  2. [5] Type the command perldoc -u -f atan2 at a command prompt and note its output. If you can't get that to work,then find out from a local administrator or the documentation for your version of Perl about how to invoke perldoc or its equivalent. (You'll need this for the next exercise anyway.)

  3. [6] Type in the second example program (from the previous section) and see what it prints. (Hint: Be careful to type those punctuation marks exactly as shown.) Do you see how it changed the output of the command?

Previous Page

Next Page

相关文章

1. 如何去重 #!/usr/bin/perl use strict; my %hash; while(...
最近写了一个perl脚本,实现的功能是将表格中其中两列的数据...
表的数据字典格式如下:如果手动写MySQL建表语句,确认麻烦,...
巡检类工作经常会出具日报,最近在原有日报的基础上又新增了...
在实际生产环境中,常常需要从后台日志中截取报文,报文的形...
最近写的一个perl程序,通过关键词匹配统计其出现的频率,让...