my $q = new CGI; my $filehandle = $q->upload("file"); my $fsize = -s $filehandle; my $fsize_limit = 1000; # Then you use conditional to check them: if ($fsize > $fsize_limit) { # do whatever you want } #### # let's say you have a data captured in textrea textarea( -name => 'sequence', -rows => 10, -columns => 50, -wrap => 'physical' ),br # then you would need to store it into a variable my $seq_var = param('sequence'); # Size of the variable is captured this way: my $fsize = length($seq_var); if ($fsize > $fsize_limit) { # Do whatever you want }