Thank you, it looks like you've saved my bacon...

Deane Rothenmaier
Programmer/Analyst -- IT-StdCfg
Walgreens Corp.
2 Overlook Point #N5102D
MS 6515
Lincolnshire, IL 60069
224-542-5150

If stupidity got us into this mess, then why can't it get us out? -- Will 
Rogers



[email protected] 
08/05/2010 11:57 AM

To
"Roode, Eric" <[email protected]>
cc
[email protected], 
[email protected], 
[email protected]
Subject
RE: Delimiter or no Delimiter, that's the question







The default Delimiter is \, 
So like Eric mentioned, setting the Delimiter to \, then setting it back 
to / at the end of the subroutine should accomplish what you are trying to 
do. 


Something like this: 
# At the module level... 
package wsinfo::Hardware; 
# ... other use statements ... 
use Win32::TieRegistry (Delimiter => '/'); 

# methods that use TieRegistry with the Delimiter 

sub different_sub { 
  #use Win32::TieRegistry; 
   $Registry->Delimiter('\');
  #do its thing with undefined Delimiter 
    $Registry->Delimiter('/');
} 

# more methods that use the Delimiter... 


Thanks,
Brett Carroll



"Roode, Eric" <[email protected]> 
Sent by: [email protected] 
08/05/2010 12:50 PM 


To
<[email protected]>, <[email protected]> 
cc

Subject
RE: Delimiter or no Delimiter, that's the question








Why not just change the delimiter for the duration of that one subroutine, 
with the Delimiter() method, as shown in 
http://search.cpan.org/~adamk/Win32-TieRegistry-0.26/lib/Win32/TieRegistry.pm#Examples
 
? 
  
—Eric 
  
From: [email protected] 
[mailto:[email protected]] On Behalf Of 
[email protected]
Sent: Thursday, August 05, 2010 11:30 AM
To: [email protected]
Subject: Delimiter or no Delimiter, that's the question 
  

Gurus, 

I have a problem with TieRegistry in a code module. The TieRegistry code 
is used in several methods in the module, but the rub is this: in at least 
one method, I need the Delimiter set to '/', while in just one method it 
needs to be undefined. 

As currently coded, TieRegistry gets "used" at the module level like this: 


use Win32::TieRegistry (Delimiter => '/'); 

I'm wondering, is it possible to "use" TieRegistry inside the subroutine 
that requires the undefined Delimiter, so that the ones requiring the 
*defined* Delimiter can rely on the module-level statement, while the one 
requiring that Delimiter be undefined can rely its own use statement? That 
is, can I do this: 
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs 

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to