fork(3) download
  1. #!/usr/bin/perl
  2. # your code goes here
  3. my @numbers;
  4. while(chomp(my $line=<DATA>)){
  5. if($line =~ m|\[(.*),(.*)\]|){
  6. push @numbers, ($1,$2);
  7. }
  8. }
  9. print @numbers;
  10. __DATA__
  11. this is the range of values [a1,b1]
  12. this is the range of values [a2,b2]
  13. this is the range of values [a3,b3]
Success #stdin #stdout 0s 3564KB
stdin
Standard input is empty
stdout
a1b1a2b2