Advertisement
cd62131

rewrite.pl

May 30th, 2018
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.38 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4.  
  5. sub lines($);
  6.  
  7. while (<>) {
  8.   my ($x, $y) = split;
  9.   my $xs = lines $x;
  10.   my $ys = lines $y;
  11.   while (@$xs || @$ys) {
  12.     print shift @$xs if @$xs;
  13.     print "\t";
  14.     print shift @$ys if @$ys;
  15.     print "\n";
  16.   }
  17. }
  18.  
  19. sub lines($) {
  20.   my $line_ = shift;
  21.   my @lines_ = split /。/, $line_;
  22.   chomp @lines_;
  23.   return \@lines_;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement