使用perl的字典 [英] dictionary using perl

查看:508
本文介绍了使用perl的字典的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用perl编写一个字典,该程序将使用一个主.pl文件,一个文本文件,指定为.dat


i没有编程背景,我是试图教我自己perl和c ++,所以原谅我的无知。


i已经尝试了一些脚本,我已经弄清楚为什么我的最后一个没有工作,但我没有想法该怎么做。这是我的最后一次尝试:


dictionary.pl

展开 | 选择 | 换行 | 行号

解决方案

初学者错误:

展开 | 选择 | Wrap | 行号



初学者错误:

展开 | 选择 | Wrap | 行号


顺便说一句,我的预期结果是打印最初输入的单词的脚本,以及dictionary.dat文件提供的定义。实际上这个脚本存在很多问题。


基本上我的问题是如何从另一个文件中读取perl,例如我提供的文件,搜索在管道分隔符之前找到的单词,并在管道后面打印文本

i am trying to write a dictionary using perl, the program would use a primary .pl file, and a text file, designated .dat

i have no programing background, and am trying to teach myself perl, and c++, so excuse my ignorance.

i have experimented with some scripts, i have figured out why my last one didn''t work, but i have no idea what to do. this was my last attempt:

dictionary.pl

Expand|Select|Wrap|Line Numbers

解决方案

beginner mistake:

Expand|Select|Wrap|Line Numbers


beginner mistake:

Expand|Select|Wrap|Line Numbers


by the way, my intended result was for the script to print the word originally typed, and the definition supplied by the dictionary.dat file. actually there were quite a few problems with that script.

basically my question is how can i make perl read from another file, such as the one i supplied, search for a word found before the pipe divider, and print the text following the pipe.


这篇关于使用perl的字典的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆