rjsaulakh has asked for the wisdom of the Perl Monks concerning the following question:
i have a large no of .htm files in a specified directory and i need to combine all this files into one .htm file i am trying with the following piece of code but it is not able to open the file . please help
#!/usr/bin/perl #use strict; use warnings ; opendir(DIR, "/home/rjs/perl/perlnut/") or die "cant open the specfied + directory $!"; my @file = readdir(DIR); #my $book = final.htm; open(OUT, ">book") or die "Can't create book: $! \n "; + foreach (sort @file) { local(*IN); open( IN, $_) or die "cant raman open $_ : $!\n "; print OUT while <IN>; close (IN); + }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: combining multiple files into one file
by jwkrahn (Abbot) on Jun 23, 2006 at 11:38 UTC | |
Re: combining multiple files into one file
by GrandFather (Saint) on Jun 23, 2006 at 11:20 UTC | |
Re: combining multiple files into one file
by rev_1318 (Chaplain) on Jun 23, 2006 at 13:36 UTC | |
Re: combining multiple files into one file
by leocharre (Priest) on Jun 23, 2006 at 14:14 UTC |
Back to
Seekers of Perl Wisdom