Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Why use warnings? -w

by alexander_lunev (Pilgrim)
on Mar 05, 2018 at 10:28 UTC ( [id://1210346]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1210346]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-20 04:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found