part2
This commit is contained in:
parent
2add78c252
commit
a10c861f4c
24
09/2.pl
Normal file
24
09/2.pl
Normal file
@ -0,0 +1,24 @@
|
||||
use 5.20.0;
|
||||
|
||||
my $stream = <>;
|
||||
chomp $stream;
|
||||
|
||||
my $garbage;
|
||||
$stream = clean_stream($stream);
|
||||
|
||||
say $garbage;
|
||||
|
||||
use experimental qw/signatures /;
|
||||
|
||||
sub clean_stream($s) {
|
||||
|
||||
return $s unless $s =~ s/^(.*?)<//;
|
||||
|
||||
while( $s =~ s/^(.*?)(!.|>)// ) {
|
||||
warn $1;
|
||||
$garbage += length $1;
|
||||
last if $2 eq '>';
|
||||
}
|
||||
|
||||
clean_stream($s);
|
||||
}
|
Loading…
Reference in New Issue
Block a user