If I understand your code correctly, the part before the "=>" is the keys
in a hash table, and the part after "=>" is stored as the value of the
corresponding key. You could therefore get the part you want from
$table->{$oid}, where $table is the name of the hash table, and $oid is the
key (e.g. "1.3.6.1.4.1.9.10.19.1.3.1.1.8.100437591.0").
This should print only the part you want:
foreach my $oid (oid_lex_sort(keys(%{$table}))) {
printf("%s\n", $table->{$oid});
}
I'm not sure this is what you were looking for. Where do get the data from,
i.e. are they stored in a hash table and you would like to print them (as I
assumed above), or are they stored somewhere else and you would like to
split them to put them in a hash table?
Regards,
Steinar Skjelanger
At 07:50 12.12.01 -0800, you wrote:
>How would I use your statement in this code?
>Code:
>foreach my $oid (oid_lex_sort(keys(%{$table}))) {
> printf("%s => %s\n", $oid, $table->{$oid});
>
> >>> "Steinar Skjelanger" <[EMAIL PROTECTED]> 12/12/01 06:50AM >>>
>You can use regular expressions, e.g.:
>
>$output = "1.3.6.1.4.1.9.10.19.1.3.1.1.8.100437591.0 => 16 hours, 03:58.75";
>($ret) = ($output =~ /.* => (.*)/);
>print "$ret\n";
>
>Regards,
>
>Steinar Skjelanger
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of
> > Mike Singleton
> > Sent: 12. desember 2001 15:16
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: simple question
> >
> >
> > How would I parse this output so that ONLY the value after the => is
> returned? Output:
> > 1.3.6.1.4.1.9.10.19.1.3.1.1.8.100437591.0 => 16 hours, 03:58.75
> 1.3.6.1.4.1.9.10.19.1.3.1.1.8.105223983.0 => 2 hours,
> > 46:14.83 1.3.6.1.4.1.9.10.19.1.3.1.1.8.105297783.0 => 2 hours, 33:56.83
> 1.3.6.1.4.1.9.10.19.1.3.1.1.8.105304518.0 => 2
> > hours, 32:49.48 1.3.6.1.4.1.9.10.19.1.3.1.1.8.105538136.0 => 1 hour,
> 53:53.30 1.3.6.1.4.1.9.10.19.1.3.1.1.8.105749311.0
> > => 1 hour, 18:41.55 1.3.6.1.4.1.9.10.19.1.3.1.1.8.105841716.0 => 1
> hour, 03:17.50
> > 1.3.6.1.4.1.9.10.19.1.3.1.1.8.105850396.0 => 1 hour, 01:50.70 ===
> Mike Singleton CCNA, CNE, MCSE Network Analyst (253)
> > 272-1916 x1259 (253) 405-1968 (cellular) [EMAIL PROTECTED] DaVita
> Inc. _______________________________________________
> > Perl-Win32-Admin mailing list
> > [EMAIL PROTECTED]
> > http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
> >
>_______________________________________________
>Perl-Win32-Admin mailing list
>[EMAIL PROTECTED]
>http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
>
>DaVita Inc.
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin