Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Questions about curious idiom seen in package

by AnomalousMonk (Chancellor)
on Feb 18, 2019 at 00:35 UTC ( #1230057=note: print w/replies, xml ) Need Help??


in reply to Questions about curious idiom seen in package

... does this leading "undef" really do anything?

It does nothing. It is a compulsive programming tick akin to
    my $scalar = undef;
    my @array = ();
    my %hash = ();
In the latter two cases, I can barely see some occasional justification for the practice because it may relieve the onerous burden of having to write a comment like
    my @ra;  # this array will remain empty until something is put into it
Otherwise...


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^2: Questions about curious idiom seen in package
by karlgoethebier (Monsignor) on Feb 18, 2019 at 15:35 UTC
    “It does nothing”.

    Probably the best behavior for “something” (or how ever you may call it) in Perl.

    May be this is the best thread so far in this year. It made my day. 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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2019-03-18 17:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How do you Carpe diem?





    Results (85 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!