+ -
当前位置:首页 → 问答吧 → perl有没有像php file()一样的函数!

perl有没有像php file()一样的函数!

时间:2011-01-10

来源:互联网

RT。

作者: yellowtree86   发布时间: 2011-01-10



QUOTE:
  use File::Slurp;

  my @lines = read_file( 'filename' ) ;

作者: 兰花仙子   发布时间: 2011-01-10

回复 兰花仙子


    多谢仙子。
可是read_file好像只是读取文件,php 中file 还可以  file ("http://baidu.com") 。有没有函数可实现这个功能的啊?

作者: yellowtree86   发布时间: 2011-01-10



QUOTE:
回复  兰花仙子


    多谢仙子。
可是read_file好像只是读取文件,php 中file 还可以  file ("http:/ ...
yellowtree86 发表于 2011-01-10 16:02




    ruby的IO类可以。perl的IO::File是否可以,没了解过。
不过LWP::Simple的get()函数就可以实现file("http://url")功能

作者: 兰花仙子   发布时间: 2011-01-10