[PerlChina] perl怎么读取文件或者路径参数

亮康 kangliang1982 at gmail.com
Sun Nov 16 18:25:13 PST 2008


1. @ARGV是默认参数列表
2. 使用正则表达式




2008/11/17 owen nirvana <freeespeech at gmail.com>

> 我用<>总是不得要领,
>
> my ($file) = @_,取到的总是文件行数,如果是@file则是文件内容
> 但是 @_不应该是参数列表吗,为什么不是 filename呢, 如果是输入路径的话,@_甚至 == 0,
>
> 但是我很希望能够直接在参数里得到路径名,然后批量打开某些类型的文件, 还请各位指教
>
>
> 还有一个问题,是关于提取数据的
>
> 2222  eewweasdds,asdasd.sadsadasdas
>          ddasdddddddddddddddddddda
>          ddddddddddddddddddddddddddd
> 2821  easdddddddddddddddddddddddd
> 2192  288888888888888888888ass0a-das.
>          as;dddsaddaa0---------22222222
>
> 诸如此类,左边很好办,可是右边并不限于单行,我该如何把这样的数据提取为  name title的格式存到数据表里呢
> gtalk:freeespeech at gmail.com <gtalk%3Afreeespeech at gmail.com>
> _______________________________________________
> China-pm mailing list
> China-pm at pm.org
> http://mail.pm.org/mailman/listinfo/china-pm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/china-pm/attachments/20081117/0820c2f4/attachment.html>


More information about the China-pm mailing list