in reply to How to limit upload file size?

Set the $CGI::POST_MAX variable to the number of bytes of the desired limit. The documentation recommends that it be a megabyte or so, because it works on file uploads and ordinary POST requests.

Update: Unfortunately, I seem to have misinterpreted your post as saying that you'd moved *away* from cgi_lib.pl *to* CGI.pm. Since I was backwards, I can only recommend you look into the ReadParse() method in CGI for compatibility purposes.

cgi_lib.pl is pretty limited and hasn't been updated in years.