seek( DATA, 30, 0 ); # Get DATA handle to first line of code (after "use strict") local $/; # slurp $_ = ; # file source /8{6}(.*)8{6}/s; # Between groups of 6 8's (from code end) ( $a = $1 ) =~ s/\s+(8+\s+)*//g; # Remove center "hole" (from copy) $a =~ s/X/\040/g; # X are spaces my @eight = split /888/, $a; # 3 eights marks separation between sentences @eight = split /8/, $eight[ rand(20) ]; # take one of this random answers and split on 8's (lines?) # Put answer on ceter hole (that's what I don't know exactly how works s/ (\s+88\s*(8?88)?\s+) # Center hole. / $b=int((length($1)-length($eight[0]))\/2); # $b is half of the space left sprintf("%-".length($1)."s","\040"x$b.shift(@eight)) # $b spaces and word shifted from @eight, padded to total space. This "centers" the text in the hole /xeg; #s/(\s+88\s*(8?88)?\s+)/$b=int((length($1)-length($eight[0]))\/2);sprintf("%-".length($1)."s","\040"x$b.shift(@eight))/eg; print; # and print "88888888888X8Outlook888888Good8888Outlook8NotXSo8Good88888888MyXReply8IsXNo8888Don't8Count888888OnXIt8888YouXMay8RelyXOnXIt88888888Ask8Again8Later8888Most8Likely888888888Cannot8Predict8Now8888X8Yes8888Yes8Definately8888Better8NotXXTell8YouXNow8888ItXIs8Certain8888Very8Doubtful8888ItXIs8Decidedly8So8888Concentrate8and8Ask8Again8888Signs8Point8ToXYes8888MyXSources8SayXNo8888Without8a8Doubt888Reply8Hazy,8Try8Again8888AsXIXSee8It,XYes888888"