in reply to how to print dynamicaly ?

You code is incomplete, see How do I post a question effectively?, see perlintro

1.if only print this array only

What does that mean?

2. how to print dynamicaly

What does that mean?

am tried $id_chap++ but not working , here using array concept

Why, what did you think it would do?

Have you read perlintro, specifically Arrays and foreach