[19838] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2033 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 29 21:05:29 2001

Date: Mon, 29 Oct 2001 18:05:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1004407506-v10-i2033@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 29 Oct 2001     Volume: 10 Number: 2033

Today's topics:
        Control M's still there? - how to make sure? (Straatvark)
    Re: Control M's still there? - how to make sure? <rereidy@indra.com>
    Re: Control M's still there? - how to make sure? <danno966@hotmail.com>
        Deleting lines <coredumped@elrodri.com>
    Re: Deleting lines (Tad McClellan)
    Re: Deleting lines <jeff@vpservices.com>
    Re: digital signature -----> Here it is ........ (TD)
        FTP File Writing Detection . . . <dausha@visto.com>
    Re: FTP File Writing Detection . . . <rereidy@indra.com>
    Re: FTP File Writing Detection . . . (Logan Shaw)
    Re: FTP File Writing Detection . . . <dausha@visto.com>
    Re: How can I make a \t be a tab? (Tad McClellan)
    Re: How can I make a \t be a tab? <mgjv@tradingpost.com.au>
    Re: How can I make a \t be a tab? (Clinton A. Pierce)
        package/object/module dependencies (Weston Cann)
    Re: package/object/module dependencies (Tad McClellan)
    Re: perl build on different linux system. (Logan Shaw)
    Re: question of Perl style using map (Greg Bacon)
    Re: question of Perl style using map (Logan Shaw)
        Telnet: get exit status of remotely executed command (Anand Ramamurthy)
    Re: XML parsing <roym@pdq.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 29 Oct 2001 15:11:02 -0800
From: gert@up-front.co.za (Straatvark)
Subject: Control M's still there? - how to make sure?
Message-Id: <2856a052.0110291511.558010bd@posting.google.com>

I want a perl script created and working on Windows to run on a Unix
box but get the error message as displayed at end of this message.

For that I did remove the control M's.
I do uplaod in ASCII mode with Cute FTP 4.2.2
I did try the '#!/.../perl --' instead of '#!/.../perl' 

I even downloaded a working script from the server and then upload it
again - just to confirm I had broken it without even open/edit it.

So, am I missing something really simple or complex? <<sigh>> - any
help would be really welcome at this stage...

How do I make sure that the control M's was removed?
Must the remove control m's script run on the Unix box?

thanx 
gert

My error message:
***********************************
"This message usually indicates there is a problem with the script
itself. Often this indicates either that the #! line of the script is
incorrect, or the script was uploaded in binary mode instead of ascii
mode. Check to make sure that the script does not have control-M's at
the end of every line. That will prevent it from executing. An easy
fix that takes care of this most of the time is to put '#!/.../perl
--' instead of '#!/.../perl' on the first line of the script. "


------------------------------

Date: Mon, 29 Oct 2001 17:29:53 -0700
From: Ron Reidy <rereidy@indra.com>
Subject: Re: Control M's still there? - how to make sure?
Message-Id: <3BDDF481.B1E15341@indra.com>

Straatvark wrote:
> 
> I want a perl script created and working on Windows to run on a Unix
> box but get the error message as displayed at end of this message.
> 
> For that I did remove the control M's.
> I do uplaod in ASCII mode with Cute FTP 4.2.2
> I did try the '#!/.../perl --' instead of '#!/.../perl'
> 
> I even downloaded a working script from the server and then upload it
> again - just to confirm I had broken it without even open/edit it.
> 
> So, am I missing something really simple or complex? <<sigh>> - any
> help would be really welcome at this stage...
> 
> How do I make sure that the control M's was removed?
> Must the remove control m's script run on the Unix box?
> 
> thanx
> gert
> 
> My error message:
> ***********************************
> "This message usually indicates there is a problem with the script
> itself. Often this indicates either that the #! line of the script is
> incorrect, or the script was uploaded in binary mode instead of ascii
> mode. Check to make sure that the script does not have control-M's at
> the end of every line. That will prevent it from executing. An easy
> fix that takes care of this most of the time is to put '#!/.../perl
> --' instead of '#!/.../perl' on the first line of the script. "
AFIK, the only ^M you will need to worry about is any that are at the
end of program names (i.e #!/usr/bin/perl^M).  If this condition exists,
you will get errors.
-- 
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.


------------------------------

Date: Mon, 29 Oct 2001 20:23:42 -0500
From: "Dan West" <danno966@hotmail.com>
Subject: Re: Control M's still there? - how to make sure?
Message-Id: <9rkuiq$ldl$1@slb6.atl.mindspring.net>

You get those because of the difference between CRLF's on Windows and UNIX.
When you FTP a script, ALWAYS use text mode. bin mode causes the problem. if
you know vi, you can use /s/<ctl>v<ctl>m// at the command line to remove the
offending bits.....

HTH....
Dan

"Ron Reidy" <rereidy@indra.com> wrote in message
news:3BDDF481.B1E15341@indra.com...
> Straatvark wrote:
> >
> > I want a perl script created and working on Windows to run on a Unix
> > box but get the error message as displayed at end of this message.
> >
> > For that I did remove the control M's.
> > I do uplaod in ASCII mode with Cute FTP 4.2.2
> > I did try the '#!/.../perl --' instead of '#!/.../perl'
> >
> > I even downloaded a working script from the server and then upload it
> > again - just to confirm I had broken it without even open/edit it.
> >
> > So, am I missing something really simple or complex? <<sigh>> - any
> > help would be really welcome at this stage...
> >
> > How do I make sure that the control M's was removed?
> > Must the remove control m's script run on the Unix box?
> >
> > thanx
> > gert
> >
> > My error message:
> > ***********************************
> > "This message usually indicates there is a problem with the script
> > itself. Often this indicates either that the #! line of the script is
> > incorrect, or the script was uploaded in binary mode instead of ascii
> > mode. Check to make sure that the script does not have control-M's at
> > the end of every line. That will prevent it from executing. An easy
> > fix that takes care of this most of the time is to put '#!/.../perl
> > --' instead of '#!/.../perl' on the first line of the script. "
> AFIK, the only ^M you will need to worry about is any that are at the
> end of program names (i.e #!/usr/bin/perl^M).  If this condition exists,
> you will get errors.
> --
> Ron Reidy
> Oracle DBA
> Reidy Consulting, L.L.C.




------------------------------

Date: Mon, 29 Oct 2001 18:51:42 GMT
From: Patrick Bateman <coredumped@elrodri.com>
Subject: Deleting lines
Message-Id: <2zhD7.7125$mC.7694@telenews.teleline.es>

Hi:
I got a text with this format:

<SomeText>
line1 john
line2 john
some more text john
ahd the last john line
</SomeText>

<SomeText>
line1 joe
line2 joe
some more text joe
ahd the last joe line
</SomeText>

how can i delete all the lines from <SomeText> to </SomeText> (including 
these two) taking "john" or "joe" as a variable? Is it necessary to make a 
replace for each line (i know to do it) or is there an easy way to do it 
(that's what i want to do)?



Thanks a lot in advance.


------------------------------

Date: Tue, 30 Oct 2001 01:19:14 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Deleting lines
Message-Id: <slrn9trt6q.qt7.tadmc@tadmc26.august.net>

Patrick Bateman <coredumped@elrodri.com> wrote:

>how can i delete all the lines from <SomeText> to </SomeText> (including 
>these two) taking "john" or "joe" as a variable?


--------------------------
#!/usr/bin/perl
use warnings;
use strict;

my $someguysname = 'john';
local $/ = '';  # enable "paragraph mode"

while (<DATA>) {
   print unless /\b$someguysname\b/;
}

__DATA__
<SomeText>
line1 john
line2 john
some more text john
ahd the last john line
</SomeText>

<SomeText>
line1 joe
line2 joe
some more text joe
ahd the last joe line
</SomeText>
--------------------------


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Mon, 29 Oct 2001 17:52:31 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Deleting lines
Message-Id: <3BDE07DF.DC1E7303@vpservices.com>

Tad McClellan wrote:
> 
> Patrick Bateman <coredumped@elrodri.com> wrote:
> 
> >how can i delete all the lines from <SomeText> to </SomeText> (including
> >these two) taking "john" or "joe" as a variable?
> 

[snip Tad's fine code]

Or, alternatively if you may have other record-oriented needs, or have a
file bigger than you want to slurp into memory, or want to include file
locking and manipulation, this will exclusively flock() and open a file
called 'mydata.txt', perform the deletion while never putting more than
one record at a time into memory, and close the file:

  #!/usr/local/bin/perl -w
  use strict;
  use AnyData;
  my $data = adTie( 
      'Text','mydata.txt','u',{eol => "\n\n"}
  );
  delete $data->{{text=>qr/joe/}};
  __END__

You could also use a more complex search pattern then the simple
qr/joe/.  Inserting, updating, and searching for records isn't much more
complicated.  <shameless self promotion> AnyData is available on CPAN
</shameless self promotion>.

-- 
Jeff



------------------------------

Date: 29 Oct 2001 16:35:41 -0800
From: tushar08@yahoo.com (TD)
Subject: Re: digital signature -----> Here it is ........
Message-Id: <584a8362.0110291635.7de22fdd@posting.google.com>

tushar08@yahoo.com (TD) wrote in message news:<584a8362.0110290708.7abc27ca@posting.google.com>...
Perl Gurus - there is no one in this forum who can help me to atleast
guide in the right direction or does it mean PERL DOES NOT SUPPORT
DIGITAL SIGNATURES......


Thanks
TD

> Hello All,
> 
> Is there any way we can create digital signature using Perl
> I am fairly new in this....
> 
> Here is what I need....
> 
> 1) my current XML="<xml data....>"
> 2) signature = sign XML with private key using MD5 or SHA1
> 3) encodedsignature = base64.encode(signature)
> 4) publiccertificate= base64.encode(public cert)
> 5) now I can post data as
> requestxml=XML&digitalsignature=encodedsignature&certificate=publiccertificate
> 
> 
> Please help..if there is a better/best way than this....let me know.
> 
> T.


------------------------------

Date: Mon, 29 Oct 2001 23:40:22 GMT
From: "Benjamin Wilson" <dausha@visto.com>
Subject: FTP File Writing Detection . . .
Message-Id: <GNlD7.247386$Xz1.50369136@news1.rdc1.md.home.com>

Greetings!

Trying to find a reliable way of detecting if a file is still being written
by an external FTP process. The detecting application would be Perl, of
course. :-)  The only way I've heard of so far requires FTPing a 'done.txt'
file as the last FTP action. However, I would like to know if there's a
solution that can conclusively show a file is still being written to.

Thanks in advance,
Ben




------------------------------

Date: Mon, 29 Oct 2001 17:31:18 -0700
From: Ron Reidy <rereidy@indra.com>
Subject: Re: FTP File Writing Detection . . .
Message-Id: <3BDDF4D6.CA2E213E@indra.com>

Benjamin Wilson wrote:
> 
> Greetings!
> 
> Trying to find a reliable way of detecting if a file is still being written
> by an external FTP process. The detecting application would be Perl, of
> course. :-)  The only way I've heard of so far requires FTPing a 'done.txt'
> file as the last FTP action. However, I would like to know if there's a
> solution that can conclusively show a file is still being written to.
> 
> Thanks in advance,
> Ben
Use lstat to check the file size.  When it quits growing (you decide how
long that time is), it is completed. 

Or, you could wrap the ftp inside a Perl/Expect program and wait for the
upload complete message.
-- 
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.


------------------------------

Date: 29 Oct 2001 19:35:31 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: FTP File Writing Detection . . .
Message-Id: <9rl053$q0g$1@charity.cs.utexas.edu>

In article <3BDDF4D6.CA2E213E@indra.com>, Ron Reidy  <rereidy@indra.com> wrote:
>Use lstat to check the file size.  When it quits growing (you decide how
>long that time is), it is completed. 

Or the network has experienced a temporary outage, which Murphy's Law
law says will last exactly TIMEOUT+1 seconds, and then the file will
start growing again.  :-)

  - Logan
-- 
"In order to be prepared to hope in what does not deceive,
 we must first lose hope in everything that deceives."

                                          Georges Bernanos


------------------------------

Date: Tue, 30 Oct 2001 02:02:34 GMT
From: "Benjamin Wilson" <dausha@visto.com>
Subject: Re: FTP File Writing Detection . . .
Message-Id: <_SnD7.247562$Xz1.50515016@news1.rdc1.md.home.com>

Which is something that is currently happening! How prophetic, You!

To add insult to injury, our 'local users' are doing a manual move of the
files after watching them to ensure that the aren't still growing. I keep
banging the gong of automation, but to a deaf crowd. :-/

"Logan Shaw" <logan@cs.utexas.edu> wrote in message
news:9rl053$q0g$1@charity.cs.utexas.edu...
> In article <3BDDF4D6.CA2E213E@indra.com>, Ron Reidy  <rereidy@indra.com>
wrote:
> >Use lstat to check the file size.  When it quits growing (you decide how
> >long that time is), it is completed.
>
> Or the network has experienced a temporary outage, which Murphy's Law
> law says will last exactly TIMEOUT+1 seconds, and then the file will
> start growing again.  :-)
>
>   - Logan
> --
> "In order to be prepared to hope in what does not deceive,
>  we must first lose hope in everything that deceives."
>
>                                           Georges Bernanos




------------------------------

Date: Mon, 29 Oct 2001 23:21:08 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: How can I make a \t be a tab?
Message-Id: <slrn9trmfs.pot.tadmc@tadmc26.august.net>

Marshall Dudley <mdudley@execonn.com> wrote:
>I have a form where the user enters a delimiter they want a flat file to
>use that they are about to download.  They have a box where they enter
>the delimiter they want, ie. \t for a tab.


You use "delimiter" many times when what you really mean
is "separator". Misusing technical terms can lead to yet
more confusion.


>When I try to do a substitution with the "\t" that comes from the form,
                                                    ^^^^^^^^^^^^^^^^^^^

Note that the '\t' is _data_, not code.


>it does not substitute a tab, but puts in a \t instead.  Even if I set a
>variable to the input variable with "" which should convert it 


No. Data does not get interpreted that way, code does.


>(like
>$delimiter = "$in{'delimiter'}"), it still puts in "\t" instead of


   $delimiter = "\t" if $in{'delimiter'} eq '\t';


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Mon, 29 Oct 2001 23:29:00 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: How can I make a \t be a tab?
Message-Id: <slrn9trpi4.2uf.mgjv@verbruggen.comdyn.com.au>

On Mon, 29 Oct 2001 16:55:51 -0500,
	Marshall Dudley <mdudley@execonn.com> wrote:
> I have a form where the user enters a delimiter they want a flat file to
> use that they are about to download.  They have a box where they enter
> the delimiter they want, ie. \t for a tab.

I'd give them a predefined set of separators to choose from, maybe
with a drop down list or so. Otherwise translate the special ones
yourself. Any other solution is going to require the use of eval, or
/ee on a substitution.

If you decide to go with eval, make sure that you untaint that data
decently (run with -T and read perlsec), because the user's submitted
Perl code will be run. One good way could be to allow at most two
characters as a separator

Martien
-- 
Martien Verbruggen              | 
                                | 42.6% of statistics is made up on the
Trading Post Australia Pty Ltd  | spot.
                                | 


------------------------------

Date: Tue, 30 Oct 2001 01:05:36 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: How can I make a \t be a tab?
Message-Id: <A1nD7.209132$K6.102823416@news2>

[Posted and mailed]

In article <slrn9trpao.2uf.mgjv@verbruggen.comdyn.com.au>,
	Martien Verbruggen <mgjv@tradingpost.com.au> writes:
> On Mon, 29 Oct 2001 22:46:22 GMT,
> 	Clinton A. Pierce <clintp@geeksalad.org> wrote:
>> In article <3BDDD067.3E7F50D0@execonn.com>,
>> 	Marshall Dudley <mdudley@execonn.com> writes:
>>> When I try to do a substitution with the "\t" that comes from the form,
>>> it does not substitute a tab, but puts in a \t instead.  Even if I set a
>>> variable to the input variable with "" which should convert it (like
>>> $delimiter = "$in{'delimiter'}"), it still puts in "\t" instead of
>>> [tab].
>> 
>> If you don't mind danger:
>     $delim=eval qq{"$in{delimiter}"};
> 
> Maybe you should explain what sort of danger:

The same kind of danger that you find in a High School chemistry lab
when, your slightly mental lab partner says: 

	"Here, smell this."

As he waves a test tube under your nose.

Duh.  :)

-- 
    Clinton A. Pierce            Teach Yourself Perl in 24 Hours  *and*
  clintp@geeksalad.org                Perl Developer's Dictionary
"If you rush a Miracle Man,     for details, see http://geeksalad.org     
	you get rotten Miracles." --Miracle Max, The Princess Bride


------------------------------

Date: 29 Oct 2001 16:36:12 -0800
From: google@utahvalleymusic.com (Weston Cann)
Subject: package/object/module dependencies
Message-Id: <3e5aa16c.0110291636.1469db5b@posting.google.com>

I'm creating what is probably my first system in perl where I've got 
more than a few modules involved (especially modules I didn't create),  
very mildly dependant on one another. It looks something  like this  
(an indentation signifies that the first unindented item above depends  
on the item on the indented line):  
  
GBView (the main package, which I will be "use" ing in a cgi)  
          gbsettings  
          SimpleQueryObj  
                   LOHR  
           LOHR  
           Masking  
           gradebooksql  
                    sqlQuery  
           sqlQuery  
           misc  
  
I was developing and testing them all within the same directory. When  
I tried to include GBView within a CGI  located elsewhere on the server,  
I was reminded that the only relative path you get for free is the one   
that starts in script you're executing, and that packages you incude will 
think anything they're trying to include is either in @INC or relative 
to the executing script. 
  
So, SimpleQueryObj.pm, for example, uses LOHR.pm, but since I assumed  
that SimpleQueryObj.pm could look for LOHR.pm relative to itself, the  
dependancy broke when I tried to include GBView.  
  
I'm not too worried about my ability to straighten out the problem.... I'll 
play with "use lib" a bit and remember the part about relative paths and 
come up with something. This just brought up the question in my mind:   
What kind of package organizations/setups have y'all found  that work for  
you? What kinds of questions or issues do you try to address? Do you  
have a methodology?


------------------------------

Date: Tue, 30 Oct 2001 01:19:15 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: package/object/module dependencies
Message-Id: <slrn9trtd5.qt7.tadmc@tadmc26.august.net>

Weston Cann <google@utahvalleymusic.com> wrote:

>I was reminded that the only relative path you get for free is the one   
>that starts in script you're executing, and that packages you incude will 
>think anything they're trying to include is either in @INC or relative 
>to the executing script. 


That is not correct.

Where your script is located matters *not at all* to relative paths.

What matters to relative paths is your "current working directory",
which may or may not be the same directory that your program
is located in.


Many web servers arrange for your cwd to be set to the program's
directory, but some don't. So you should never assume, just
chdir() to the correct place before using relative paths.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: 29 Oct 2001 19:26:37 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: perl build on different linux system.
Message-Id: <9rkvkd$prv$1@charity.cs.utexas.edu>

In article <e03ac419.0110291211.6165b23d@posting.google.com>,
yan lin <ylin@reshape.com> wrote:
>  I have a server linux 6.2, and my desktop is linux 7.1. I try to
>build a perl and some packages on 7.1 and make it run both 7.1 and
>6.2. It seems to me that I need to downward config my system to match
>6.2. But config.sh is way complicated for me to tackle. Does anyone
>has some success experience on it? Please help.

This isn't really a Perl question.  When you compile software on a
newer release of an operating system, the executable may depend on new
versions of things.  When you try to run it on an older version, a good
operating system will prevent this because it knows you may be trying
to use features that don't exist or aren't compatible.

A newer version of the operating system has the advantage that it was
built later, so it should be able to run software built for older
releases.

So the solution to your problem is to either build Perl on both, or
build it on the older system and then transfer it to the newer one.

  - Logan
-- 
"In order to be prepared to hope in what does not deceive,
 we must first lose hope in everything that deceives."

                                          Georges Bernanos


------------------------------

Date: Mon, 29 Oct 2001 23:46:22 -0000
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: question of Perl style using map
Message-Id: <ttrqiecb248pae@corp.supernews.com>

In article <m3snc2uru5.fsf@localhost.localdomain>,
    chris  <chris.wallace@lshtm.ac.uk> wrote:

: [...]
: #!/usr/bin/perl -w
: 
: use strict;
: 
: my $required=3;
: my @array=(0,1,2);
: 
: while(1) {
:   @array = map { ++$_ } @array;
:   print "@array\n";
: 
:   # exit loop only if *all* elements of @array >= $required;
:   my $continue=0;
:   map { $continue=1 if $_ < $required } @array;  ###
:   last unless $continue;
: }
: 
: This is obviously fairly inefficient when @array is large and, say,
: $array[0] < $required, since it cycles through the rest of the array
: unnecesssary after testing $array[0].
: [...]

I'd write it this way:

    my $required = 3;
    my @array = (0, 1, 2);

    while (1) {
        my $continue;

        for (@array) {
            $_++;
            $continue ||= $_ < $required;
        }
        print "@array\n";

        last unless $continue;
    }

Greg
-- 
My hired clowns end up entertaining a number of postal workers--not
necessarily a bad thing but certainly not the intended effect. 
    -- Tim Berners-Lee


------------------------------

Date: 29 Oct 2001 19:33:39 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: question of Perl style using map
Message-Id: <9rl01j$pve$1@charity.cs.utexas.edu>

In article <m3snc2uru5.fsf@localhost.localdomain>,
chris  <chris.wallace@lshtm.ac.uk> wrote:
>  @array = map { ++$_ } @array;

Inside of a map(), $_ is bound to values of the array.  That is, $_ is
not a copy but actually another name for the same array element.

So, you should at least do this instead:

    map { $_++ } @array;

Since it avoids copying the entire array needlessly.  You could
also just do this:

    $_++ for @array;

It does the same thing basically, but it doesn't bother to construct
values that you're just going to throw away.

  - Logan
-- 
"In order to be prepared to hope in what does not deceive,
 we must first lose hope in everything that deceives."

                                          Georges Bernanos


------------------------------

Date: 29 Oct 2001 15:42:31 -0800
From: anand_ramamurthy@yahoo.com (Anand Ramamurthy)
Subject: Telnet: get exit status of remotely executed command
Message-Id: <761041e6.0110291542.1f1ec664@posting.google.com>

How can I know the exit status of remotely executed command.

first I execute

          $t->cmd("test -x /usr/local/bin/myexe");

to check if myexe is present & is an executable. Under normal
circumstances we check for the return status ($?) to be 0.
But in above how do I know what the exit status was.

If I do @lines = $t->cmd("test -x /usr/local/bin/myexe"); and
try to print @lines, I will get a blank.


------------------------------

Date: Mon, 29 Oct 2001 19:10:23 -0600
From: "Roy" <roym@pdq.net>
Subject: Re: XML parsing
Message-Id: <6ED7065F032AF461.C7B0BBF2CD05BB8A.A9DF7291DDD8AF97@lp.airnews.net>

I've also encountered this problem when parsing large text files.  XML
wasn't involved in this case - but when parsing a large text file and
storing data from the files it was possible to create enough large arrays
that the machine ran out of memory somewhere along the way...

This was Perl 5.something, NT4.0, IIS 3.0.

The short answer was to store data more efficiently - or actually - store
less data.

Hmm... hope this helps.  I'd be interested to here your solution to this
when you find one.

roy

Spike <just.ice@mailcity.com> wrote in message
news:25e4dd8c.0110290832.6fca9b23@posting.google.com...
> Hi. I am new to XML parsing and have enherited some code which uses
> XMl::Simple.
> This reads in the entire XML file and parses it into a data structure.
> However, when a large file is encountered the machine runs out of
> memory.
>
> Is there some other way to deal with these XML files rather than the
> way outlined above? Perhaps a module which deals with the file in a
> step-wise fashion?
>
> Thanks
>
> Spike




------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 2033
***************************************


home help back first fref pref prev next nref lref last post