in reply to handling scripts options

Getopt::Std stops looking for arguments at the first non-argument argument (i.e. an argument that doesn't start with a dash). If you use Getopt::Long instead (which you've already got used anyhow for some reason . . .) it should behave more like you expect.

The cake is a lie.
The cake is a lie.
The cake is a lie.