How can I iterate through nested arrays?

后端 未结 5 660
独厮守ぢ
独厮守ぢ 2021-01-22 03:59

I have created an array as follows

while (defined ($line = ``))

        {
        chomp ($line);
        push @stack,($line);
        }
         


        
5条回答
  •  礼貌的吻别
    2021-01-22 04:31

    #!/usr/bin/perl
    
    use strict;
    use warnings;
    open IN, "< read.txt" or
        die "Can't read in 'read.txt'!";
    
    my $content = join '', ;
    
    while ($content =~ m`(\d+)`g) {
        print "$1\n";
    }
    

提交回复
热议问题