in reply to Re: Why use warnings? -w
in thread Why use warnings? -w

"...not using gotos..."

It depends. See Re^2: A meditation on the naming of perl6 ;-)

Best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

Replies are listed 'Best First'.
Re^3: Why use warnings? -w
by alexander_lunev (Pilgrim) on Mar 05, 2018 at 10:28 UTC

    I don't see why you need goto there ;)

    #!/usr/local/bin/perl -w use strict; use warnings; use feature qw(say); $SIG{INT} = sub { die q(Nuff said!); }; say q(Did you post some valid code today?); my $answer; while (not defined $answer) { chomp( $answer = <STDIN> ); $answer = lc $answer; my %dispatch = ( 'yes' => sub { say q(Good!) }, 'no' => sub { say q(Bad!) }, 'nada' => sub { say q(Answer yes or no!); undef $answer; } ); ( $dispatch{$answer} || $dispatch{nada} )->(); }
      "...you need goto there"

      Yes sure. In dubio pro reo. Let's assume that it's a TIMTOWTDI.

      Best regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

      perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

        Let's assume that it's a TIMTOWTDI.
        It is exactly the thought that came to me right after I send the comment.