Name : perl-Tie-Autotie
| |
Version : 0.03
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : 6.64
| Date : 2024-08-05 20:07:00
|
Group : Development/Libraries/Perl
| Source RPM : perl-Tie-Autotie-0.03-6.64.src.rpm
|
Size : 0.01 MB
| |
Packager : (none)
| |
Summary : Automatically ties underlying references
|
Description :
This module allows you to automatically tie data structures contained in a tied data structure. As an example:
use Tie::Autotie \'Tie::IxHash\';
tie my(%hash), \'Tie::IxHash\';
$hash{jeff}{age} = 22; $hash{jeff}{lang} = \'Perl\'; $hash{jeff}{brothers} = 3; $hash{jeff}{sisters} = 4;
$hash{kristin}{age} = 22; $hash{kristin}{lang} = \'Latin\'; $hash{kristin}{brothers} = 1; $hash{kristin}{sisters} = 0;
for my $who (keys %hash) { print \"$who:\ \"; for my $what (keys %{ $hash{$who} }) { print \" $what = $hash{$who}{$what}\ \"; } }
This program outputs:
jeff: age = 22 lang = Perl brothers = 3 sisters = 4 kristin: age = 22 lang = Latin brothers = 1 sisters = 0
You can see that the keys of %hash are returned in the order in which they were created, _as well_ as the keys of the sub-hashes.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-T/openSUSE_Tumbleweed/noarch |