in reply to Re^4: Unable to declare local variable with "use strict".
in thread Unable to declare local variable with "use strict".

I beg to differ. The solution I recommended uses my and works quite well. While changing to my alone is not enough..

You're doing it again.

  • Comment on Re^5: Unable to declare local variable with "use strict".

Replies are listed 'Best First'.
Re^6: Unable to declare local variable with "use strict".
by ikegami (Patriarch) on Mar 27, 2010 at 16:46 UTC

    Did you run it? Maybe if you told us what error you got?

    #!/usr/bin/perl -w use strict; ref_test1(); sub ref_test1 { print "Here in ref_test1.\n"; ref_test2("connect"); } sub ref_test2 { my ($type) = @_; print "Type: $type\n"; print "Here in ref_test2\n"; }
    Here in ref_test1. Type: connect Here in ref_test2