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

[email protected]
Newsgroups gmane.comp.lang.perl.active-perl
Message-ID <OFE4A2F19E.4C65EFBA-ON85257776.005CDE6F-85257776.005D2764@bpd.treas.gov>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.