So, what does $cgi->param('sid') return in myaccount.pl?
Have you tried debugging what your scripts think what is in the session? Most likely some value in your input data is not what you think it should be. As you already have a working example in welcome.pl and an example that does not wwork in myaccount.pl, it should be easy to find out what myaccount.pl does differently from welcome.pl. Maybe the input to myaccount.pl is different from the input to welcome.pl.
You could also consider storing the session information in a cookie instead of passing the session around as an URL parameter. Most of the common "easy" frameworks like Mojolicious and Dancer already do that for you. With them, you also don't need to split up your application into separate programs for each different page.
Also note that in HTTP, a redirect should always be an absolute URL, not a relative URL. So you should better use Location: http://example.com/hello.pl instead of Location: hello.pl.