in reply to How to split a non even number of string elements into a hash [RESOLVED]
If you don't want the warning, just silence it:
#!/usr/bin/perl use strict; use warnings; no warnings 'misc'; use Data::Dumper; my $str = "one 1 two 2 three 3 odd_element"; my %hash = split / /, $str; print Dumper \%hash;
You can (and should), limit the scope of such silencing further.
This isn't to say that your initial situation doesn't smack of some deeper problem which maybe ought to be addressed.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to split a non even number of string elements into a hash
by thanos1983 (Parson) on Feb 09, 2017 at 14:22 UTC | |
by AnomalousMonk (Archbishop) on Feb 09, 2017 at 17:20 UTC |