Term::Readline::readlineで無限の while ループを停止する正しい方法は何ですか?
このように私は単一で読むことができません0
#!/usr/bin/env perl
use warnings;
use strict;
use 5.010;
use Term::ReadLine;
my $term = Term::ReadLine->new( 'Text' );
my $content;
while ( 1 ) {
my $con = $term->readline( 'input: ' );
last if not $con;
$content .= "$con\n";
}
say $content;
そして
last if not defined $con;
ループは決して終わりません。