in reply to Re: no exit! (return)
in thread no exit!

No...
MATCHED IT insert value/count mismatch: no insert value entered pased*********************

Replies are listed 'Best First'.
Re^3: no exit! (return)
by Corion (Patriarch) on Aug 14, 2015 at 17:53 UTC

    Please restructure your code as follows:

    if ($insql =~ m/.*~\w+~.*/) { print "MATCHED IT\n";} errmsg(1); die; };

    You don't show the code of errmsg, but most likely it really returns a false value and thus prevents the die from executing.

Re^3: no exit! (return)
by stevieb (Canon) on Aug 14, 2015 at 18:08 UTC

    If the left side of && is false, the right side will never be executed. Compare:

    This does not die...

    errstr() && die if (1); sub errstr { return 0; }

    This does:

    if (1){ errstr(); die; } sub errstr { return 0; }