aded a pop function to the pages to help prevent short or blank pages.

This commit is contained in:
Jacob Haddon 2024-11-09 18:34:35 -05:00
parent f918b39f5a
commit 86f6396bdb

View File

@ -206,6 +206,9 @@ for ( my $l; $l < $number_of_pages; $l++){
# pull out a random chapter from that book
my $chapter_select = int(rand($chapter_list));
# pop off the last page, as it may be blank, or short
pop @{$books[$book_list]{'pages'}[$chapter_select]};
# get the number of pages in the chapter
my $page_list = @{$books[$book_list]{'pages'}[$chapter_select]};
# pull out a random page from the chapter