All pastes #348005 Raw Edit

Reading from STDIN after first EOF

public text v1 · immutable
·published 2007-02-09 21:15 UTC
rendered paste body
Hvordan får man det her til at virke?

#! /usr/bin/perl

use strict;
use warnings;

my @lines;
my $line;
while ($line = <STDIN>) {
    push @lines,$line;
}
#STDIN->clearerr;
#seek(STDIN, 0, 1);

my $input;
foreach $line (@lines) {
    print "$line";
    $input = <STDIN>;
    print "You said $input\n";
}