in reply to Detect * in arguments

Please post a simple version of your code.
AND a couple of examples of the command lines that you don't seem to be able to process.

I don't know where this 256 character limit comes from.
Certainly not from Perl. In Unix, in the olden days, a fairly normal restriction would be 7 full command lines, which would be 7x80 characters or 560. More normal now would be at least 1024 or 2048 characters or even 4096 or even more than that. I don't know why you can't process a huge command line.

It is certainly possible that the shell can expand *.txt into perhaps 2,000 or many, many more file names.

Show some code and example command line inputs. With proper technique, it should be possible to say process an expanded command line with 5,000 arguments with no problem whatsoever.