Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^9: Parsing problem

by kcott (Chancellor)
on Nov 16, 2012 at 09:02 UTC ( #1004157=note: print w/replies, xml ) Need Help??


in reply to Re^8: Parsing problem
in thread Parsing problem

Your problem here is that the number after 'FT        /colour=' (in this case "4"), is used as a key for %cod but you've only assigned @cod{qw{1 2 3}}. Using the following line solved the problem for me (you'll probably want a different value):

my %cod = ( 1 => "red", 2 => "non", 3 => "green", 4 => 'value for key +4' );

Alternatively, you can check $cod{$1} before using it:

if ( exists $cod{$1} and $cod{$1} eq "non" ) { printf ...

-- Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004157]
help
Chatterbox?
[corenth]: I'm a pragmatic free-software advocate. I'll play in a walled sandbox when I need to.
[erix]: hm, there's a FANN perl module - looks a bit old
[Cosmic37]: I'm afraid I don't know the answer to your map question...... what were the references too?
[corenth]: each reference was to a fairly small scaler.
[corenth]: I mean, array of scalers. usually triples.
[Cosmic37]: there is a FANN discussion group but seems to have gone quiet... http://leenissen. dk/fann/forum/ viewforum.php?f=18 &sid=1afc1fb3fa1a3 7f52b03e40d05cdaaa 3

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2018-02-20 18:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (274 votes). Check out past polls.

    Notices?