No, you do not understand. The insert method inserts a string into a widget, but it returns an empty string (see return). You can use or die only on functions that return something on succes and undef (emtpy string, zero) on failure. insert does not behave this way, therefore, it cannot be used in or die construction.