sub addMyFile{ my $file = shift; my $fullpath = "$edmdir\\$file"; my $addpres = $ppt->Presentations->Open( $fullpath ) or die "Can't open PowerPoint file '$fullpath': $!\n"; my $j = 1; my $slide; my $newslide; while ($j < 10){ # this is hard coded while i figure out the bugs, but it will be length of the file $newslide = $pres -> Slides->Add($slideIndex,$addpres->Slides($j)->Layout); $newslide = $addpres->Slides($j); $j++; $slideIndex++; } };