A parent process cannot inherit from a process it spawns.
in reply to Re^2: Source command in perl script
in thread Source command in perl script
You can however set the environment within the Perl script and then the system call will inherit it or you could run the db2profile scipt prior to running the Perl script and then everything would inherit it.
Rewriting as Perl
Or calling everything from a shell script...
/home/db2instl/bin/stop_db.pl # Or whatever the script is called
print "Good ",qw(night morning afternoon evening)[(localtime)/6]," fellow monks."