Algorithm-BreakOverlappingRectangles

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

  }
  exit 0;
}

# Scan for possible replacement candidates

my(%replace, %need, %hints, %depends);
my $replace = 0;
my $hint = '';

while (<DATA>) {
  if ($hint) {
    if (m{^\s*\*\s(.*?)\s*$}) {
      $hints{$hint} ||= '';  # suppress warning with older perls
      $hints{$hint} .= "$1\n";
    }
    else {
      $hint = '';
    }
  }
  $hint = $1 if m{^\s*$rccs\sHint:\s+(\w+)\s*$};

ppport.h  view on Meta::CPAN


  exit 2;
}

sub strip
{
  my $self = do { local(@ARGV,$/)=($0); <> };
  my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
  $copy =~ s/^(?=\S+)/    /gms;
  $self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
  $self =~ s/^SKIP.*(?=^__DATA__)/SKIP
if (\@ARGV && \$ARGV[0] eq '--unstrip') {
  eval { require Devel::PPPort };
  \$@ and die "Cannot require Devel::PPPort, please install.\\n";
  if (\$Devel::PPPort::VERSION < $VERSION) {
    die "$0 was originally generated with Devel::PPPort $VERSION.\\n"
      . "Your Devel::PPPort is only version \$Devel::PPPort::VERSION.\\n"
      . "Please install a newer version, or --unstrip will not work.\\n";
  }
  Devel::PPPort::WriteFile(\$0);
  exit 0;

ppport.h  view on Meta::CPAN


END
/ms;

  open OUT, ">$0" or die "cannot strip $0: $!\n";
  print OUT $self;

  exit 0;
}

__DATA__
*/

#ifndef _P_P_PORTABILITY_H_
#define _P_P_PORTABILITY_H_

#ifndef DPPP_NAMESPACE
#  define DPPP_NAMESPACE DPPP_
#endif

#define DPPP_CAT2(x,y) CAT2(x,y)

samples/s1.pl  view on Meta::CPAN

#!/usr/bin/perl

use warnings;
use strict;

use Algorithm::BreakOverlappingRectangles;

my $a = Algorithm::BreakOverlappingRectangles->new;

while(<DATA>) {
    next if /^\s*$/;
    chomp;
    $a->add_rectangle(split/,/);
}

$a->dump;

# 10,10,13,11,f
# 10,10,11,13,g

__DATA__
0,1,5,5,a
2,2,6,6,b
2,2,3,3,c
1,0,2,10,d
0,2,7,3,e
0,0,1,10,f




( run in 0.579 second using v1.01-cache-2.11-cpan-140bd7fdf52 )