Page breaks and page numbers in perl

Hi,

I need to code for number of sets, page start and end numbers based on number of pages provided. For example if I have 153000 pages there will be 4 sets based on the fact that each set gets 50000 pages each. So the page numbers would be 1-50000, 50001-100000, 100001-150000, 150001-153000. How do I achieve this using Perl script?

What do you mean by "page"?
Can you give an example?

Like a Pdf with pages.

@gaun, not sure what you are after... , below a bash script that might be suited, if not , you need to supply unambiguous details ( ideally with a fully worked example showing inputs and expected results ) so the team can come back with suggestions. A reminder that the forum is primarily a collaboration, show show working and ask how if fix/improve etc, we supply those ( perhaps multiple iterations of)

cat rng.sh
#!/bin/bash

	startS=$1
	lower=$1
	endS=$2
	sizeD=$3
	ranges=$(( (endS - startS + 1) / sizeD + 1 ))

	[[ $# -ne 3 ]] && echo "(missing args) USAGE: $0 start:$startS end:$endS size:$sizeD" && exit 1
	
	[[ $startS -gt $endS ]] && echo "Error: start ($startS) must be <= end($endS)" && exit 2
	
	[[ $sizeD -le 0 ]] && echo "Error: range size ($sizeD) must be > 0" && exit 3
	
	
	for (( i=0; i < $ranges; i++ ))
	do
		upper=$(( lower + sizeD - 1 ))
		[[ $upper -gt $endS ]] && upper=$endS
		printf "( %d, %d )\n" $lower $upper
		lower=$(( lower + sizeD ))
	done
./rng.sh 1 50000 8000
( 1, 8000 )
( 8001, 16000 )
( 16001, 24000 )
( 24001, 32000 )
( 32001, 40000 )
( 40001, 48000 )
( 48001, 50000 )

./rng.sh 1 250 71
( 1, 71 )
( 72, 142 )
( 143, 213 )