U
usenet
According to perldoc -f chomp:keys.
Is there an easy way to "overcome" this? Kindly consider this code
which illustrates my motivation for asking:
#!/usr/bin/perl
use strict; use warnings;
use Data:umper;
chomp (my %person = (<DATA>));
print Dumper \%person;
__DATA__
name
fred
occupation
quarryman
friend
barney
The keys, of course, have linefeeds on the end, which I do not want.
What is the best way to populate my hash with linefeed-ed data? Must I
build a 2-at-a-time loop and populate one pair per iteration? That
seems like a crummy solution!
Thanks!
Is there an easy way to "overcome" this? Kindly consider this code
which illustrates my motivation for asking:
#!/usr/bin/perl
use strict; use warnings;
use Data:umper;
chomp (my %person = (<DATA>));
print Dumper \%person;
__DATA__
name
fred
occupation
quarryman
friend
barney
The keys, of course, have linefeeds on the end, which I do not want.
What is the best way to populate my hash with linefeed-ed data? Must I
build a 2-at-a-time loop and populate one pair per iteration? That
seems like a crummy solution!
Thanks!