More elaborate and coprehensive tutorial in http://learn.perl.org/books/beginning-perl/, Learn Perl in about 2 hours 30 minutes, perlintro, chromatics free book Modern Perl a loose description of how experienced and effective Perl 5 programmers work....You can learn this too.
#!/usr/bin/perl -- use strict; use warnings; use Data::Dump qw/ dd /; use Data::Diver qw/ Dive /; my $aref = [ bless( { 'name' => 'Name', 'url' => '/vmfs/volumes/guidvalue' }, 'VirtualMachineConfigInfoDatastoreUrlPair' ) ]; dd( $aref ); my $href = Dive( $aref, 0 ); dd( $href ); my $name = Dive( $aref, 0 , 'name' ) ; my $url = Dive( $aref, 0 , 'url' ) ; dd( "$name $url" ); __END__ [ bless({ name => "Name", url => "/vmfs/volumes/guidvalue" }, "Virtual +MachineConfigInfoDatastoreUrlPair"), ] bless({ name => "Name", url => "/vmfs/volumes/guidvalue" }, "VirtualMa +chineConfigInfoDatastoreUrlPair") "Name /vmfs/volumes/guidvalue"
In reply to Re: help on dereferencing structure
by Anonymous Monk
in thread help on dereferencing structure
by natxo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |