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

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} )->(); }

Replies are listed 'Best First'.
Re^4: Why use warnings? -w
by karlgoethebier (Abbot) on Mar 05, 2018 at 15:25 UTC
    "...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.