[31613] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2872 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 12 14:09:27 2010

Date: Fri, 12 Mar 2010 11:09:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 12 Mar 2010     Volume: 11 Number: 2872

Today's topics:
        Asynchronous TCP Socket Connect <Steve.Roscio@hp.com>
    Re: Asynchronous TCP Socket Connect <m@rtij.nl.invlalid>
    Re: Asynchronous TCP Socket Connect <ben@morrow.me.uk>
    Re: to RG - Lisp lunacy and Perl psychosis <bugbear@trim_papermule.co.uk_trim>
    Re: to RG - Lisp lunacy and Perl psychosis (Pascal J. Bourguignon)
    Re: to RG - Lisp lunacy and Perl psychosis <pgp@doc.ic.ac.uk>
    Re: to RG - Lisp lunacy and Perl psychosis <jurgenex@hotmail.com>
    Re: Well, that's the most obscure Perl bug I've ever se <pshendley@gmail.com>
    Re: Well, that's the most obscure Perl bug I've ever se <KBfoMe@realdomain.net>
        worst concept in computer science   [Was:  to RG - Lisp <nick_keighley_nospam@hotmail.com>
    Re: worst concept in computer science   [Was:  to RG -  <devnull4711@web.de>
    Re: worst concept in computer science   [Was:  to RG -  <pgp@doc.ic.ac.uk>
    Re: worst concept in computer science   [Was:  to RG -  <m@rtij.nl.invlalid>
    Re: worst concept in computer science (Mario S. Mommer)
    Re: worst concept in computer science <john@castleamber.com>
    Re: worst concept in computer science <devnull4711@web.de>
    Re: worst concept in computer science <john@castleamber.com>
    Re: worst concept in computer science <pw@panix.com>
    Re: Writing to the end of a record <pshendley@gmail.com>
    Re: XML::LibXML: Including xml fragments in a larger do <pshendley@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 12 Mar 2010 10:10:25 -0700
From: Steve Roscio <Steve.Roscio@hp.com>
Subject: Asynchronous TCP Socket Connect
Message-Id: <hndsd0$taf$1@usenet01.boi.hp.com>

Howdy -

Is there a way to do an asynchronous connection of a TCP socket, without 
threads or forking?  Something like a two-step method, where I start the 
connect, then later check to see if it's done and if it worked?

So basically I want to turn this:

     my $s = IO::Socket::INET->new(
         Proto    => $proto,
         PeerAddr => $addr,
         PeerPort => $port,
         #  Blocking => 0,
         Timeout => $timeout,
     );

into a two-step call:
     my $s = start_connection (...);

     # later...
     if ($s->connected() || $s->error()) ...  #(whatever)


Thanx!
- Steve


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

Date: Fri, 12 Mar 2010 19:23:40 +0100
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: Asynchronous TCP Socket Connect
Message-Id: <cedq67-cj6.ln1@news.rtij.nl>

On Fri, 12 Mar 2010 10:10:25 -0700, Steve Roscio wrote:

> Howdy -
> 
> Is there a way to do an asynchronous connection of a TCP socket, without
> threads or forking?  Something like a two-step method, where I start the
> connect, then later check to see if it's done and if it worked?
> 
> So basically I want to turn this:
> 
>      my $s = IO::Socket::INET->new(
>          Proto    => $proto,
>          PeerAddr => $addr,
>          PeerPort => $port,
>          #  Blocking => 0,
>          Timeout => $timeout,
>      );
> 
> into a two-step call:
>      my $s = start_connection (...);
> 
>      # later...
>      if ($s->connected() || $s->error()) ...  #(whatever)

This is not a Perl question, You are looking for non-blocking sockets. 
Whole volumes have been written about this, but best is Stevens "Unix 
Network Programming".

HTH,
M4


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

Date: Fri, 12 Mar 2010 18:22:29 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Asynchronous TCP Socket Connect
Message-Id: <5cdq67-8sf2.ln1@osiris.mauzo.dyndns.org>


Quoth Steve Roscio <Steve.Roscio@hp.com>:
> 
> Is there a way to do an asynchronous connection of a TCP socket, without 
> threads or forking?  Something like a two-step method, where I start the 
> connect, then later check to see if it's done and if it worked?
> 
> So basically I want to turn this:
> 
>      my $s = IO::Socket::INET->new(
>          Proto    => $proto,
>          PeerAddr => $addr,
>          PeerPort => $port,
>          #  Blocking => 0,
>          Timeout => $timeout,
>      );
> 
> into a two-step call:
>      my $s = start_connection (...);
> 
>      # later...
>      if ($s->connected() || $s->error()) ...  #(whatever)

Blocking => 0 is supposed to enable this behaviour. Does it not?

Ben



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

Date: Fri, 12 Mar 2010 15:47:08 +0000
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: to RG - Lisp lunacy and Perl psychosis
Message-Id: <CY-dnW4zLYVh_AfWnZ2dnUVZ8o5i4p2d@brightview.co.uk>

Jürgen Exner wrote:
> Saying something isn't harder than C pointers is like saying a desease
> isn't worse than the Bubonic plague: it gives very little comfort to
> people suffering from it. 
> Actually C pointers are probably among the worst concepts ever invented
> in computer science.

Was 'C' invented to be a "great" language, or was it
just a compromise - easier (and more portable) than
assembler, but still low level enough that a
compiler of the era
could generate decent code?

These days, it's quite common to see 'C' categorised
as a portable assembly language.

Which may be a Good Thing, of course.

    BugBear


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

Date: Fri, 12 Mar 2010 17:20:37 +0100
From: pjb@informatimago.com (Pascal J. Bourguignon)
Subject: Re: to RG - Lisp lunacy and Perl psychosis
Message-Id: <87r5npse96.fsf@galatea.lan.informatimago.com>

John Bokma <john@castleamber.com> writes:

> "Peter J. Holzer" <hjp-usenet2@hjp.at> writes:
>
>> On 2010-03-10 20:54, John Bokma <john@castleamber.com> wrote:
>
> [..]
>
>> I started with BASIC (think early 1980's here - line numbers and
>> goto),
>
> ZX Spectrum, 1983 here
>
>> then did a little bit of Pascal and assembly (6502 and Z80) before
>
> More or less same here, Z80, Comal, Pascal, 6800, 6809, 68000 ...
>
>>> I do agree, however, that it would've been nice if C had references like
>>> Perl, and (harder to get to) pointers as they are now.
>>
>> Actually, C pointers are quite ok in theory (for example, you can't make
>> a pointer into an array point outside of the array (except "just after"
>> it).
>
> How does C prevent this? Or I don't understand what a pointer into an
> array is. 

Well, since C is weakly-to-not typed, you cannot enforce it at the
variable site, however, it is specified indeed that it is invalid or
undefined to derefer a pointer that doesn't point to allocated memory,
and to compare pointers that don't point to elements of the same array
or one beyond.  This can be enforced by heavy pointers and run-time
checks.  Of course, since they prefer to have their results fast than
correct, this is rarely enforced.


One way is to define pointers as:

typedef struct {
   address arrayBase;
   int   elementSize;
   int   elementCount;
   int   index;
}      Pointer;

Pointer NULL={0,0,0,0};

void Pointer_incr(Pointer* p){
     if(p.index<p.elementCount){
         p.index++;
     }else{
         error("Trying to increment a pointer out of bounds"); }}

void Pointer_decr(Pointer* p){
     if(0<p.index){
         p.index--;
     }else{
         error("Trying to decrement a pointer out of bounds"); }}

int Pointer_minus(Pointer p,Pointer q){
     if(p.arrayBase!=q.arrayBase){
         error("Incompatible pointers"); 
     }else{
        return(p.index-q.index); }}

bool Pointer_equalp(Pointer p,Pointer q){ return(Pointer_minus(p,q)==0); }
bool Pointer_lessp (Pointer p,Pointer q){ return(Pointer_minus(p,q)<0); }

T Pointer_deref(Type T,Pointer p){
   if(p.index<p.elementCount){
       return(deref(T,p.arrayBase+p.index));
   }else{
       error("Trying to dereference out of bound pointer."); }}



char a;
char b;
int c[10];
int d[10];

char* p1=&a; /* <=> p1.arraybase=address_of(a); 
                    p1.elementSize=1;
                    p1.elementCount=1; 
                    p1.index=0; */

char* p2=&b; /* <=> p2.arraybase=address_of(b);
                    p2.elementSize=1;
                    p2.elementCount=1; 
                    p2.index=0; */

int*  p3=&c; /* <=> p3.arraybase=address_of(c);
                    p3.elementSize=sizeof(int);
                    p3.elementCount=10; 
                    p3.index=0; */

int*  p4=&(d[9]); /* <=> p4.arraybase=address_of(d);
                         p4.elementSize=sizeof(int);
                         p4.elementCount=10; 
                         p4.index=9; */

int* p5=&d; /* <=> p5.arraybase=address_of(d);
                   p5.elementSize=sizeof(int);
                   p5.elementCount=10; 
                   p5.index=9; */

char* n=NULL;

p2++; /* <=> Pointer_incr(&p2); */
p3++; /* <=> Pointer_incr(&p3); */

p1==p2; /* <=> Pointer_equalp(p1,p2); <=> error */
p3<p4;  /* <=> Pointer_lessp(p3,p4);  <=> error */
p4<p5;  /* <=> Pointer_lessp(p5,p4);  returns false. */

*p4=*p5; /* <=> copies the int from d[0] to d[9]. */
*n=0; /* <=> error (dereferencing NULL) */

-- 
__Pascal Bourguignon__


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

Date: Fri, 12 Mar 2010 17:17:09 +0000
From: Philip Potter <pgp@doc.ic.ac.uk>
Subject: Re: to RG - Lisp lunacy and Perl psychosis
Message-Id: <hndsuk$mo4$1@speranza.aioe.org>

On 12/03/2010 02:14, John Bokma wrote:
> "Peter J. Holzer" <hjp-usenet2@hjp.at> writes:
>> Actually, C pointers are quite ok in theory (for example, you can't make
>> a pointer into an array point outside of the array (except "just after"
>> it).
> 
> How does C prevent this? Or I don't understand what a pointer into an
> array is. 

C *doesn't* prevent it. If you have a pointer to a member of an array,
which you keep iterating with p++ until it goes well beyond the end, the
behaviour is undefined. That means that *no matter what* the compiler
and resulting program does, it's a valid implementation of the C
Standard. It is certainly not required that a C compiler checks that you
don't do something stupid like this.

http://catb.org/jargon/html/N/nasal-demons.html

Phil


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

Date: Fri, 12 Mar 2010 09:22:10 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: to RG - Lisp lunacy and Perl psychosis
Message-Id: <dvtkp55opse6ppi2hgp4orm9obf2879o5n@4ax.com>

bugbear <bugbear@trim_papermule.co.uk_trim> wrote:
>These days, it's quite common to see 'C' categorised
>as a portable assembly language.

Absolutely. I have worked on compilers, which generated C-code as the
target output. And C is working very nicely for that purpose.

jue


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

Date: Fri, 12 Mar 2010 05:38:30 -0800 (PST)
From: Permostat <pshendley@gmail.com>
Subject: Re: Well, that's the most obscure Perl bug I've ever seen
Message-Id: <42572078-6e86-497d-b248-835eb7577a1e@e7g2000yqf.googlegroups.com>

On Mar 11, 7:03=A0am, pete <no-...@unknown.com> wrote:
> I was fixing a problem that "just appeared" in some otherwise working
> code. There were no syntax errors and the program ran fine - it's just
> that the result went from being correct to being uttterly and completely
> wrong. A bit of lateral thinking and investigation solved the problem.
> However, for your entertainment and education, here's a cut down version
> that exhibts the same effect:
>
> $
>
> # set up a counter
> $i =3D 0;
>
> for($j =3D 0; $j < 10; $j++) {
> =A0 print "j =3D $j\n";
> =A0 $i++;}
>
> print "j =3D $j, i=3D$i\n";
>
> which, when run produces:
>
> root: perl bug.pl
> j =3D 0
> j =3D 1
> j =3D 2
> j =3D 3
> j =3D 4
> j =3D 5
> j =3D 6
> j =3D 7
> j =3D 8
> j =3D 9
> j =3D 10, i=3D6308506
>
> Yup, it's that solitary "$" all alone in the middle of nowhere.
> it only took me about an hour and a half to spot - probably because
> I was looking in entirely the wrong place as the real-life code had
> a large block of comment lines between the "$" and "$i =3D 0;"
>
> All I can say is aaaaaaaaaaaaaaaaaah!

Blast it with piss.

Herm=3D


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

Date: Fri, 12 Mar 2010 10:46:18 -0600
From: "Kyle T. Jones" <KBfoMe@realdomain.net>
Subject: Re: Well, that's the most obscure Perl bug I've ever seen
Message-Id: <hndr4u$cdb$1@news.eternal-september.org>

Peter J. Holzer wrote:
> On 2010-03-11 23:17, Kyle T. Jones <KBfoMe@realdomain.net> wrote:
>> I guess instead of a snark, I could have offered this (it's ugly, 
>> there's undoubtedly an easier way to do it, I invite criticism, but I'm 
>> 95% it'll work just fine):
>>
> [script snipped]
> 
> I seem to be missing the part of the script which fixes all the errors
> and warnings ...
> 
> 	hp
> 

So add in a section that splits the script into subs and main then 
parses each for the first instance of declared variables, and append my 
to the front of each.  That's likely to be a huge percentage of the 
errors you'll hit adding in use strict to scripts authored by folks that 
don't use, well, use strict.

You know what though - I did think he had said he had "thousands of 
scripts" - but what he said was "several scripts of a thousand lines of 
code".  So, that changes things.

Tell you what, though - you go and create something that "fixes all the 
errors and warnings" for any perl script (or any language for that 
matter).  You'll be rich, @#$%^.

Cheers.


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

Date: Fri, 12 Mar 2010 05:05:49 -0800 (PST)
From: Nick Keighley <nick_keighley_nospam@hotmail.com>
Subject: worst concept in computer science   [Was:  to RG - Lisp lunacy and  Perl psychosis]
Message-Id: <02d13714-87ce-487c-85fe-0c279d2f41a6@i25g2000yqm.googlegroups.com>

On 10 Mar, 20:39, J=FCrgen Exner <jurge...@hotmail.com> wrote:

> Actually C pointers are probably among the worst concepts ever invented
> in computer science.

now there's a challenge. Who are the other competitors?

- FORTRAN computed goto
- FORTRAN fixed layout
- Algol-60 free layout
- Algol-60 call by name
- Pascal with
- C declaration syntax
- C++ template syntax
- C++ exception specification
- PL/I


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

Date: Fri, 12 Mar 2010 16:14:52 +0100
From: Frank Seitz <devnull4711@web.de>
Subject: Re: worst concept in computer science   [Was:  to RG - Lisp lunacy and    Perl psychosis]
Message-Id: <7vv43cF5uhU3@mid.individual.net>

Nick Keighley wrote:
> On 10 Mar, 20:39, Jürgen Exner <jurge...@hotmail.com> wrote:
>> 
>> Actually C pointers are probably among the worst concepts ever invented
>> in computer science.
> 
> now there's a challenge. Who are the other competitors?
> 
> - FORTRAN computed goto
> - FORTRAN fixed layout
> - Algol-60 free layout
> - Algol-60 call by name
> - Pascal with
> - C declaration syntax
> - C++ template syntax
> - C++ exception specification
> - PL/I

The classical Perl FILEHANDLE

Frank
-- 
Dipl.-Inform. Frank Seitz
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel

Blog: http://www.fseitz.de/blog
XING-Profil: http://www.xing.com/profile/Frank_Seitz2


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

Date: Fri, 12 Mar 2010 17:17:57 +0000
From: Philip Potter <pgp@doc.ic.ac.uk>
Subject: Re: worst concept in computer science   [Was:  to RG - Lisp lunacy and  Perl psychosis]
Message-Id: <hndt04$mo4$2@speranza.aioe.org>

On 12/03/2010 13:05, Nick Keighley wrote:
> On 10 Mar, 20:39, Jürgen Exner <jurge...@hotmail.com> wrote:
> 
>> Actually C pointers are probably among the worst concepts ever invented
>> in computer science.
> 
> now there's a challenge. Who are the other competitors?
> 
> - FORTRAN computed goto
> - FORTRAN fixed layout
> - Algol-60 free layout
> - Algol-60 call by name
> - Pascal with
> - C declaration syntax
> - C++ template syntax
> - C++ exception specification
> - PL/I

COME FROM.


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

Date: Fri, 12 Mar 2010 19:21:37 +0100
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: worst concept in computer science   [Was:  to RG - Lisp lunacy and  Perl psychosis]
Message-Id: <hadq67-cj6.ln1@news.rtij.nl>

On Fri, 12 Mar 2010 05:05:49 -0800, Nick Keighley wrote:

> On 10 Mar, 20:39, Jürgen Exner <jurge...@hotmail.com> wrote:
> 
>> Actually C pointers are probably among the worst concepts ever invented
>> in computer science.
> 
> now there's a challenge. Who are the other competitors?
> 
> - FORTRAN computed goto
> - FORTRAN fixed layout
> - Algol-60 free layout
> - Algol-60 call by name
> - Pascal with
> - C declaration syntax
> - C++ template syntax
> - C++ exception specification
> - PL/I

- All of COBOL and especially COBOL74 and earlier.
- Command.com batch language (and to a lesser degree cmd.exe batch 
language)
- Java's resource managing techniques (or rather, lack of).
- C++'s automagical creation of copy constructors and assignment operators

Do we have to restrict it to programming languages? Otherwise I know a 
few others:

- DOS drive letters
- Unix access control
- ActiveX as used originally, download and execute from any site when 
requested.
- Original Mac autorun feature
- Borland technical support

OK, maybe not computer science. Certainly not rocket science :-)

M4


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

Date: Fri, 12 Mar 2010 15:02:01 +0100
From: m_mommer@yahoo.com (Mario S. Mommer)
Subject: Re: worst concept in computer science
Message-Id: <874oklhc4m.fsf@padme.localdomain>


Nick Keighley <nick_keighley_nospam@hotmail.com> writes:
> On 10 Mar, 20:39, Jürgen Exner <jurge...@hotmail.com> wrote:
>
>> Actually C pointers are probably among the worst concepts ever invented
>> in computer science.
>
> now there's a challenge. Who are the other competitors?
>
> - FORTRAN computed goto
> - FORTRAN fixed layout
> - Algol-60 free layout
> - Algol-60 call by name
> - Pascal with
> - C declaration syntax
> - C++ template syntax
> - C++ exception specification
> - PL/I

I miss

 - FORTRAN common blocks

from that list. And with respect to C++ templates - well, the syntax
isn't really the worst part.

Mario.



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

Date: Fri, 12 Mar 2010 09:21:25 -0600
From: John Bokma <john@castleamber.com>
Subject: Re: worst concept in computer science
Message-Id: <87iq911s7e.fsf@castleamber.com>

Nick Keighley <nick_keighley_nospam@hotmail.com> writes:

> On 10 Mar, 20:39, Jürgen Exner <jurge...@hotmail.com> wrote:
>
>> Actually C pointers are probably among the worst concepts ever invented
>> in computer science.
>
> now there's a challenge. Who are the other competitors?
>
> - FORTRAN computed goto
> - FORTRAN fixed layout
> - Algol-60 free layout
> - Algol-60 call by name
> - Pascal with
> - C declaration syntax
> - C++ template syntax
> - C++ exception specification
> - PL/I

PHP
XHTML

-- 
John Bokma                                                               j3b

Hacking & Hiking in Mexico -  http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development


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

Date: Fri, 12 Mar 2010 16:26:35 +0100
From: Frank Seitz <devnull4711@web.de>
Subject: Re: worst concept in computer science
Message-Id: <7vv4pbF5uhU4@mid.individual.net>

John Bokma wrote:
> Nick Keighley <nick_keighley_nospam@hotmail.com> writes:
>> On 10 Mar, 20:39, Jürgen Exner <jurge...@hotmail.com> wrote:
>>>
>>> Actually C pointers are probably among the worst concepts ever invented
>>> in computer science.
>> now there's a challenge. Who are the other competitors?
>>
>> - FORTRAN computed goto
>> - FORTRAN fixed layout
>> - Algol-60 free layout
>> - Algol-60 call by name
>> - Pascal with
>> - C declaration syntax
>> - C++ template syntax
>> - C++ exception specification
>> - PL/I
> 
> PHP
> XHTML

What is wrong with XHTML?

Frank
-- 
Dipl.-Inform. Frank Seitz
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel

Blog: http://www.fseitz.de/blog
XING-Profil: http://www.xing.com/profile/Frank_Seitz2


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

Date: Fri, 12 Mar 2010 09:34:58 -0600
From: John Bokma <john@castleamber.com>
Subject: Re: worst concept in computer science
Message-Id: <87aaud1rkt.fsf@castleamber.com>

Frank Seitz <devnull4711@web.de> writes:

> John Bokma wrote:
>> Nick Keighley <nick_keighley_nospam@hotmail.com> writes:
>>> On 10 Mar, 20:39, Jürgen Exner <jurge...@hotmail.com> wrote:
>>>>
>>>> Actually C pointers are probably among the worst concepts ever invented
>>>> in computer science.
>>> now there's a challenge. Who are the other competitors?
>>>
>>> - FORTRAN computed goto
>>> - FORTRAN fixed layout
>>> - Algol-60 free layout
>>> - Algol-60 call by name
>>> - Pascal with
>>> - C declaration syntax
>>> - C++ template syntax
>>> - C++ exception specification
>>> - PL/I
>> 
>> PHP
>> XHTML
>
> What is wrong with XHTML?

People seem to have a hard time to get it right. Thankfully, browsers
are forgiving: they work around not-well-formed XHTML, which is contrary
to what XML stands for.

Maybe XML should've been on that list as well. It has enough warts which
is funny for such a simple language.

-- 
John Bokma                                                               j3b

Hacking & Hiking in Mexico -  http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development


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

Date: Fri, 12 Mar 2010 12:05:41 -0500
From: Paul Wallich <pw@panix.com>
Subject: Re: worst concept in computer science
Message-Id: <hnds96$elv$1@reader1.panix.com>

Mario S. Mommer wrote:
> Nick Keighley <nick_keighley_nospam@hotmail.com> writes:
>> On 10 Mar, 20:39, Jürgen Exner <jurge...@hotmail.com> wrote:
>>
>>> Actually C pointers are probably among the worst concepts ever invented
>>> in computer science.
>> now there's a challenge. Who are the other competitors?
>>
>> - FORTRAN computed goto
>> - FORTRAN fixed layout
>> - Algol-60 free layout
>> - Algol-60 call by name
>> - Pascal with
>> - C declaration syntax
>> - C++ template syntax
>> - C++ exception specification
>> - PL/I
> 
> I miss
> 
>  - FORTRAN common blocks

But pointers, common blocks and computed goto (don't know the others 
well enough) aren't really computer science, are they? They pretty much 
predate any principled study of how languages should be put together, 
back in a time when getting any compiler at all to run was a big deal. 
Complaining about them is sort of like complaining about the irregular 
edges of stone tools.

paul


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

Date: Fri, 12 Mar 2010 05:40:00 -0800 (PST)
From: Permostat <pshendley@gmail.com>
Subject: Re: Writing to the end of a record
Message-Id: <b569d424-6387-47c5-84dd-07f4a46cf1d4@g7g2000yqe.googlegroups.com>

On Mar 11, 12:36=A0pm, Joe <jruff...@gailborden.info> wrote:
> Hi,
>
> I am trying to write to the end of a record once I find the data
> needed, but everything I have tried and the Internet is no real help.
>
> I open my data file by using 'open (LOCATE +<$filename') and the data
> is processed correctly when a match is found. =A0It is when I try to
> write to the end is when I have trouble.
>
> I have tried, using 'print LOCATE ($_ . ", done")', but when I run the
> program the data is never written to the file
>
> =A0If someone could tell me what i am doing wrong, I would really
> appreciate it.

Blast it with piss.

Herm=3D


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

Date: Fri, 12 Mar 2010 05:41:14 -0800 (PST)
From: Permostat <pshendley@gmail.com>
Subject: Re: XML::LibXML: Including xml fragments in a larger document
Message-Id: <1c1d6333-93be-42d9-900f-ce2fd7d8661c@k17g2000yqb.googlegroups.com>

On Mar 12, 4:38=A0am, Peter Makholm <pe...@makholm.net> wrote:
> Peter Makholm <pe...@makholm.net> writes:
> > =A0 =A0 my $node =3D XML::LibXML->new()->parse_balanced_chunk(
> > =A0 =A0 =A0 =A0 '<owner>pe...@makholm.net</owner>'
> > =A0 =A0 =A0);
> > =A0 =A0 $doc->adoptNode($node);
> > =A0 =A0 $root->addChild($node);
>
> After a bit more trying I can up with this solution:
>
> =A0 =A0 my $fragment =3D XML::LibXML->new()->parse_balanced_chunk(
> =A0 =A0 =A0 =A0 '<owner>pe...@makholm.net</owner>'
> =A0 =A0 );
> =A0 =A0 for my $node ($fragment->childNodes) {
> =A0 =A0 =A0 =A0 $root->addChild($node);
> =A0 =A0 }
>
> It works in both XML::LibXML version 1.66 and 1.70.
>
> //Makholm

Well aren't you just a hunky dory Fucker.

sperm-


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

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:

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

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 V11 Issue 2872
***************************************


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