osdir.com
mailing list archive

Subject: Re: what wrong? - msg#00004

List: lang.perl.xml

Date: Prev Next Index Thread: Prev Next Index
thanks very much, that's the goal.

----- Original Message -----
From: "Christopher Hicks" <chicks@xxxxxxxxxx>
To: "He Bin" <ice@xxxxxxxxxxxxxxx>
Cc: "perl-xml list" <perl-xml@xxxxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, August 06, 2004 7:34 PM
Subject: Re: what wrong?


> On Fri, 6 Aug 2004, He Bin wrote:
> > hi all guys,
> >
> > if($len) { my @list = @_ ;}
> > else { my @list = @$fe ;}
> > ________________________________
> >
> > if $len == 0 , I want get @$fe, but fail.
> >
> > if $len != 0 , I can get @_, it's right.
>
> You have to put the "my @list" outside of the if/else. Since the "my" is
> inside a code block (denoted by the squiggly brackets - "{ }") that
> variable is scoped to the code block. So you've been doing that you
> wanted, but then you can't use it later because its out of scope.
>
> --
> </chris>
>

_______________________________________________
Perl-XML mailing list
Perl-XML@xxxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: what wrong?

On Fri, 6 Aug 2004, He Bin wrote: hi all guys, if($len) { my @list = @_ ;} else { my @list = @$fe ;} ________________________________ if $len == 0 , I want get @$fe, but fail. if $len != 0 , I can get @_, it's right. You have to put the "my @list" outside of the if/else. Since the "my" is inside a code block (denoted by the squiggly brackets - "{ }") that variable is scoped to the code block. So you've been doing that you wanted, but then you can't use it later because its out of scope. -- </chris> _______________________________________________ Perl-XML mailing list Perl-XML@xxxxxxxxxxxxxxxxxxxxxxxx To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Next Message by Date: click to view message preview

SAX with custom properties (and events)

Hi, I would like to write a set of modules that report errors in HTML/ XHTML documents and I am looking for the best approach to do that. For example, one module would check whether the xml-stylesheet pi is properly placed and whether it adheres to the syntax constraints, and another module would check whether the color attribute of the <font> element uses legal syntax to report an error for e.g. color="ffffff". My current idea is to make http://sourceforge.net/projects/spo (SGML::Parser::OpenSP, an interface to the OpenSP SGML processor) so that it fits into the XML::SAX space and then write more general purpose SAX handlers to do that. My problem is that XML::SAX does not provide meta data essential to such application, for example location information. If I integrate such a module into a web service I would like to emit markup like <dt>Error line 13 column 43, color values must be prefixed with #</dt> <dd><code>...&lt;font color="<strong class='error'>ffffff</strong>"... ... so, at the very least I would need to know where in the document the <font> element is located and start from there to find the attribute value. I could use XML::Parser which provides such information, but then I am afraid I have to rewrite lots of the XML::SAX infrastructure and lack all the benefits XML::SAX compatibility would provide. So I am rather looking how to extend XML::SAX with custom data (custom events, custom properties for existing events) and once I figured out how, to write a patch and bother e.g. Robin to include that in XML::SAX::Expat. What should I do? TIA. _______________________________________________ Perl-XML mailing list Perl-XML@xxxxxxxxxxxxxxxxxxxxxxxx To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Previous Message by Thread: click to view message preview

Re: what wrong?

On Fri, 6 Aug 2004, He Bin wrote: hi all guys, if($len) { my @list = @_ ;} else { my @list = @$fe ;} ________________________________ if $len == 0 , I want get @$fe, but fail. if $len != 0 , I can get @_, it's right. You have to put the "my @list" outside of the if/else. Since the "my" is inside a code block (denoted by the squiggly brackets - "{ }") that variable is scoped to the code block. So you've been doing that you wanted, but then you can't use it later because its out of scope. -- </chris> _______________________________________________ Perl-XML mailing list Perl-XML@xxxxxxxxxxxxxxxxxxxxxxxx To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Next Message by Thread: click to view message preview

Perl SAX 2.1 status

Hi all, In addition to the SourceForge CVS (perl-xml/sax-perl-org), the latest Perl SAX 2.1 documents are available at http://perl-xml.sourceforge.net/perl-sax/. Anyone can post comments all the time. I have had to give up my attempts to update the sax.perl.org site as the rights to do so are blocked at this moment. The two Perl SAX pages can merge as soon as this situations changes. Regards, Petr -- Petr Cimprich Ginger Alliance www.gingerall.com _______________________________________________ Perl-XML mailing list Perl-XML@xxxxxxxxxxxxxxxxxxxxxxxx To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by