#!/usr/bin/perl -w use strict; my $stream; while (<>) { $stream .= $_; } print "Do you want to process the stream?"; my $ans = ; #... exit;