[30741] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1986 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 16 16:09:46 2008

Date: Sun, 16 Nov 2008 13:09:11 -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           Sun, 16 Nov 2008     Volume: 11 Number: 1986

Today's topics:
    Re: atoi/atof sln@netherlands.com
    Re: Client-Server Communication in Perl CGI <nospam@somewhere.com>
        cpan reinstall <rodbass63@gmail.com>
    Re: cpan reinstall <rodbass63@gmail.com>
    Re: cpan reinstall <smallpond@juno.com>
    Re: cpan reinstall <smallpond@juno.com>
    Re: cpan reinstall <bart.lateur@pandora.be>
        Hotbar free download : Hotbar adds a toolbar to ... <anubha9903@gmail.com>
    Re: Huge files manipulation sln@netherlands.com
        new CPAN modules on Sun Nov 16 2008 (Randal Schwartz)
    Re: Perl equivalent of simple awk script sln@netherlands.com
    Re: PHP's ob_gzhandler equivalent in Perl ? <nospam@somewhere.com>
    Re: PHP's ob_gzhandler equivalent in Perl ? <hjp-usenet2@hjp.at>
    Re: PHP's ob_gzhandler equivalent in Perl ? <bart.lateur@pandora.be>
    Re: Using unreferenced labels <hjp-usenet2@hjp.at>
    Re: Using unreferenced labels <nospam-abuse@ilyaz.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 16 Nov 2008 21:06:37 GMT
From: sln@netherlands.com
Subject: Re: atoi/atof
Message-Id: <ci21i4p5et9priv2p0o2ed7un17a38rp0c@4ax.com>

On Sat, 15 Nov 2008 19:37:00 +0100, "Peter J. Holzer" <hjp-usenet2@hjp.at> wrote:

>On 2008-11-14 04:41, Jürgen Exner <jurgenex@hotmail.com> wrote:
>> debjyoti@gmail.com wrote:
>>>I was messing around with a perl script and realized converting
>>>strings to integers/floats is iffy on perl (compared to C). 
>>
>> Really?
>
>Yes, really. The Perl routines for converting between strings and
>numbers are buggy. 
>
>> I haven't noticed.
>
>I guess most people haven't, or the bugs would be fixed already. These
>bugs have been there for a very long time, but they show up only if you
>get close to the 15 digits/53 bits of FP precision.
>
>I'm almost sure the OP's code is even buggier, though. String/number
>conversions aren't trivial.
>
>	hp

">>>strings to integers/floats is iffy on perl (compared to C). "

Aren't trivial? So ANSI C++ hasn't got it right yet? Perl had to bypass.
Its the other way around, number to string isin't trivial.


sln



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

Date: Sun, 16 Nov 2008 04:05:27 -0500
From: "Thrill5" <nospam@somewhere.com>
Subject: Re: Client-Server Communication in Perl CGI
Message-Id: <gfonoq$9fu$1@nntp.motzarella.org>


"Sherm Pendley" <spamtrap@dot-app.org> wrote in message 
news:m14p2ap92d.fsf@dot-app.org...
> sri <sriseetha1986@gmail.com> writes:
>
>> My client program is a browser
>
> Do you mean, a web browser?
>
>>, and the server may be run in perl, ror
>> or any other server side scripting. The browser has to send the
>> request to the server once
>
> Yes, that's how HTTP works. It's a stateless protocol, no connection is
> maintained. The client sends a request, the server returns a response,
> then they part company and go their separate ways until the client makes
> another request.
>
>> after that the server has to keep track of
>> the client and send the response frequently to the client.
>
> Rethink your design. A web server can't do that within the bounds of the
> HTTP protocol, regardless of what scripting language it's using.
>
>> One way we can achieve this with Applets.
>
> Yes, an applet could open and maintain a long-running connection, but to
> do so it would have to use something other than HTTP. That means it
> would have to connect to an application server that speaks something
> other than HTTP - i.e. something that isn't a web server.
>
>> Is there any other way to
>> achieve this ??
>
> To achieve *what*? You haven't said what you want to do, just how you
> think you want to do it. What's the end goal of all this?
>
> sherm--
>
> -- 
> My blog: http://shermspace.blogspot.com
> Cocoa programming in Perl: http://camelbones.sourceforge.net

Your server side application needs a "Session" module.  One of the 
advantages of writing complex applications in ASP.Net is that session state 
is automatically maintained between loads of the same page by the same user, 
and a very easy mechanism exists to maintain variables across different 
pages by the same user.  Modules also exist to allow you to do this in Perl 
CGI applications, but is a bit more tedious and complex to implement. 




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

Date: Sat, 15 Nov 2008 19:59:27 -0800 (PST)
From: Nene <rodbass63@gmail.com>
Subject: cpan reinstall
Message-Id: <25b0b55f-6f0a-4180-9a6a-4e1545f179a6@a29g2000pra.googlegroups.com>

Hello,

I had a /root/.cpan directory which I deleted by accident, now my cpan
is toasted. How can reinstall cpan?

usaims


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

Date: Sun, 16 Nov 2008 06:01:33 -0800 (PST)
From: Nene <rodbass63@gmail.com>
Subject: Re: cpan reinstall
Message-Id: <ec14ca39-edbb-435b-8ae4-a2e45fba0365@h23g2000prf.googlegroups.com>

On Nov 15, 10:59=A0pm, Nene <rodbas...@gmail.com> wrote:
> Hello,
>
> I had a /root/.cpan directory which I deleted by accident, now my cpan
> is toasted. How can reinstall cpan?
>
> usaims

This is what I get when I do a 'install Bundle::CPAN'

Error while trying to rename '/root/.cpan/sources/authors/
01mailrc.txt.gz.tmp7539' to '/root/.cpan/sources/authors/
01mailrc.txt.gz': No such file or directoryTerminal does not support
GetHistory.
Lockfile removed.

-bash-3.00# ls
01mailrc.txt.tmp7539  01mailrc.txt.tmp7539.gz
-bash-3.00#



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

Date: Sun, 16 Nov 2008 06:25:34 -0800 (PST)
From: smallpond <smallpond@juno.com>
Subject: Re: cpan reinstall
Message-Id: <a08564db-1e75-4122-b9fb-6bcf9419baf8@a17g2000prm.googlegroups.com>

On Nov 16, 9:01 am, Nene <rodbas...@gmail.com> wrote:
> On Nov 15, 10:59 pm, Nene <rodbas...@gmail.com> wrote:
>
> > Hello,
>
> > I had a /root/.cpan directory which I deleted by accident, now my cpan
> > is toasted. How can reinstall cpan?
>
> > usaims
>
> This is what I get when I do a 'install Bundle::CPAN'
>
> Error while trying to rename '/root/.cpan/sources/authors/
> 01mailrc.txt.gz.tmp7539' to '/root/.cpan/sources/authors/
> 01mailrc.txt.gz': No such file or directoryTerminal does not support
> GetHistory.
> Lockfile removed.
>
> -bash-3.00# ls
> 01mailrc.txt.tmp7539  01mailrc.txt.tmp7539.gz
> -bash-3.00#


Trying to install cpan from within cpan seems like more of a problem
in teleology
than perl.

Have you tried:
  o conf init




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

Date: Sun, 16 Nov 2008 06:47:02 -0800 (PST)
From: smallpond <smallpond@juno.com>
Subject: Re: cpan reinstall
Message-Id: <5b5c6914-9e6d-42d4-88a2-4b47ad46974e@k24g2000pri.googlegroups.com>

On Nov 16, 9:25 am, smallpond <smallp...@juno.com> wrote:
> On Nov 16, 9:01 am, Nene <rodbas...@gmail.com> wrote:
>
>
>
> > On Nov 15, 10:59 pm, Nene <rodbas...@gmail.com> wrote:
>
> > > Hello,
>
> > > I had a /root/.cpan directory which I deleted by accident, now my cpan
> > > is toasted. How can reinstall cpan?
>
> > > usaims
>
> > This is what I get when I do a 'install Bundle::CPAN'
>
> > Error while trying to rename '/root/.cpan/sources/authors/
> > 01mailrc.txt.gz.tmp7539' to '/root/.cpan/sources/authors/
> > 01mailrc.txt.gz': No such file or directoryTerminal does not support
> > GetHistory.
> > Lockfile removed.
>
> > -bash-3.00# ls
> > 01mailrc.txt.tmp7539  01mailrc.txt.tmp7539.gz
> > -bash-3.00#
>
> Trying to install cpan from within cpan seems like more of a problem
> in teleology
> than perl.
>
> Have you tried:
>   o conf init


Just to clarify:

teleology is the intersection of two domains:

I. cause and effect is the objective physical connection
between two events A and B.  We say A causes B.

II. purpose is the subjective moral connection between two
events A and B,  We say the purpose of A is to produce B.

One definition of God is the set of all things from the above
two domains where A = B.  That is, the things which cause
themselves and whose purpose is to exist.  To an atheist,
the set is empty and to a pantheist it includes the entire
universe.

In the case of CPAN, the results are less encouraging.

--S


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

Date: Sun, 16 Nov 2008 15:58:28 +0100
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: cpan reinstall
Message-Id: <77d0i4t4ojdqaus1f9d68fscbhacss53hb@4ax.com>

Nene wrote:

>I had a /root/.cpan directory which I deleted by accident, now my cpan
>is toasted. How can reinstall cpan?

Huh? IMO deleting this directory has no effect at all on your
installation. It's just the download and build cache.


-- 
	Bart.


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

Date: Sun, 16 Nov 2008 02:56:48 -0800 (PST)
From: Anubha Sarkar <anubha9903@gmail.com>
Subject: Hotbar free download : Hotbar adds a toolbar to ...
Message-Id: <336553d6-8a65-43ca-b2b7-1bb66938ded5@b31g2000prb.googlegroups.com>

Hotbar free download : Hotbar adds a toolbar to ...

Hotbar free download. Hotbar adds a toolbar to your current email
application that allows you to customize your email with a wide
variety of backgrounds, ...

http://www.freedownload.coz.bz


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

Date: Sun, 16 Nov 2008 20:51:41 GMT
From: sln@netherlands.com
Subject: Re: Huge files manipulation
Message-Id: <k511i4p5phtugrgcmcmpvdafevfl84tu83@4ax.com>

On Mon, 10 Nov 2008 02:24:53 -0800 (PST), klashxx <klashxx@gmail.com> wrote:

>Hi , i need a fast way to delete duplicates entrys from very huge
>files ( >2 Gbs ) , these files are in plain text.
>
>..To clarify, this is the structure of the file:
>
>30xx|000009925000194653|00000000000000|20081031|02510|00000005445363|
>01|F|0207|00|||+0005655,00|||+0000000000000,00
>30xx|000009925000194653|00000000000000|20081031|02510|00000005445363|
>01|F|0207|00|||+0000000000000,00|||+0000000000000,00
>30xx|4150010003502043|CARDS|20081031|MP415001|00000024265698|01|F|
>1804|
>00|||+0000000000000,00|||+0000000000000,00
>
>Having a key formed by the first 7 fields i want to print or delete
>only the duplicates( the delimiter is the pipe..).
>
>I tried all the usual methods ( awk / sort /uniq / sed /grep .. ) but
>it always ended with the same result (out of memory!)
>
>In using HP-UX large servers.
>
>I 'm very new to perl, but i read somewhere tha Tie::File module can
>handle very large files , i tried but cannot get the right code...
>
>Any advice will be very well come.
>
>Thank you in advance.
>
>Regards
>
>PD:I do not want to split the files.

I can do this for you with custom algorithym's.
Each file is sent to me and each has an independent
fee, based on processing time. Or I can license my
technologoy to you, flat-fee, per usage based.

Let me know if your interrested, post a contact email address.


sln



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

Date: Sun, 16 Nov 2008 05:42:23 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sun Nov 16 2008
Message-Id: <KAEvun.192z@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

Acme-RandomQuote-Base-0.01
http://search.cpan.org/~mangaru/Acme-RandomQuote-Base-0.01/
The great new Acme::RandomQuote::Base! 
----
App-CamelPKI-0.05
http://search.cpan.org/~grm/App-CamelPKI-0.05/
A multi-purpose PKI. 
----
App-ZofCMS-Plugin-DBI-0.0311
http://search.cpan.org/~zoffix/App-ZofCMS-Plugin-DBI-0.0311/
DBI access from ZofCMS templates 
----
App-ZofCMS-Plugin-FormChecker-0.0311
http://search.cpan.org/~zoffix/App-ZofCMS-Plugin-FormChecker-0.0311/
plugin to check HTML form data. 
----
App-ZofCMS-Plugin-FormChecker-0.0312
http://search.cpan.org/~zoffix/App-ZofCMS-Plugin-FormChecker-0.0312/
plugin to check HTML form data. 
----
Audio-GtkGramofile-0.10
http://search.cpan.org/~bobw/Audio-GtkGramofile-0.10/
a Gtk2-Perl interface to libgramofile. 
----
Business-DK-CPR-0.05
http://search.cpan.org/~jonasbn/Business-DK-CPR-0.05/
a Danish CPR code generator/validator 
----
Coro-4.913
http://search.cpan.org/~mlehmann/Coro-4.913/
coroutine process abstraction 
----
DBIx-Admin-CreateTable-2.00
http://search.cpan.org/~rsavage/DBIx-Admin-CreateTable-2.00/
A module for creating and dropping tables and sequences 
----
Digest-Skein-0.01
http://search.cpan.org/~radek/Digest-Skein-0.01/
Perl interface to the Skein digest algorithm 
----
Digest-Skein-0.02
http://search.cpan.org/~radek/Digest-Skein-0.02/
Perl interface to the Skein digest algorithm 
----
EBook-Tools-0.3.0
http://search.cpan.org/~azed/EBook-Tools-0.3.0/
An object class for the manipulation and generation of E-books based on IDPF standards 
----
File-ShareDir-PAR-0.03
http://search.cpan.org/~smueller/File-ShareDir-PAR-0.03/
File::ShareDir with PAR support 
----
File-Store-1.00
http://search.cpan.org/~arif/File-Store-1.00/
----
Geo-Cache-0.10
http://search.cpan.org/~rbow/Geo-Cache-0.10/
Object interface for GPS waypoints 
----
Geo-Cache-0.11
http://search.cpan.org/~rbow/Geo-Cache-0.11/
Object interface for GPS waypoints 
----
Gnome2-Vte-0.09
http://search.cpan.org/~tsch/Gnome2-Vte-0.09/
Perl interface to the Virtual Terminal Emulation library 
----
GnuPG-Interface-0.40_01
http://search.cpan.org/~jesse/GnuPG-Interface-0.40_01/
Perl interface to GnuPG 
----
HTML-GoogleMaps-7
http://search.cpan.org/~nmueller/HTML-GoogleMaps-7/
a simple wrapper around the Google Maps API 
----
HTML-GoogleMaps-8
http://search.cpan.org/~nmueller/HTML-GoogleMaps-8/
a simple wrapper around the Google Maps API 
----
JavaScript-Packer-0.01
http://search.cpan.org/~nevesenin/JavaScript-Packer-0.01/
Perl version of Dean Edwards' Packer.js 
----
Language-Befunge-4.07
http://search.cpan.org/~jquelin/Language-Befunge-4.07/
a generic funge interpreter 
----
Lingua-PT-Conjugate-1.15
http://search.cpan.org/~egross/Lingua-PT-Conjugate-1.15/
----
List-Member-0.044
http://search.cpan.org/~lgoddard/List-Member-0.044/
PROLOG's member/2: return index of $x in @y. 
----
Locale-Maketext-Extract-Plugin-XSL-0.3
http://search.cpan.org/~pepl/Locale-Maketext-Extract-Plugin-XSL-0.3/
XSL file parser 
----
MojoMojo-0.999022
http://search.cpan.org/~mramberg/MojoMojo-0.999022/
A Catalyst & DBIx::Class powered Wiki. 
----
MojoX-Session-0.01
http://search.cpan.org/~vti/MojoX-Session-0.01/
Session management for Mojo 
----
POE-Component-PluginManager-0.67
http://search.cpan.org/~whoppix/POE-Component-PluginManager-0.67/
Make your POE programs plugin capable, really easy! 
----
Path-Dispatcher-0.05
http://search.cpan.org/~sartak/Path-Dispatcher-0.05/
flexible dispatch 
----
Path-Dispatcher-0.06
http://search.cpan.org/~sartak/Path-Dispatcher-0.06/
flexible dispatch 
----
Pg-Explain-0.06
http://search.cpan.org/~depesz/Pg-Explain-0.06/
Object approach at reading explain analyze output 
----
Storable-AMF-0.1503
http://search.cpan.org/~grian/Storable-AMF-0.1503/
Perl extension for serialize/deserialize AMF0/AMF3 data 
----
Storable-AMF-0.16
http://search.cpan.org/~grian/Storable-AMF-0.16/
Perl extension for serialize/deserialize AMF0/AMF3 data 
----
Task-Catalyst-Tutorial-0.04
http://search.cpan.org/~mramberg/Task-Catalyst-Tutorial-0.04/
Installs everything you need to learn Catalyst 
----
Template-Plugin-HighlightPerl-0.04
http://search.cpan.org/~sasykes/Template-Plugin-HighlightPerl-0.04/
Template Toolkit plugin which implements wrapper around Syntax::Highlight::Perl module. 
----
Text-Greeking-zh_TW-0.0.4
http://search.cpan.org/~gugod/Text-Greeking-zh_TW-0.0.4/
A module for generating meaningless Chinese text that creates the illusion of the finished document. 
----
Text-RewriteRules-0.14
http://search.cpan.org/~ambs/Text-RewriteRules-0.14/
A system to rewrite text using regexp-based rules 
----
Tree-RB-0.5
http://search.cpan.org/~arunbear/Tree-RB-0.5/
Perl implementation of the Red/Black tree, a type of balanced binary search tree. 
----
URI-ParseSearchString-2.8
http://search.cpan.org/~sden/URI-ParseSearchString-2.8/
parse search engine referrer URLs and extract keywords used 
----
WWW-MeGa-0.09_4
http://search.cpan.org/~fish/WWW-MeGa-0.09_4/
A MediaGallery 
----
WWW-MeGa-0.09_5
http://search.cpan.org/~fish/WWW-MeGa-0.09_5/
A MediaGallery 
----
WWW-Myspace-0.90
http://search.cpan.org/~stevenc/WWW-Myspace-0.90/
Access MySpace.com profile information from Perl 
----
WWW-Search-PubMedLite-0.05
http://search.cpan.org/~diberri/WWW-Search-PubMedLite-0.05/
Access PubMed's database of journal articles 
----
WWW-Wikipedia-TemplateFiller-0.04
http://search.cpan.org/~diberri/WWW-Wikipedia-TemplateFiller-0.04/
Fill Wikipedia templates with your eyes closed 
----
Waft-0.9907
http://search.cpan.org/~tamashiro/Waft-0.9907/
A simple web application framework 
----
all-0.5001
http://search.cpan.org/~dexter/all-0.5001/
pragma to load all packages under a namespace 


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Sun, 16 Nov 2008 20:55:34 GMT
From: sln@netherlands.com
Subject: Re: Perl equivalent of simple awk script
Message-Id: <7221i49o300d95oa2g92em2kipd3b8g75c@4ax.com>

On Wed, 12 Nov 2008 13:01:46 -0800 (PST), Generic Usenet Account <usenet@sta.samsung.com> wrote:

>Hi,
>
>I am an old hat who is still living in the grep, sed, awk era.  I am
>trying to come up to speed with Perl since I am told that my toolkit
>is completely outdated.  I would appreciate if someone could help me
>with a Perl equivalent of the following extremely simple awk command:
>
>           awk '/pattern/ {print $1 "-" $2 "-" $3 "\t" $NF}' inputfile
>
>Thanks,
>Larry

Larry,

So I guess you learned about Perl's advanced split() function.
How's the toolbox looking now?


sln



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

Date: Sun, 16 Nov 2008 03:55:24 -0500
From: "Thrill5" <nospam@somewhere.com>
Subject: Re: PHP's ob_gzhandler equivalent in Perl ?
Message-Id: <gfon61$817$1@nntp.motzarella.org>


"Peter J. Holzer" <hjp-usenet2@hjp.at> wrote in message 
news:slrnghu9ag.1qq.hjp-usenet2@hrunkner.hjp.at...
> On 2008-11-15 16:49, Jürgen Exner <jurgenex@hotmail.com> wrote:
>> howa <howachen@gmail.com> wrote:
>>>In PHP, ob_gzhandler() is used to help facilitate sending gz-encoded
>>>data to web browsers that support compressed web pages
>>
>> I've not heard of gz-encoding. Are you talking about GNU-zip, aka gzip,
>
> Presumably, since gzip is one of the specified compression methods
> specified in the HTTP protocol (the other two are "deflate" (uses the
> same method as gzip, but a different header) and "compress").
>
>> aka tarballs?
>
> No. Tarballs are tar archives, i.e., collections of files serialized
> into a single file. They are not necessarily compressed, and even if
> they are compressed, they may be compressed by any compression method,
> not just gzip (bzip2 and compress are also common).
>
>
>>>Are there any similar stuff in CGI or related Perl modules?
>>
>> There are numerous modules at
>> http://search.cpan.org/search?query=gzip&mode=all
>
> Many web servers also have a compression module, so you may not have to
> do anything in the CGI script at all.
>
> hp
Compression is done by the web server because you can't compress the HTTP 
request unless the client explicitly tells the web server that it can accept 
compressed data via an ACCEPT header.  The header also specifies what 
compression formats the client is able to receive.  If you compress the data 
in your CGI script and the client can't uncompress it, the browser will not 
be able to render it.

IIS 6.0 and above includes a compression module, and there are several 
compression modules available for Apache. 




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

Date: Sun, 16 Nov 2008 11:06:14 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: PHP's ob_gzhandler equivalent in Perl ?
Message-Id: <slrnghvs4n.b1n.hjp-usenet2@hrunkner.hjp.at>

On 2008-11-16 08:55, Thrill5 <nospam@somewhere.com> wrote:
> "Peter J. Holzer" <hjp-usenet2@hjp.at> wrote in message 
> news:slrnghu9ag.1qq.hjp-usenet2@hrunkner.hjp.at...
>> On 2008-11-15 16:49, Jürgen Exner <jurgenex@hotmail.com> wrote:
>>> howa <howachen@gmail.com> wrote:
>>>>In PHP, ob_gzhandler() is used to help facilitate sending gz-encoded
>>>>data to web browsers that support compressed web pages
[...]
>>>>Are there any similar stuff in CGI or related Perl modules?
>>>
>>> There are numerous modules at
>>> http://search.cpan.org/search?query=gzip&mode=all
>>
>> Many web servers also have a compression module, so you may not have to
>> do anything in the CGI script at all.

> Compression is done by the web server because you can't compress the HTTP 
> request unless the client explicitly tells the web server that it can accept 
> compressed data via an ACCEPT header.  The header also specifies what 
> compression formats the client is able to receive.  If you compress the data 
> in your CGI script and the client can't uncompress it, the browser will not 
> be able to render it.

The header is passed to the CGI script, so the script can check whether
the client supports compression just like the server can.  Your argument
makes no sense.

The real reasons why the server provides this capability are:

1) It makes little sense to add compression to every script if it can be
   done once for all.

2) The server can do it also for static files or for scripts which can't
   do it by themselves.

That said, there may be valid reasons to do it in a script even if the
server can do it: Most importantly, the script knows more about the data
and can decide whether it makes sense to compress it.

   	hp


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

Date: Sun, 16 Nov 2008 18:22:52 +0100
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: PHP's ob_gzhandler equivalent in Perl ?
Message-Id: <7bl0i497md6mhh8egu68uhs3603idaf44s@4ax.com>

howa wrote:

>In PHP, ob_gzhandler() is used to help facilitate sending gz-encoded
>data to web browsers that support compressed web pages
>
>Are there any similar stuff in CGI or related Perl modules?

In Perl 5.8 and above you can use a gzip IO layer. See
<http://search.cpan.org/perldoc?PerlIO::gzip>. For more info, see the
perlfunc docs on binmode and open, and the module docs for PerlIO at
<http://search.cpan.org/perldoc?PerlIO>.


-- 
	Bart.


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

Date: Sun, 16 Nov 2008 09:35:29 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Using unreferenced labels
Message-Id: <slrnghvmqi.9vv.hjp-usenet2@hrunkner.hjp.at>

On 2008-11-15 20:14, Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
> [A complimentary Cc of this posting was NOT [per weedlist] sent to
> Peter J. Holzer
><hjp-usenet2@hjp.at>], who wrote in article <slrnghtulh.1qq.hjp-usenet2@hrunkner.hjp.at>:
>> >   Store the line number of "the function call" (line with the name of
>> >   the function, or with "->" of an indirect call?) in the compile
>> >   tree's node for the function call.  Use THIS line number when
>> >   backtracking at runtime (as opposed to the line number of the last
>> >   talking-to-itself).
>> >
>> > Hint hint,
>> 
>> Reini Urban talked about some work he's doing on the B modules at the
>> Twin-City Perl workshop last weekend. If I understood him correctly he's
>> thinking about changing this: Instead of having special "I'm here"
>> opcodes he would add a location field to each opcode.
>
> IMO, this is very horrible.  One should DECREASE size of compile tree,
> not increase it...

I guess he figures that he wins more performance by reducing the number
of nodes (less memory accesses, less work in the interpreter) than he
loses by increasing the size of a single node (more cache misses).

Only benchmarks (with real workloads, on all relevant architectures)
will show if he's right. 

His real focus is on compiling to native code, though, and if he
succeeds, the optree is only an intermediate step which is
irrelevant for performance (except for very short-lived scripts).

> (The change I advise above is ONLY for a
> particular node in the tree, which is not going to blow the memory
> footprint much, thus won't change memory locality properties much...)

I haven't looked at the real in-memory format of the optree, but my gut
feeling is that working through a tree (instead of a stream) is pretty
horrible for locality. Maybe a significant performance boost could be
achieved by flattening the tree?

	hp


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

Date: Sun, 16 Nov 2008 19:23:27 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Using unreferenced labels
Message-Id: <gfprvf$2jqf$1@agate.berkeley.edu>

[A complimentary Cc of this posting was NOT [per weedlist] sent to
Peter J. Holzer
<hjp-usenet2@hjp.at>], who wrote in article <slrnghvmqi.9vv.hjp-usenet2@hrunkner.hjp.at>:
> I haven't looked at the real in-memory format of the optree, but my gut
> feeling is that working through a tree (instead of a stream) is pretty
> horrible for locality. Maybe a significant performance boost could be
> achieved by flattening the tree?

It is flattened as the last step of compilation-per-se.  (Then it is
optimized - although with *very* primitive steps only.)

I think I wrote something about this...  perlguts/"Compliled code"

Yours,
Ilya


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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V11 Issue 1986
***************************************


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