fork download
  1. use Data::Dumper;
  2.  
  3. my @input_lines = <main::DATA>;
  4. my $input_string = join /\n/, @input_lines;
  5. my @blocks = split(/\s*#+\s*/, $input_string);
  6. my @matches = ();
  7. push @matches, [ split(/\s*[\n\r]+\s*/, $_) ] for @blocks;
  8.  
  9. print Dumper(@matches);
  10.  
  11. __DATA__
  12. google.com/test
  13. yahoo.com/test
  14. ##############
  15. somethingelse.com/test
  16. ##############
  17. 12345
Success #stdin #stdout 0.01s 5116KB
stdin
Standard input is empty
stdout
$VAR1 = [
          'google.com/test',
          'yahoo.com/test'
        ];
$VAR2 = [
          'somethingelse.com/test'
        ];
$VAR3 = [
          '12345'
        ];