September 22, 1999 Strong Typing Slide #34

Run-Time Type Checking

use strict 'refs'

        $s = 'somestring';
        $$s = 17;               # Sets $somestring to 17
        use strict 'refs';
        $$s = 17;               # Run-time error
                Can't use string ("somestring") as a SCALAR ref 
                while "strict refs" in use ...

-w

        $s = 'some string';
        $r = $s + 13;           # Run-time warning
                Argument "some string" isn't numeric in add ...


Next Copyright © 1999 M-J. Dominus