[EMAIL PROTECTED] wrote:

> Hi All,
>
> Sorry if this is a stupid question.  It took me awhile to figure out I
> could use the File::Copy module to copy a file, and this is about the same
> level of ignorance.
>
> Is there an easy way to concatenate two (text) files in Perl, short of
> opening two to read and one to write and then loop loop looping the two
> input files into the output file?
>
> TIA,
> Peter

Chars2.pl:  # Before
my $SourceString = "Hello, World!";
my @CharArray = split //, $SourceString;
foreach  (@CharArray) {
    print "$_\n";
}
***********************
append.pl:
#!/usr/bin/perl -w

use strict;

open IN, "build.pl" or die "Could not open source: $!\n";
open APPEND, ">> Chars2.pl" or die "Could not open target: $!\n";

while (<IN>) {print APPEND;}
close IN;
close APPEND;

**********************************
Chars2.pl   #  After:
my $SourceString = "Hello, World!";
my @CharArray = split //, $SourceString;
foreach  (@CharArray) {
    print "$_\n";
}

#!/usr/bin/perl -ww
open(BLD_LIST,"buildlist");
my @pkg=<BLD_LIST>;
...
...

system("/home/mike/rmla");       # __LINE__ ==  172
};

Joseph



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to