perl中的队列

2015-12-14 0 1,004
perl中的队列
#!/usr/bin/perl
use strict;
#use warnings;
use feature 'say';

 
my @people = ("Foo", "Bar");
while (@people) {
    my $next_person = shift @people;
    print "$next_person\n"; # do something with this person
 
    print "Type in the names of more people:";
    while (my $new = <STDIN>) {
        chomp $new;
        if ($new eq "") {
            last;
        }
        push @people, $new;
    }
    print "\n";
}

遇见资源网 perl perl中的队列 http://www.ox520.com/13106.html

上一篇:

已经没有上一篇了!

下一篇:

已经没有下一篇了!

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务