See how I did it here
It is assumed that you are creating a platformer, or are you using it from top to bottom?
However, since you need chunks, using how I did this may not work so well, so you can use this perlin noise implementation and use it as shown in the link below. You can look here for pieces
Cyral source share