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-xml
perl-xml
Stripping UTF8 from variables.
by Terrence Martin other posts by this author
Jan 15 2002 11:25PM messages near this date
view in the new Beta List Site
Re: [ANNOUNCE] XML::SAX::2Simple | Re: Q: XML Iterators
Hello. I just wanted to post again regarding this issue of stripping the 
UTF8 flag from perl variables. 

The reason I want to do this is so that I can pass variables derived from 
a XML document to the Net::SSH::Perl module.

Now the suggestion I have been given that appears to work is to assign a 
variable to itself using quotes. I have included an example script. 

What I wanted to know is if this is "correct" ie it is not some bug I am 
exploiting, of if there is a "better" way to strip the UTF8 flag off of a 
perl variable? Are there any problems with this approach?

Thank you,

Terrence


#!/usr/bin/perl

use XML::Simple;
use Devel::Peek; 

$configfile = "./config.xml";

my $config = XMLin($configfile);

my $protocol = "$config-> {ssh}->{protocol}";

Dump $protocol;

$protocol = "$protocol";

Dump $protocol;


Output


SV = PV(0x82498b4) at 0x8158ff0
  REFCNT = 1
  FLAGS = (PADBUSY,PADMY,POK,pPOK,UTF8)
  PV = 0x8252fa8 "2"\0
  CUR = 1
  LEN = 2
SV = PV(0x82498b4) at 0x8158ff0
  REFCNT = 1
  FLAGS = (PADBUSY,PADMY,POK,pPOK)
  PV = 0x8252fa8 "2"\0
  CUR = 1
  LEN = 2


_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
http://listserv.ActiveState.com/mailman/listinfo/perl-xml
Thread:
Duncan Cameron
Barrie Slaymaker
Terrence Martin

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