in reply to Re: appending files
in thread appending files

Thank you both for your response.
Unfortunately, I didn't fully understand Smokemachine's script was doing.
BrowserUK, When I ran the above code, I continue to get the following error (for both lines): Use of uninitialized value in concatenation (.) or string at testscr.pl
As I am calling this within another perl script, I added backticks to the beginning and the end of the statement. But everything else remains the same (given that I am using the actual filenames within this line of code).
I've also tried the following code which seems to compile without any errors but the appended file is blank. Can someone help me see what I'm doing wrong here?
#accts_to_load.txt contains the filenames of al the files I want to ap +pend together $acctstoload = "/apps/tmp/invs/accts_to_load.txt"; open(ACCTLOAD, $acctstoload) || die("cannot open $acctstoload"); #Here, I want to give a specific name to the file all the split files +are being merged into $batchfile = "mergedfile.txt"; while(<ACCTLOAD>) { `cat $_ >> $batchfile`; }
I'm not sure what i'm doing wrong. Any suggestions would be appreciated. Thanks.

Replies are listed 'Best First'.
Re^3: appending files
by BrowserUk (Patriarch) on Jan 04, 2006 at 05:26 UTC
    Unfortunately, I didn't fully understand Smokemachine's script was doing.

    Did you write the script you are attempting to modify or extend?

    Which is more important to you in the short term?

    • Getting this script to work.
    • Learning how to make this script work yourself?

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.