Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
異なるスレッドでHTTPリクエストに使用できる共有LWP::UserAgentオブジェクトを作成することは可能ですか?
短い答えはノーです。これを達成するために共有メモリを使用する方法があるかもしれませんが、可能であったとしても、最後のエラーなどのユーザーエージェント自体に保存されているオブジェクトがあるため、これを実行したくないと思います。 Cookie を同期したい場合は、保持して再利用する Cookie jar を指定することで対応できます (LWP::UserAgent の perldoc から):
$ua->cookie_jar( $cookie_jar_obj )