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

Re: How to get 0 to initialize a value

by tangent (Vicar)
on Apr 30, 2019 at 02:38 UTC ( #1233168=note: print w/replies, xml ) Need Help??


in reply to How to get 0 to initialize a value

When I run your code I do not get the warnings you mention, but this line:
my $first_novel = $novel_list->[$first_book];
does give a warning fatal error (praise be to monk of anomaly). @novel_list is a plain array not an array reference - it should be:
my $first_novel = $novel_list[$first_book];

Replies are listed 'Best First'.
Re^2: How to get 0 to initialize a value
by AnomalousMonk (Bishop) on Apr 30, 2019 at 03:58 UTC
    ... this line:

    my $first_novel = $novel_list->[$first_book];

    does give a warning.

    It does not give a warning, it fails to compile due to a fatal error from a stricture that was (wisely!) enabled (use strict; statement at start of code; see strict). You may say this is a trivial difference, but a warning is not fatal — unless you explicitly make it so!


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2019-10-15 00:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?