in reply to Find name of calling script?

XY Problem?

I can't help, this smells bad and will probably end as a maintainance nightmare.

I think perl scripts should not call each other. Start one perl script and share code by using shared modules instead of calling other scripts.

Depending on the name of the caller also "stinks", and I think it should be avoided (except for very good reasons -- like busybox). If you need different behaviour, call two different functions from the scripts. They can probably be as simple as ...

sub behaviourOne { return commonCode('one'); } sub behaviourTwo { return commonCode('two'); }

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)