in reply to Creating an outputfile and processing it at once

its definitely OT $ perl othercode.pl > othercode.out;perl thiscode.pl < othercode.out
  • Comment on Re: Creating an outputfile and processing it at once

Replies are listed 'Best First'.
Re^2: Creating an outputfile and processing it at once
by sk (Curate) on Jul 28, 2005 at 07:49 UTC
    This runs the program twice unnecessarily ;)

    Not sure if it is a big deal or not but not required

    Update: umbra you mentioned that you are on windows and don't have access to tee. In such cases you can write your own tee. It is very simple.

    # Program tee #!/usr/bin/perl -w die "Usage: tee outfile\n" unless @ARGV == 1; open(OUT,'>', $ARGV[0]) or die $!; shift; while (<>) { print OUT; print; } close (OUT) or die $!;

    PS: I wasn't sure how to reply back to you with code as a /msg so decided to update this thread.