> Oh, I see.  The values might be used in a context that knows 
> nothing about
> OLE at all and therefore wants *everything* as either a number or a
> string.  I would think the following code would do the trick 
> and shouldn't
> be much slower also:
> 
>   my $row = [ map { $rs->Fields($_->{Name})->{Value} } @$ado_fields ];
>   foreach (@$row) {
>       $_ = $_->As(VT_BSTR) if UNIVERSAL::isa($_, 
> 'Win32::OLE::Variant');
>   }

Would you jot a easy description of what this is doing?  (mine) The array
(reference) is looped looking for a blessed type of 'Win32::OLE...', if
found replace with  Convert to OLE String???

Is the As method part of the Win32::OLE::Variant class?

> Could you benchmark this and report if the effect is noticeable?
Sure.
Without extra foreach
100 loops of other code took:20 wallclock secs (10.67 usr +  2.37 sys =
13.05 CPU) @  7.66/s (n=100)
With
100 loops of other code took:21 wallclock secs (10.53 usr +  2.98 sys =
13.51 CPU) @  7.40/s (n=100)
 
> The advantage of the code above is that it is both backward 
> and forward
> compatible (should we ever decide to return more Variant 
> types as objects;
> VT_DECIMAL comes to mind here).

Both backward and forward compatible is ideal.  So where do I find out more
about the "Variant" type of data?

Tom

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to