Okay, take this code as an example:
Presuming I haven't typo'd, that should return 1024 and a newline.
Now, let's change to $rom_name='23did.345'
If I attempt to print that line I'll get this error:
Use of uninitialized value in concatenation (.) at ./audit.pl line <line number>.
Now, if instead I do:
I get the proper return.
How do you compensate for this? Obviously it's okay to have the period in the variable name, but I have no idea as to how to specify that...?
Code:
Where game_info is a hash
#!/usr/bin/perl -w
use strict;
use warnings;
$game='pacman';
$rom_name='fdjkl23jkl'
$rom_key='size';
$rom_val='1024';
$game_info{$game}{rom}{$rom_name}{$rom_key}=$rom_val;
print "$game_info{$game}{rom}{$rom_name}{$rom_key}\n";
Presuming I haven't typo'd, that should return 1024 and a newline.
Now, let's change to $rom_name='23did.345'
If I attempt to print that line I'll get this error:
Use of uninitialized value in concatenation (.) at ./audit.pl line <line number>.
Now, if instead I do:
Code:
print "$game_info{$game}{rom}{'23did.345'}{$rom_key}\n";
I get the proper return.
How do you compensate for this? Obviously it's okay to have the period in the variable name, but I have no idea as to how to specify that...?