+ -
当前位置:首页 → 问答吧 → 帮个忙

帮个忙

时间:2011-07-08

来源:互联网

如何用perl 实现类似 C中 case  switch 功能

比如install.pl   
执行:perl   insatll.pl
.............................
    1.系统安装
    2.后台配置
    3.前台配置
    4.退出
..........................
选择1,或者2,或者3,或者4,分别会出来字菜单,,我有具体安装文档,比如我选择了3,可以出来菜单如下:
..................
1.mysql安装
2.opensSL   安装
3.apache安装
4.php安装
5.apache配置
6.php配置
7.http是配置
8.返回主菜单

作者: guozhenqian   发布时间: 2011-07-08

类似的有 5.10 新加的 given when 语法。更早的版本用 hash 或 array 表示菜单也不错

作者: zhlong8   发布时间: 2011-07-08

麻烦你给写个啊

作者: guozhenqian   发布时间: 2011-07-08

perl -v
This is perl, v5.8.2 built for aix-thread-multi


use Switch;

作者: Cu_fans   发布时间: 2011-07-08

就这么短啊,,我不太会perl啊

作者: guozhenqian   发布时间: 2011-07-08