Help for this page

Select Code to Download


  1. or download this
    #!perl -w
    use strict;use warnings; 
    ...
    sub Main { 
    Switch {print "hi\n";return;}
    }
    
  2. or download this
    hi
    
  3. or download this
    #!perl -w
    use strict;use warnings; 
    use Switch; 
    Switch {my $a=1};
    
  4. or download this
    Can't locate object method "Switch" via package "1" (perhaps you forgo
    +t to load "1"?) at switch.pl line 4.
    
  5. or download this
    #!perl -w
    use strict;use warnings; 
    use Switch; 
    Switch {my $a=1;return};
    
  6. or download this
    Can't return outside a subroutine at switch.pl line 4.