Perl I/O Read & Write
来源:互联网 发布:安装mysql步骤 编辑:程序博客网 时间:2024/04/30 14:58
#!/opt/nokianms/bin/perl -w
use strict;
use English;
use IO::File;
my $FileContent;
sub ReadRepXMLFile
{
my ( $filename ) = @ARG;
undef $RS; # for reading the file into one scalar
my $ifh = IO::File->new( $filename,"r" );
die "File OpenError($filename);$OS_ERROR" unless $ifh;
$FileContent = <$ifh>;
$ifh->close();
}
sub WriteRepXMLFile
{
my ( $filename ) = @ARG;
my $ofh = IO::File->new( $filename,"w" );
die "File OpenError($filename);$OS_ERROR" unless $ofh;
$ofh->print( $FileContent );
$ofh->close();
}
sub main
{
if ( scalar( @ARGV ) != 2 )
{
print "Usage: $0<xxxrap_rep.xml> <outputfile>\n";
exit 1;
}
ReadRepXMLFile( $ARGV[0] );
WriteRepXMLFile( $ARGV[1] );
exit 0;
}
main();
__END__
- Perl I/O Read & Write
- Identifying Read/Write (I/O) Problems
- Identifying Read/Write (I/O) Problems - Database
- FFMPEG学习【libavformat】:I/O Read/Write
- 文件I/O编程 (open、read、write、lseek、close)
- I\O操作相关函数:fread,fwrite以及read,write
- linux文件I/O编程 (open、read、write、lseek、close)
- 文件 I/O——read函数write函数
- 不带缓存的文件I/O操作 read/write
- I/O read()/write()/pread()/pwrite()/fread()/fwrite 等
- 文件I/O函数的封装 read write等
- 文件I/O函数(open,read,write,lseek,close)
- I/O read()/write()/pread()/pwrite()/fread()/fwrite
- 文件I/O-003.read和write复制文件
- I/O中read及write各个方法区别
- 文件I/O-004.read和write复制文件 I O效率
- Perl - File I/O
- Perl文件I/O
- Perl Verify PMCoreBasedAD
- .net的组件
- HTML to Image in C#(C#实现Html转换为Image,即网页截图)
- 通过使用resetlog恢复控制文件恢复数据库
- 查询Oracle使用的特性
- Perl I/O Read & Write
- android 电话状态的监听(来电和去电)
- 简介Spring中常用的hql查询方法
- 注册JDBC驱动的三种方式
- 最简单的菜单导航--不兼容IE6
- 虚拟文件路径,轻松搞定某些软件对特殊文件路径不能识别问题
- 黑马程序员——泛型的总结
- sql server例子处理
- android代码格式化方法小结