Re: Newbe needs help

From: Drieux (drieux_at_wetware.com)
Date: 12/06/03

  • Next message: Drieux: "Re: formats"
    Date: Sat, 6 Dec 2003 10:30:35 -0800
    To: Perl Perl <beginners@perl.org>
    
    

    On Dec 5, 2003, at 11:20 PM, sadman wrote:
    [..]
    > i have lert a few basics but still im stuck on a problem ;-(
    [..]
    > What i need to do now is instaed of having the text in the code,
    > have it open up another txt file read the whole txt file and then
    > add all the text from that said file to the end of the outfile,
    > im sure this is simple but ive obviously missed something somewere ;-(

    Now we are moving into the land of choices.

    we need an input file, and an output file
    to append it to???

    say something like

            cat inputfile >> outputfile

    ???
    but in perl in the form

            append_file inputfile outputfile

    ????
            my ($input_file , $output_file) = @ARGV;

            open(IN, "$input_file") or die "problem with inputfile: $!\n";
            open(OUT, ">>$output_file") or die "problem with output_file: $!\n";
            
            print OUT $_ while(<IN>);
            
            close(IN);
            close(OUT);

    ciao
    drieux

    ---
    

  • Next message: Drieux: "Re: formats"

    Relevant Pages

    • Re: Help with pattern matching
      ... then print the line to an output file. ... > replica of the input file. ... In Perl, CamelBack is generall reserved for package names. ... where their meaning must be expressed in comments. ...
      (perl.beginners)
    • Re: coding standards question and RFC
      ... drieux. ... Coming up with a 'coding standard' in any language ... At which point one, in Perl, has already figured ...
      (perl.beginners)
    • RE: Processing one file at a time in BTS 2002
      ... output file, you want to either Append, Overwrite or CreateNew (if exists ... Since you do not want them to append, you should select a unique name by ... using File name macro substitution and CreateNew option. ... refer to BizTalk documentations. ...
      (microsoft.public.biztalk.server)
    • RE: Why wont my script terminate?
      ... No, it's not very big--might be kinda ugly to you expert Perl programmers, ... to this list (DBI version 1.14 written by Tim Bunce for MsWin32). ... Here's my script: ... 'TEST_' to output file names.) ...
      (perl.dbi.users)
    • glob in specific directory
      ... I am writing a DTS package task in perl but am having trouble with the ... script from a specific directory, it's run by the sql server. ... is a user supplied string ... Nothing is getting written to me output file, ...
      (comp.lang.perl.misc)