Perl's eval() definitely is not a constant-time operation. It definitely varies with the length and complexity of its input. I'd imagine it's at least O(n) with n being the length of the input string, but it's probably O(n*m*j*k*l) with the definition of m, j, k and l left as an exercise for the reader.