[19197] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1392 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 27 14:06:24 2001

Date: Fri, 27 Jul 2001 11:05:21 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <996257120-v10-i1392@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 27 Jul 2001     Volume: 10 Number: 1392

Today's topics:
    Re: \nhelp <bart.lateur@skynet.be>
    Re: chess in perl slash@dot.c.o.m.org
    Re: DBD:ODBC, Openlink->MSSQL, and LongReadLen (Sebastian)
        DBI:vvp-How to display sql table results? <vprasad@americasm01.nt.com>
    Re: DBI:vvp-How to display sql table results? <jeff@vpservices.com>
        Emal Options Robustness (Kev)
    Re: Emal Options Robustness <pne-news-20010727@newton.digitalspace.net>
    Re: Extract the relative sorting of items from multiple (Anno Siegel)
    Re: FAQ: How do I expand function calls in a string? nobull@mail.com
    Re: FAQ: Where can I learn about object-oriented Perl p <mischief@velma.motion.net>
        Finding keywords in text files (shaz)
    Re: HTTP Question Marks? nobull@mail.com
    Re: Image Size <yanoff@yahoo.com>
    Re: Image Size nobull@mail.com
        Is there anyway? <bop@mypad.com>
    Re: Is there anyway? <rsherman@ce.gatech.edu>
        Pattern Search and Replace nth Occurance <eroby@webpositioning.com>
    Re: Pattern Search and Replace nth Occurance <tom.melly@ccl.com>
    Re: Pattern Search and Replace nth Occurance nobull@mail.com
    Re: Pattern Search and Replace nth Occurance nobull@mail.com
    Re: Read Directory <godzilla@stomp.stomp.tokyo>
    Re: Read Directory nobull@mail.com
    Re: Read Directory <iltzu@sci.invalid>
        Record Terminator (Buck Turgidson)
    Re: Record Terminator nobull@mail.com
    Re: Record Terminator (Anno Siegel)
        Socket and TCP_NODELAY <d_munzinger@yahoo.de>
    Re: Socket and TCP_NODELAY <skilchen@swissonline.ch>
    Re: sortlen -- filter to sort text by line length (Anno Siegel)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 27 Jul 2001 13:14:13 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: \nhelp
Message-Id: <ibq2mtsdm0ovd00g2ahp6k85iqfnump7gk@4ax.com>

Michael Budash wrote:

>  $buffer3 =~ s/\n(&&1;)/$1/g;
>  $buffer3 =~ s/\n(&&2;)/$1/g;
>  $buffer3 =~ s/\n(&&3;)/$1/g;
>  $buffer3 =~ s/\n(&&4;)/$1/g;
>  $buffer3 =~ s/\n(&&5;)/$1/g;

Why not simply

	$buffer3 =~ s/\n(&&[1-5];)/$1/g;

or, using lookahead:

	$buffer3 =~ s/\n(?=&&[1-5];)//g;

-- 
	Bart.


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

Date: Fri, 27 Jul 2001 15:55:57 GMT
From: slash@dot.c.o.m.org
Subject: Re: chess in perl
Message-Id: <3b618bce.8892531@news.freeserve.co.uk>

On 26 Jul 2001 11:06:42 -0700, stmintz@yahoo.com (Sean Mintz) wrote:


You might try contacting some of the contestants who entered chess programs in the
5k.org contest this year. The competition is for people to submit web pages/web
animations/web based games, the only stipulation is that the entries must total no
more than 5120 bytes, including graphics etc! There were several playable chess
programs there written in Javascript, which played quite well. The versions on the
site are obviously unreadable as the code has been compressed as much as possible,
but the authors themselves would probably be glad to share their ideas.

http://www.the5k.org/ is the site and one of the chess games is at
http://www.the5k.org/description.asp/entry_id=615 (just hit the [go] button in the
game and it will play against itself for you!)



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

Date: 27 Jul 2001 08:52:18 -0700
From: dethtoll@yahoo.com (Sebastian)
Subject: Re: DBD:ODBC, Openlink->MSSQL, and LongReadLen
Message-Id: <ea245403.0107270752.5137e3cd@posting.google.com>

Erland Sommarskog <sommar@algonet.se> wrote in message news:<Xns90EB6559D031Yazorman@127.0.0.1>...
> Sebastian (dethtoll@yahoo.com) writes:
> > I'm using perl DBI, DBD::ODBC, and OpenLink drivers to connect to a
> > Win2k MS SQL Server. DBI's LongReadLen method seems to have no effect,
> > I still get <255 characters when retrieving data from long memo
> > fields. Has anyone run into this?
> 
> How old is the OpenLink driver?
> 
> If the client is speaking an earlier version of the TDS protocol than
> TDS7, then SQL Server will revert to 6.5 behaviour, and only return
> the datatypes available in 6.5. Which for varchar and char means
> 255 character at most.
> 
> Now, you say "memo", which is usually means "text", and even with
> an old driver you should be able to get back data > 255.
> 
> But I have not used DBI nor Openlink, so I don't know if there any
> issue with these.

The Openlink request broker (the server component) is version 2.14
release 4.0, dated March 8 2001. I can't find the version info for the
client driver on Linux, but it was the version packaged with the
server side, so it's pretty recent.

A field in question has a MSSQL type of varchar(7000). This is a field
where I can only get <255 chars, regardless of DBI's
$dbh->{LongReadLen} value. I am setting this value just after my
connect statement, but before any preparing.

Thanks, Sebastian


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

Date: Fri, 27 Jul 2001 12:26:10 -0400
From: "Prasad, Victor [FITZ:K500:EXCH]" <vprasad@americasm01.nt.com>
Subject: DBI:vvp-How to display sql table results?
Message-Id: <3B619622.390D3387@americasm01.nt.com>

Hello,

I am connected to an Informix database.  I want to be able to query a
table and output to a web page with NEXT and PREVIOUS buttons so they
can scroll through the data record by record.  Not getting all the data
dumped out on the page.

ie.

NAME [john]
JOB  [math]

-------

(next record after next button is pressed)

NAME [mary]
JOB  [spelling]

etx.

Thanks,

V


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

Date: Fri, 27 Jul 2001 09:43:23 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: DBI:vvp-How to display sql table results?
Message-Id: <3B619A2B.B32FE21C@vpservices.com>

"Prasad, Victor [FITZ:K500:EXCH]" wrote:
> 
> Hello,
> 
> I am connected to an Informix database.  I want to be able to query a
> table and output to a web page with NEXT and PREVIOUS buttons so they
> can scroll through the data record by record.  Not getting all the data
> dumped out on the page.
> 
> ie.
> 
> NAME [john]
> JOB  [math]
> 
> -------
> 
> (next record after next button is pressed)
> 
> NAME [mary]
> JOB  [spelling]

This isn't a perl question (yet).

If you have unique incremented IDs, just have the next button pass the
current ID to the CGI.  If you don't, see if there is a LIMIT clause in
Informix and pass the current offset and limit on with the form
submittal.  If neither of those work, create your own record counter and
pass that on with the form.  Check CGI or database related newsgroups if
you don't know how to do the first two suggestions and if those don't
work and you need help with the third one, give it a try and post the
code you've tried here and we'll try to help.

-- 
Jeff



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

Date: Fri, 27 Jul 2001 17:44:44 GMT
From: NOSPAMlekkerinsydney@ozemail.com.au (Kev)
Subject: Emal Options Robustness
Message-Id: <3b61a842.266562@news.ozemail.com.au>

Hi All

Which of the following (all things equal) would
you gurus suggest to be the most robust for a
relatively email heavy perl program:
- perl with sendmail on unix
- perl with blat on NT
- perl with the SMTP module on unix
- perl with the SMTP module on nt

thanks from a perl newbie

K



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

Date: Fri, 27 Jul 2001 18:06:05 +0200
From: Philip Newton <pne-news-20010727@newton.digitalspace.net>
Subject: Re: Emal Options Robustness
Message-Id: <k743mtsse456p3kfr3pk7mlqh9jhe9stpm@4ax.com>

On Fri, 27 Jul 2001 17:44:44 GMT, NOSPAMlekkerinsydney@ozemail.com.au
(Kev) wrote:

> Which of the following (all things equal) would
> you gurus suggest to be the most robust for a
> relatively email heavy perl program:
> - perl with sendmail on unix
> - perl with blat on NT
> - perl with the SMTP module on unix
> - perl with the SMTP module on nt

I'm not a guru and have little practical experience with sending email
via Perl, but I would probably pick the first option. Unix is often
considered a more robust operating system than WinNT, which rules out
(2) and (4), and using sendmail or a similar program is more robust than
rolling your own with Net::SMTP or similar since you don't have to
handle DNS lookups, retries for temporary SMTP failures, etc. yourself.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: 27 Jul 2001 13:31:30 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Extract the relative sorting of items from multiple lists
Message-Id: <9jrqfi$mp8$1@mamenchi.zrz.TU-Berlin.DE>

According to Bart Lateur  <bart.lateur@skynet.be>:
> I've got a cute little problem here. It's actually more of a question
> for a proper algorithm, than a specific perl problem.
> 
> I have to extract the ordering of each item in some arrays, and not
> every item is present in every array. For example:
> 
> 	@list = ([qw(A C F)], [qw(A B C)], [qw(A C D E)], [qw(E F)]);
> 
> From this, I'd need to deduce that 'B' comes before 'C' and after 'A',
> and so on, so I'd eventually have to come up with the list qw(A B C D E
> F). How would you do that?
> 
> If there's more than one solution, any solution will do, and if there's
> a conflict, e.g. between orderings qw(A B C) and qw(C A), I'd like to be
> warned about it.
> 
> As a thought for a starting point: for qw(A C F), I'd assign a number to
> each entry, for example (A => 1, C => 2, F => 3), and try to assign
> intermediate values for values that have to come in between existing
> items. The big question is how to mark unresolved relative orderings,
> for example before examining the last entry in the above example list,
> you know that 'D' comes after 'C'; and that 'F' comes after 'C'. So
> where does 'F' stand relative to 'D'? Unresolved. And what about 'E'? It
> comes after 'D', true... but in relation to 'F'?

There's a module for that!

Well, not quite, but Abigail's Algorithm::Graphs::TransitiveClosure
can play a part.

So we have a number of partial order relations,

    A<C<F, A<B<C, A<C<D<E and E<F

and we want to see if they induce a total ordering of all the
elements.  Well, this is how I read the problem, correct me if
I'm wrong.

There are two ways in which this can fail:  There could be a contra-
diction, (adding E<A would constitute one) and there could be
items whose relation is undefined (add Y<Z and nothing else).

Looking at the data as a directed graph, these questions translate
immediately:  There is a contradiction when the graph contains a loop,
and there are un-comparable elements if the graph isn't connected.
If you want the ordering to be linear the graph may not branch.
These questions are dealt with routinely in collections of graph
algorithms, though I'm not aware of implementations on CPAN.

When the validity of the original relationships has been established,
TransitiveClosure will blow up the graph to contain the implied
relationships also.

Anno




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

Date: 27 Jul 2001 17:13:38 +0100
From: nobull@mail.com
Subject: Re: FAQ: How do I expand function calls in a string?
Message-Id: <u966ce2vv1.fsf@wcl-l.bham.ac.uk>

PerlFAQ Server <faq@denver.pm.org> writes:

>   How do I expand function calls in a string?
> 
>     This is documented in the perlref manpage. In general, this is fraught
>     with quoting and readability problems, but it is possible. To
>     interpolate a subroutine call (in list context) into a string:
> 
>         print "My sub returned @{[mysub(1,2,3)]} that time.\n";
> 
>     If you prefer scalar context, similar chicanery is also useful for
>     arbitrary expressions:

No it is not.  Please remove this disinformation from the FAQ.  I'm
fairly sure I've reported this before.

>         print "That yields ${\($n + 5)} widgets\n";
> 
>     Version 5.004 of Perl had a bug that gave list context to the expression
>     in "${...}", but this is fixed in version 5.005.

This may be true, however it is irrelevant as the \(...) construct
does not propagate the scalar context.  Rather, scalar(\(EXPR))
evaluates EXPR in a list context[1] and then returns a reference to
the last element.

[1] Actually it's quite not a true list context. If EXPR is of the
form SUBEXPR,SUBEXPR... and any SUBEXPR is an array or hash the
latter is not expanded.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Fri, 27 Jul 2001 15:13:06 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: FAQ: Where can I learn about object-oriented Perl programming?
Message-Id: <tm318220g8ufef@corp.supernews.com>

PerlFAQ Server <faq@denver.pm.org> wrote:

>   Where can I learn about object-oriented Perl programming?

>     A good place to start is the perltoot manpage, and you can use the

Another good place to look is in Conway's _Object_Oriented_Perl_.
I realize this book is probably newer than this FAQ entry, but
it' a good time to update.


-- 
Try not. Do, or do not. The Force is binary. -- Yoda,
The Empire Strikes Back (paraphrased)



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

Date: 27 Jul 2001 06:48:16 -0700
From: ssa1701@yahoo.co.uk (shaz)
Subject: Finding keywords in text files
Message-Id: <23e71812.0107270548.79929c5f@posting.google.com>

I was wondering if anyone might know where I can find a script that
can look at a text file and produce the keyword (based on no of
occurances)?

I have begun to write the code myself, but am finding it more
difficult than I thought.

Any help would be appreciated.


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

Date: 27 Jul 2001 17:32:09 +0100
From: nobull@mail.com
Subject: Re: HTTP Question Marks?
Message-Id: <u9puam1gfq.fsf@wcl-l.bham.ac.uk>

hopkins@syndesis.com (L Hopkins) writes:

> I apologize in advance, however I can't seem to find an http
> newsgroup.

So... try a general purpose www newsgroup, at least this would be less
off-topic there.

> I need to create a mailto, and as the syntax goes, '?' is the first
> character if a blank mailto.  My problem is that I need a '?' in the
> subject, for example I need the subject to look like the following:
> 
> ?subject=test&body=http://localhost/page.cgi?id=456
> 
> This works correctly for Netscape's mail client, however Outlook just
> chokes on everything past the second question mark.  Is there an
> escape character that works for both mail clients?

Dunno, have you tried the obvious %-hex encoding?

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Fri, 27 Jul 2001 09:53:41 -0500
From: Scott Yanoff <yanoff@yahoo.com>
To: "Johannes B." <johannes_be@gmx.de>
Subject: Re: Image Size
Message-Id: <3B618075.7AC0E34C@yahoo.com>

"Johannes B." wrote:
> 
> Hi!
> 
> How can I get the width and height of an gif image which is located in a
> folder of my server?

Based on previous posts, I see that you cannot use the CPAN module.  Try
this script called "isize" at:

ftp://ftp.crc.ricoh.com/pub/www/isize

(Code too long to post here.)

Good luck,
-- 
-Scott
yanoff@yahoo.com | http://www.yanoff.org | AOL IM: SAY KJY


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

Date: 27 Jul 2001 17:16:07 +0100
From: nobull@mail.com
Subject: Re: Image Size
Message-Id: <u93d7i2vqw.fsf@wcl-l.bham.ac.uk>

"Johannes B." <johannes_be@gmx.de> writes in untrimmed jeopardy style.
I do not know if this is through ignorance or if it is deliberate
rudeness...

> "Ilya Martynov" <ilya@martynov.org> wrote in message
> news:87wv4uu9of.fsf@abra.ru...
> >

> > JB> So I need the width and height of the digit to paste it correctly.
> > JB> How can I get this data?
> >
> > Use Image::Size from CPAN.

> Thx, but I don't have Image::Size on my server.
> And I cant install it.

Why do you believe this?  According to its CPAN index entry
Image::Size is pure-Perl so you can simply copy it to your module
directory - no compilation required.
 
> Is there another Way????

Modules on CPAN are source-code.  If you want to achieve the same
thing as a module without installing the module then look at what is
done in the module.  This is particularly easy in the case of
pure-Perl modules such as Image::Size.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Fri, 27 Jul 2001 11:43:55 -0400
From: "flash" <bop@mypad.com>
Subject: Is there anyway?
Message-Id: <VZf87.2459$uw3.130927@news20.bellglobal.com>

Is there a way that a perl script can use a graphical program.
Like fill in certain feilds and hit done or something?
(If there is a module just tell me the name)
Will setupsup work?





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

Date: Fri, 27 Jul 2001 12:15:17 +0500
From: Robert Sherman <rsherman@ce.gatech.edu>
Subject: Re: Is there anyway?
Message-Id: <3B611505.D20813AC@ce.gatech.edu>

flash wrote:
> 
> Is there a way that a perl script can use a graphical program.
> Like fill in certain feilds and hit done or something?
> (If there is a module just tell me the name)
> Will setupsup work?


Tk (cross-platform)

Win32::GUI (win32)


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

Date: Fri, 27 Jul 2001 11:18:36 -0400
From: Ed Robisheaux <eroby@webpositioning.com>
Subject: Pattern Search and Replace nth Occurance
Message-Id: <270720011118361049%eroby@webpositioning.com>

I need to find the nth occurance of $pat in $line where $line may have
many occurances of $pat. The task here is to replace the nth occurance,
and not all of the occurances or just the first one.

Can someone offer an example of doing this?

This code always replaces all occurances:

while ($line=~/$pat/g) {
   $line=~s/$pat/$repl/;
}

I want to replace, say, just the 3rd or 4th occurance.

Thanks



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

Date: Fri, 27 Jul 2001 17:22:09 +0100
From: "Tom Melly" <tom.melly@ccl.com>
Subject: Re: Pattern Search and Replace nth Occurance
Message-Id: <3b619531$0$8511$ed9e5944@reading.news.pipex.net>

"Ed Robisheaux" <eroby@webpositioning.com> wrote in message
news:270720011118361049%eroby@webpositioning.com...

Well, untested, and I'm no guru, but something like (where your "n" = 4):

$line =~ s/(.*$pat.*){3}($pat)/$1$repl/;




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

Date: 27 Jul 2001 17:30:54 +0100
From: nobull@mail.com
Subject: Re: Pattern Search and Replace nth Occurance
Message-Id: <u9u1zy1ght.fsf@wcl-l.bham.ac.uk>

Ed Robisheaux <eroby@webpositioning.com> writes:

> I need to find the nth occurance of $pat in $line where $line may have
> many occurances of $pat. The task here is to replace the nth occurance,
> and not all of the occurances or just the first one.

I'm sure I've seen this question a few times recently.  Sounds
suspiciously like homework to me.

> This code always replaces all occurances:
> 
> while ($line=~/$pat/g) {
>    $line=~s/$pat/$repl/;
> }

As, rather more simply, does..

    $line=~s/$pat/$repl/g;

> I want to replace, say, just the 3rd or 4th occurance.

$line =~ s/(($pat.*?){2})$pat/$1$repl/; # 3rd occurance
$line =~ s/(($pat.*?){3})$pat/$1$repl/; # 4th occurance
$line =~ s/(($pat.*?){99})$pat/$1$repl/; # 100th occurance

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 27 Jul 2001 17:28:47 +0100
From: nobull@mail.com
Subject: Re: Pattern Search and Replace nth Occurance
Message-Id: <u9vgke1glc.fsf@wcl-l.bham.ac.uk>

"Tom Melly" <tom.melly@ccl.com> writes:

> "Ed Robisheaux" <eroby@webpositioning.com> wrote in message
> news:270720011118361049%eroby@webpositioning.com...
> 
> Well, untested, and I'm no guru, but something like (where your "n" = 4):
> 
> $line =~ s/(.*$pat.*){3}($pat)/$1$repl/;

Perhaps you should have tested.

Actually yes, the solution is "something like" that.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Fri, 27 Jul 2001 09:30:34 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Read Directory
Message-Id: <3B61972A.380C08C0@stomp.stomp.tokyo>

Ilmari Karonen AKA The CLPM Troll wrote:

> Blnukem wrote:

> >    I'm tying to read all of the files in a directory but with my script I
> >get a dot "." and a double ".." listed as files. I'm guessing that this is
> >the directory structure that it is reading is there a way to read just the
> >file in the directory without the dots.

> >opendir (DOC, "../test");
> >@files = readdir (DOC);
 
> If you really want just files, and not subdirectories, then Godzilla's
> advice would appear to be correct for once.

You are telling more of your usual lies. My code samples are
almost always correct, in excess of ninety-nine percent valid.
No others here, save for Randal, Jeff Zucker and one or two 
others, enjoy this high percentage level of posting valid code.



> made quite a bit simpler:
 
>   opendir DOC, "../test";
>   my @files = grep -f "../test/$_", readdir DOC;


Use of grep produces slow and inefficient code. This has
been well documented by me many times. You should pay
attention and learn. 

Rarely is shorter obfuscated code better code.


Godzilla!


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

Date: 27 Jul 2001 17:31:31 +0100
From: nobull@mail.com
Subject: Re: Read Directory
Message-Id: <u9snfi1ggs.fsf@wcl-l.bham.ac.uk>

Ilmari Karonen <iltzu@sci.invalid> writes:

>   my @files = grep $_ ne "." && $_ ne "..", readdir DOC;
> 
> This will work on Unix and Windows, and shouldn't cause problems on most
> other systems unless you have an actual subdirectory named "." or "..".
> 
> Unfortunately AFAIK Perl currently has no guaranteed cross-platform way
> of excluding non-child entries from a directory listing.

File::Spec->no_upwards

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 27 Jul 2001 17:17:27 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Read Directory
Message-Id: <996253225.15094@itz.pp.sci.fi>

In article <u9snfi1ggs.fsf@wcl-l.bham.ac.uk>, nobull@mail.com wrote:
>Ilmari Karonen <iltzu@sci.invalid> writes:
>
>>   my @files = grep $_ ne "." && $_ ne "..", readdir DOC;
>> 
>> This will work on Unix and Windows, and shouldn't cause problems on most
>> other systems unless you have an actual subdirectory named "." or "..".
>> 
>> Unfortunately AFAIK Perl currently has no guaranteed cross-platform way
>> of excluding non-child entries from a directory listing.
>
>File::Spec->no_upwards

 ..except that currently all the File::Spec::* modules inherit the Unix
no_upwards, which I believe is wrong on the Mac at least.  In any case,
File::Spec has submodules for only the most common systems -- not all
the people who've ported perl to some obscure platform have got around
to writing a module to handle filesystem paths on it.

Still, I suppose the right thing to do would be to fix that as well as
we can, and then extending the File::Spec test suite to make sure the
results actually make sense on the local filesystem.

Does anyone have a round tuit I could borrow?

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post something,
we discuss its implications.  If the discussion happens to answer a question
you've asked, that's incidental."           -- nobull in comp.lang.perl.misc



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

Date: 27 Jul 2001 09:22:12 -0700
From: jc_va@hotmail.com (Buck Turgidson)
Subject: Record Terminator
Message-Id: <f98999c8.0107270822.7ef5be76@posting.google.com>

I have a Perl program that reads through some Oracle SQL statements,
and pulls out certain attributes.  It looks for the statement
terminator, which is typically a '/' character, but can also be a ';'

I have set $/ = to one or the other, in order to parse through a
multi-line statement.

Is there a way that $/ can be set to a range of characters, such as
both '/' or ';'  ?

Appreciate any advice.


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

Date: 27 Jul 2001 17:31:41 +0100
From: nobull@mail.com
Subject: Re: Record Terminator
Message-Id: <u9r8v21ggi.fsf@wcl-l.bham.ac.uk>

jc_va@hotmail.com (Buck Turgidson) writes:

> I have a Perl program that reads through some Oracle SQL statements,
> and pulls out certain attributes.  It looks for the statement
> terminator, which is typically a '/' character, but can also be a ';'
> 
> I have set $/ = to one or the other, in order to parse through a
> multi-line statement.
> 
> Is there a way that $/ can be set to a range of characters, such as
> both '/' or ';'  ?

No.
 
> Appreciate any advice.

Slurp the whole lot into a string and split it.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 27 Jul 2001 16:53:00 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Record Terminator
Message-Id: <9js69c$sa3$2@mamenchi.zrz.TU-Berlin.DE>

According to Buck Turgidson <jc_va@hotmail.com>:
> I have a Perl program that reads through some Oracle SQL statements,
> and pulls out certain attributes.  It looks for the statement
> terminator, which is typically a '/' character, but can also be a ';'
> 
> I have set $/ = to one or the other, in order to parse through a
> multi-line statement.
> 
> Is there a way that $/ can be set to a range of characters, such as
> both '/' or ';'  ?
> 
> Appreciate any advice.

No.  As the Camel sez, "Awk has to be better at something".

Set $/ to one terminator and split each chunk on the other.

Anno


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

Date: Fri, 27 Jul 2001 16:56:55 +0200
From: Dirk Munzinger <d_munzinger@yahoo.de>
Subject: Socket and TCP_NODELAY
Message-Id: <3B618137.257B5657@yahoo.de>

Hello !

I am using this code 

	setsockopt($toClient,SOL_SOCKET,TCP_NODELAY,1) 

in a server writte in perl 5.6 for disableing the 100ms
(Nagle-Algorithmus) delay when doing a syswrite(). 
But if I execute the program I get this error:

	Argument "TCP_NODELAY" isn't numeric in setsockopt at ...

and it looks like the  Nagle-Algorithmus is still enabled. 
Any idea what is going wrong ?

Dirk


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

Date: Fri, 27 Jul 2001 17:39:35 +0200
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: Socket and TCP_NODELAY
Message-Id: <9js2oi$1an5j$1@ID-13368.news.dfncis.de>

"Dirk Munzinger" <d_munzinger@yahoo.de> wrote in
news:3B618137.257B5657@yahoo.de...
>
> I am using this code
>
> setsockopt($toClient,SOL_SOCKET,TCP_NODELAY,1)
>
TCP_NODELAY isn't exported by default in Socket.pm.
SOL_SOCKET is the wrong level. Use IPPROTO_TCP (6) instead.


try something like:

use Socket;
setsockopt($toClient, &Socket::IPPROTO_TCP, &Socket::TCP_NODELAY, 1);

or:

use Socket qw(:all);
setsockopt($toClient, IPPROTO_TCP, TCP_NODELAY, 1);

or (not recommended):
setsockopt($toClient, 6, 1, 1);




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

Date: 27 Jul 2001 14:10:15 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: sortlen -- filter to sort text by line length
Message-Id: <9jrso7$mp8$2@mamenchi.zrz.TU-Berlin.DE>

According to Yves Orton <demerphq@hotmail.com>:
> Chris Stith <mischief@velma.motion.net> wrote in message
> news:<tm17t1gute4f8@corp.supernews.com>...
> > Yves Orton <demerphq@hotmail.com> wrote:
> > > Benjamin Goldberg <goldbb2@earthlink.net> wrote in message
> news:<3B54F150.7408211B@earthlink.net>...
 
[...]

> > > A minor question: What does GRT stand for?
> > 
> > That's a major question, IMHO. It stands for Guttman-Rosler Transform,
> > as in Uri Guttman an Larry Rosler, coauthors of a work on efficient
> > sorting in Perl. They codiyfied it clearly and popularized it, and
> > although they did not think up the concept from scratch, I think the
> > name is pretty fitting considering the amount of time and effort
> > Rosler and Guttman put into demonstrating its use with mny different
> > data types.
> 
> With different data types?  That sounds interesting.  Id like to
> understand this technique a bit better, especially as to how it can be
> used with multiple keys (or not) and with more complicated data types.
> Can you point me to some references or should I just trawl usenet for
> references to GRT?

It's basically one paper, to be found at

    http://www.sysarch.com/perl/sort_paper.html

among other places.

> Also, its interesting that the GRT is not mentioned in books like Perl
> Cookbook or Algorithyms in Perl (or whatever its called, I left it at
> home.)  The Cookbook covers the ST with quite a bit of depth, as does
> Algorithyms... Seems like the GRT should at least have been mentioned.

The GRT paper is newer than both these books.

Anno


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

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 1392
***************************************


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