收藏 分享(赏)

Lab 1 variablesnew.doc

上传人:dreamzhangning 文档编号:2639160 上传时间:2018-09-24 格式:DOC 页数:7 大小:114KB
下载 相关 举报
Lab 1 variablesnew.doc_第1页
第1页 / 共7页
Lab 1 variablesnew.doc_第2页
第2页 / 共7页
Lab 1 variablesnew.doc_第3页
第3页 / 共7页
Lab 1 variablesnew.doc_第4页
第4页 / 共7页
Lab 1 variablesnew.doc_第5页
第5页 / 共7页
点击查看更多>>
资源描述

1、Lab 1: Perl 语言环境部署及变量练习Objects:LINUX 及 WINDOWS Perl 编程环境部署;掌握在 Linux 环境下编写 Perl 程序;掌握标量变量(scalars)的用法;掌握数列变量(arrays )的用法;掌握散列变量(hash )的用法。PERL 安装LINUX:一般 PERL 编译环境在 LINUX 操作系统安装后即已安装好;WINDOWS:下载 ActivePerl 并按提示安装。登录 Linux 服务器使用 Xming 登录 Linux 服务器,点击保存的 config 文件,输入用户密码点完成。使用 gedit 编辑 Perl 程序在命令行中输入

2、gedit $i = $i + 1; c. Move the contents of array B into A by means of a simple assignment or a loop. d. Print out the two arrays A and B, followed by a blank line. Make sure the elements of each array are separated so one can read them. e. Put the steps b-c-d inside another loop to repeat b-c-d five

3、 (6) times in all. 7. Hint: Use the above code snippets in parts of your code, but keep in mind that these code snippets are incomplete. For example, they do not include the statements to initialize your loop variables. QIn a Perl script, create an array containing four codons ATG, GTC, CGA, TTG (fo

4、llow this order).In the following exercises, specify whether each operation is done in a list/array context or scalar context. In order to get the correct answer, you must try these operations in a Perl script.Assuming that the array name is some_array:1. my_array = some_array; _Print my_array on th

5、e screen. What is its value?2. $some = some_array; _Print $some on the screen. What is its value?3. $some = “some_array“; _Print $some on the screen. What is its value?4. ($some) = some_array; _Print $some on the screen. What is its value?5. ($some2, $some3) = some_array; _Print $some2 and $some3 on

6、 the screen. What are their values?6. $some = reverse some_array;a) Briefly explain what this statement generates.b) I would like reverse the elements in some_array so that the first item is “TTG“ and the last item is “ATG“. How would you change the above statement to achieve this goal?7. How would you re-write these two statements by forcing scalar context in the print command?$some = reverse some_array;Print “$somen“;

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 大学课件

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报