ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-users
perl-win32-users
RE: display a hash...
by bruce other posts by this author
Aug 1 2004 3:58AM messages near this date
view in the new Beta List Site
Re: display a hash... | Re: display a hash...
does perl provide a function similar to the 'C' sizeof that i can apply to a
HASH/Structure to determine it's size...

when dealing with sockets. i need a way of determining the size of the
information that i pass back to the client...

thanks...

-bruce



-----Original Message-----
From: perl-win32-users-bounces@[...].com
[mailto:perl-win32-users-bounces@[...].com]On Behalf Of
$Bill Luebkert
Sent: Saturday, July 31, 2004 7:48 PM
To: bedouglas@[...].net
Cc: perl-win32-users@[...].com
Subject: Re: display a hash...


bruce wrote:

>  hi...
> 
>  i have a hash from the mysql_connect... i'd like to know if there is a
quick
>  way to examine/display the contents of a hash...
> 
>  i get -->>dbh = DBI::db=HASH(0x81a15e8)

You can use Data:Dumper for just a raw look at the entire structure.

You can foreach over the keys or values in a loop if you know what
you want and it's a simple hash.

	foreach (keys %hash) {
		print "$_ = $hash{$_}\n";
	}

--
  ,-/-  __      _  _         $Bill Luebkert    Mailto:dbecoll@[...].net
 (_/   /  )    // //       DBE Collectibles    Mailto:dbe@[...].com
  / ) /--<  o // //      Castle of Medieval Myth & Magic
http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
bruce
$Bill Luebkert
bruce
$Bill Luebkert

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved