Re: XML::Twig - Memory usage problem

mirod <[email protected]>
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
howard chen wrote:
> Hello
> 
> On Thu, Oct 30, 2008 at 9:54 PM, mirod <[email protected]> wrote:
>>> Because it should be $_[0]->purge in the sub, not @_[0]. (always, ALWAYS use strict...)
> 
> 
> What is the difference?
> 
> $_[0] vs @_[0] ?
> 
> I am using strict already, no warning.... no syntax error ....

It should be $_[0]. You access an element of @array with $array[$index]. That's 
the way Perl5 works, the sigil represents the value you are accessing, since an 
element of an array is a scalar ("regular" scalar or reference), you use the $.

It doesn't seem to matter in this case though, it's special-cased. With warnings 
on you would get a 'Scalar value @_[0] better written as $_[0] at ...' warning.


>>> CentOS release 5.2 (Final), 64bit version, running on Quad Core x 2
>>> SMP server, 8GB RAM
>> It is possible that the fact that it's 64bit creates a problem. Could you try
>> the same test on a machine with a 32-bit perl?
> 
> 
> Damn it... I run the program with using CentOS 4.3, 32bit, don't have
> this problem! What is the possible reason then?

OK, we have 64-bit perl at work, so I will try testing this. I don't think it's 
anything in XML::Twig proper though, since it's pure perl. It should be fun 
digging through XML::Parser or even weaken C code :--(

-- 
mirod
_______________________________________________
Perl-XML 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.