in reply to Re: Hash Ref Error
in thread Hash Ref Error
The OPed code should work fine with any Perl version:
(5.8 is the earliest I can test.)c:\@Work\Perl>perl -wMstrict -MData::Dump -le "print qq{perl version: $] \n}; ;; my %my_data = (names => 'AbCdEfGh', states => 'FooBarBaz'); my $my_data_ref = \%my_data; ;; my @all_names = split /(?=[[:upper:]])/, ${ $my_data_ref } { names }; dd \@all_names; ;; my @ra = split /(?=[[:upper:]])/, $my_data_ref->{states}; dd \@ra; " perl version: 5.008009 ["Ab", "Cd", "Ef", "Gh"] ["Foo", "Bar", "Baz"]
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Hash Ref Error
by stevieb (Canon) on Sep 15, 2015 at 22:29 UTC |