Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: How to get 0 to initialize a value

by hippo (Bishop)
on Apr 30, 2019 at 11:29 UTC ( [id://1233184]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to get 0 to initialize a value
in thread How to get 0 to initialize a value

SSCCE:

use strict; use warnings; use Test::More tests => 1; use Test::NoWarnings; my $characters = { Bink => { Name => 'Bink', book => 'M1, M2, m3, m4, 6, m7, M9, m11, m13, 14, 17, m19, m21, M22, + m23, m31, 35, 36, m37, m40, m41', }, Quan => { Name => 'Quan', book => '0', }, }; my @book_list; for my $key (keys %$characters) { my $character = $characters->{$key}; my $name = $character->{Name}; # about 30 more lines of code to munge the data my @novels = split(/, /, $character->{book}); # line 132 in code my $first_book = $novels[0]; my $first_type = $first_book =~ /^M/ ? 'major' : $first_book =~ /^m/ + ? 'mentioned' : undef; # line 134 in code $first_book =~ s/\D//g; # line 135 in code $character->{intro}->{book} = $book_list[$first_book]; # line 136 in + code $character->{intro}->{type} = $first_type; $character->{book} = \@novels; # about 30 more lines of code to munge the data }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-03-29 09:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found