in reply to can't access dn within ldif file

You are accessing:
$ldif->{'asn'}{'objectName'} # Does not exist
instead of
$entry->{'asn'}{'objectName'} # Dumper shows this exists

                We're living in a golden age. All you need is gold. -- D.W. Robertson.

Replies are listed 'Best First'.
Re^2: can't access dn within ldif file
by 3dbc (Monk) on Dec 27, 2017 at 15:15 UTC
    That worked, THANK YOU!!!

    what an ID10T error!

    at least someone on here can understand me because everyone sitting next to me or around me has no F'ing idea what I'm talking about!!!

    Happy Holidays PERL MONKS!!

    More ramblings...

    print "\n\n" . "this is the nycbidcreatedon: " . $entry->{'attrs'} +{'idcreatedon'} . "\n\n"; print "\n\n" . "this is the nycbfriendlyid: " . $entry->{'attrs'}{ +'friendlyid'} . "\n\n"; print "\n\n" . "this is the DN!! " . $entry->{'asn'}{'objectName'} + . "\n\n"; # Dumper shows this exists

    above $entry's don't work for idcreatedon or friendlyid within the while( not $ldif->eof ( ) ) { loop, I'll try within the foreach my $key (keys %{$ldif}) { loop instead. guess that ldif read entry is a special way to hop through the HoH.
    But I can get those other elements in there using:
    while( not $ldif->eof ( ) ) { #loop print $entry->get_value("IdCreatedOn")."\n"; print $entry->get_value("FriendlyId")."\n";
    strange.
    - 3dbc
      Try:
      $entry->{'attrs'}{'idcreatedon'}[0] $entry->{'attrs'}{'friendlyid'} [0]
      If your version of "get_value" fails, try this (ALL untested):
      print $entry->get_value("idcreatedon")."\n"; print $entry->get_value("friendlyid")."\n"; # The hash index is case-sensitive, and "get_value" documentation dema +nds 'exact match'
      UPDATE: Removed attempt to do $entry->{attrs}->get_value, because 'get_value" already references the has index attrs first.

                      We're living in a golden age. All you need is gold. -- D.W. Robertson.