[17103] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4515 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 4 09:05:28 2000

Date: Wed, 4 Oct 2000 06:05:14 -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: <970664713-v9-i4515@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 4 Oct 2000     Volume: 9 Number: 4515

Today's topics:
        $cookie_jar->extract_cookies($response) fails sometimes <Thomas@Trendsetter.de>
    Re: advise on how to set bugging on in perl file (Tramm Hudson)
    Re: advise on how to set bugging on in perl file (Gwyn Judd)
    Re: Arrogant kid takes on huge group of programmers (wa <bubby_titch@hotmail.com>
        Case-insensitive Find zihav@my-deja.com
        Cookie problem ghorghor@my-deja.com
    Re: Cookie problem <anders@wall.alweb.dk>
        Creating a file with a different GID <manfrin@tolomeo.it>
    Re: Creating a file with a different GID (Rafael Garcia-Suarez)
    Re: die() ignores tied STDERR? (Daniel Chetlin)
        Fork creates grandchildren? wbuchan@uk.noha-systems.com
    Re: Fork creates grandchildren? (Garry Williams)
        Get remote image info <pete0501@hotmail.com>
    Re: Get remote image info (Rafael Garcia-Suarez)
    Re: Help with perl/cgi (using book: perl,cgi, and javas <h.lesscher@galayaa.nl>
    Re: how to split text by number of words? (Clay Irving)
        html embeded email <sunil@solutionsny.com>
    Re: html embeded email <anders@wall.alweb.dk>
        HTML optimisation in Perl a_ominous@my-deja.com
    Re: HTML optimisation in Perl a_ominous@my-deja.com
        IPC::Shareable 0.51 and make test <steven@ircnet.dk>
    Re: LWP Newbie Question nobull@mail.com
        newFromPng <svp@mail.dk>
        Perl & UUCP (address rewriting Q) <greg@greg.kpi.kharkov.ua>
    Re: Perl & UUCP (address rewriting Q) (Bernard El-Hagin)
    Re: Perl & UUCP (address rewriting Q) <greg@greg.kpi.kharkov.ua>
    Re: Perl & UUCP (address rewriting Q) (Bernard El-Hagin)
    Re: Perl & UUCP (address rewriting Q) (Bernard El-Hagin)
    Re: Perl & UUCP (address rewriting Q) <greg@greg.kpi.kharkov.ua>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 04 Oct 2000 14:14:41 +0200
From: Thomas <Thomas@Trendsetter.de>
Subject: $cookie_jar->extract_cookies($response) fails sometimes!???
Message-Id: <39DB1F31.643A08B9@Trendsetter.de>

Hi,

I have a curious problem using HTTP::Cookies:

In some cases a server returns a header with "set-cookie"-commands that
can be handled by using:
$cookie_jar->add_cookie_header($request) and
$cookie_jar->extract_cookies($response);

With most URLs using cookies the script below works!
This means that "set-cookie"-commands are found in a response-header
$response_text and the last line also shows up all cookie-values!

But there seem to be special cases in which a response header shows up
several "set-cookie"-commands that are not stored by using
$cookie_jar = new HTTP::Cookies;
$cookie_jar->extract_cookies($res);

That is why the last line does not print any cookie-values although the
are found in the response-header!


Following code shows up the "set-cookie" lines in the responses-header
after sending a request to http://lion.cc
without updating "cookie_jar and printing the correct cookie-values in
the last line ->$cookie = $cookie_jar->as_string();


Does anyone know how to solve this problem, because in such a case as
the mentioned one below you can not send the right
cookie-parameters for the next requests!

Thank you and best regards

Thomas

=============================

#!/usr/local/bin/perl

require LWP::UserAgent;
use HTTP::Cookies;

$url = 'http://lion.cc/';

$UserAgent = "Mozilla/4.61 [en] (Win95\; I)";


my($ua) = LWP::UserAgent->new;
$ua->agent($UserAgent);

my ($req) = HTTP::Request->new(GET => "$url");
$req->header('Accept' => 'text/html', Referer => "");
my ($res) = $ua->request($req);

$response_text = $res->as_string;


###### Following line shows up the "set-cookie"-lines #######
print "\n\n\nServer-Response:\n$response_text\n";


##### This line in some cases (i.e.: http://lion.cc) does not show the
cookie-values of the response-object !??? ######
$cookie_jar = new HTTP::Cookies;
$cookie_jar->extract_cookies($res);
$cookie = $cookie_jar->as_string();
print "\n\n\n\nCOOKIES:\n$cookie\n\n";

exit;




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

Date: 4 Oct 2000 08:59:39 GMT
From: hudson@swcp.com (Tramm Hudson)
Subject: Re: advise on how to set bugging on in perl file
Message-Id: <8rerhr$d4l$1@sloth.swcp.com>
Keywords: fish, troll

sammy <sammy@bigpond.net.au.nospam> wrote:
>Appreciate some advise on how to set bugging on in perl file.

Abigail and I had a discussion a few months ago about how many
bugs can exist in a program.  I posited that for a given program
of length n in a language of size m, there were at most n^m
programs.  Most of which are syntax errors, many of which do
nothing useful.  This meant to me that there were (within
a constant factor) n^m possible bugs.  Abigail maintained that
each "program" had an infinite number of erronous interpretations.
We left it at that.

Thus, every program that you write already has plenty of bugs.
Why would you want to add more?  If you really want some
bugs, I can provide you with a few.  Syntax errors are free.
Semantic errors are more expensive.  To get you started, here
are a three errors of different types:

	askdjfhasd fahsdkfhja sdkfhadfs;	# Simple syntax error
	BEGIN{ 1/0 }				# Compiles, but faults
	# Semantic error -- there is no code for this comment

>similar to typing set -x in a unix shell program or sh -x

That is not so much of debugging as it is for tracing execution
and examining the expansion of globs and strings.  You can't
single step or perform any other useful activities.

>perl -D4 file.pl

The -D options are for examining internal state.  perldoc perlrun
will give you advice, although you do have to scroll down to
find it.  -Dtls will do trace, listing and stack dumps as the
code runs.  I find it too verbose.

>I have used the d option ...

The -d option is for the interactive debugger.  You can find more
info on it in perldoc perldebug.  I find it very handy, both for
trying out Perl constructions and for setting breakpoints, etc.
I do wish it could examine lexicals, however, since very few of
my programs use any globals.

> but the man entry of perl advises I need to enter
>debug options into the perl script itself for the d option to have any
>affect.

I'm not sure what you mean here.  I find that the -d option takes
effect immediately and does not require any "debug options" in my
programs.

Tramm
-- 
  o   hudson@swcp.com                  hudson@turbolabs.com   O___|   
 /|\  http://www.swcp.com/~hudson/          H 505.323.38.81   /\  \_  
 <<   KC5RNF @ N5YYF.NM.AMPR.ORG            W 505.986.60.75   \ \/\_\  
  0                                                            U \_  | 


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

Date: Wed, 04 Oct 2000 12:56:32 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: advise on how to set bugging on in perl file
Message-Id: <slrn8tm6ut.sv.tjla@thislove.dyndns.org>

I was shocked! How could Tramm Hudson <hudson@swcp.com>
say such a terrible thing:
>sammy <sammy@bigpond.net.au.nospam> wrote:
>>Appreciate some advise on how to set bugging on in perl file.
>
>	askdjfhasd fahsdkfhja sdkfhadfs;	# Simple syntax error

<pedant>

package fahsdkfhja;
sub askdjfhasd {};
askdjfhasd fahsdkfhja sdkfhadfs;

Compiles just fine *duck*

</pedant>

>	BEGIN{ 1/0 }				# Compiles, but faults

<pedant>

Strictly speaking, since this executes at compile time, it doesn't
actually compile, per se...well the '1/0' bit compiles but the whole
program doesn't if you get my drift.

</pedant>

>	# Semantic error -- there is no code for this comment

<pedant>

Who says? Nothing is a perfectly valid program. I intend to do my PhD
thesis on the NULL programming language. I have already written dozens
of self-printing programs in it (just before the decimal point in this
sentence is the 37th).

</pedant>

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
God is an atheist.


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

Date: Wed, 04 Oct 2000 05:12:04 -0500
From: Matthew Leonhardt <bubby_titch@hotmail.com>
Subject: Re: Arrogant kid takes on huge group of programmers (was Re: How to get length of scalar?)
Message-Id: <39db022a$0$99046$726baab@news.execpc.com>

On Sat, 30 Sep 2000 17:42:20 +0100, "Mark Carruth"
<mcarruth@talk21.com> wrote:

>I know I am getting boring now, but I really don't see why the huge group of
>programmers are literally taking the piss out of me. I am new to newsgroups
>so instead of slagging me off because I post HTML, someone could just tell
>me not to, and then I would willingly turn off HTML posting which I have now
>done.

Since we're being nit-picky about etiquette, and since we will later
address "English rules," I would like you to take the time to open a
dictionary and read the definition of the word literally.  If your
claim is true, then your privacy and civil rights have been heavily
violated.

>And as for the quoting, I will quote whatever I like. There is no English
>rule against it.

No one's going to stop you from posting incorrectly.  You seem intent
on making a point, however.  Since that seems to be the situation, you
just might want to consider making that point in a manner that will
receive the most consideration from your audience.  Breaking all the
rules (written or implied) of a community is the fast-track to being
ignored.

On a personal note, I can appreciate a young programmer.  I started
when I was 8 or so when 286's were just hitting the market.  In my
experience there are three types of programmers:

1) 99% of all programmers.  The guys who know exactly how little they
know.  Not to take away from what they do know, but they realize that
in the scope of things, they've got a sandbox in the desert.  This
stage is only reached through experience.

2) The guys who know their shit and know they know their shit.  These
are the Randal Schwartz's and brian d foy's of the world, and frankly,
they have every right to be arrogant.  (Most of these guys would still
put themselves in group 1.)

3) The (usually young) cowboy, who doesn't really know shit, but knows
more than his friends, so he thinks he knows everything.  Most of us
started there, and were quickly humbled.

Do yourself a favor.  Make some copies of this thread.  Stick with it
and ten years from now, take a look at your posts here.  You will see
yourself in a whole different light.  I guarantee it.

Best Wishes,
Matt


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

Date: Wed, 04 Oct 2000 12:32:47 GMT
From: zihav@my-deja.com
Subject: Case-insensitive Find
Message-Id: <8rf81f$ol2$1@nnrp1.deja.com>

Greetings:

I'm trying to do a case-insensitive find on a list of files. I'm
using File::Find, but having a little trouble with the "sub wanted"
portion. I simply want to push the found files on to one list and
the not found on another. Here's my code:

#!/usr/local/bin/perl
#
#
use File::Find;

$| = 1;
$dir = "./";
sub wanted {
    eval '/\b$verilog\b/i';
	if (exists $File::Find::name) {
		push (@found,$File::Find::name);
	else {
		push (@notfound, $verilog);
	}
}

$filecnt = 0;
open (TO_FIND,"foo") || die "\nERROR: Couldn't Open foo $!\n\n";
while(<TO_FIND>) {
	chomp;
    @x = $_;
    @x = split;
    push(@flist,$x[0]);
	$filecnt++;
}
close (TO_FIND);

print "$filecnt Files to look for...\n\n";
$findcnt = 1;

foreach $verilog (@flist) {
	print "$findcnt : Looking for $verilog\n";
	find(\&wanted, $dir);
	}

Thanks for any help in advanced!

Tom


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 04 Oct 2000 12:11:38 GMT
From: ghorghor@my-deja.com
Subject: Cookie problem
Message-Id: <8rf6pn$nmp$1@nnrp1.deja.com>

I have some pb using CGI::Cookie
i need to make a perl script who can create a cookie,
i would be able to read it
and the cookie ll be destroy when the navigator will close

i must have an IE and netscape compatibility

I'm not sure that CGI::Cookie is a good module to this, if not could
you tell me a good one ?

i have searched on CPAN.org for others modules with explainations, i
didn't find nice modules :(

i tried the exemple in the perldoc on CGI::Cookie
# Create new cookies and send them
    $cookie1 = new CGI::Cookie(-name=>'ID',-value=>123456);
    $cookie2 = new CGI::Cookie(-name=>'preferences',
                               -value=>{ font => Helvetica,
                                         size => 12 }
                               );
    print header(-cookie=>[$cookie1,$cookie2]);
    # fetch existing cookies
    %cookies = fetch CGI::Cookie;
    $id = $cookies{'ID'}->value;

and i have an error message for the value method ?
and i m not sure the cookie is created

Can someone help me please


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 4 Oct 2000 14:26:01 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Cookie problem
Message-Id: <smFC5.940$UW.31081@news010.worldonline.dk>

ghorghor@my-deja.com wrote:
 
> Can someone help me please

You, by reading documentation.
The CGI module comes with excellent documentation.
Perl comes with excellent documentation.

perldoc CGI, then search for cookie...

-anders

-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: Wed, 4 Oct 2000 11:35:02 +0200
From: "Mauro Manfrin" <manfrin@tolomeo.it>
Subject: Creating a file with a different GID
Message-Id: <8reti7$5q7$1@fe2.cs.interbusiness.it>

Someone can tell me how
to create a file (in Perl)
with a non default Group ID (GID)
so that I not have to chown it after creating?

Thank you in advance
Mauro
mailto:manfrin@tolomeo.it





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

Date: Wed, 04 Oct 2000 09:49:00 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Creating a file with a different GID
Message-Id: <slrn8tlvl5.3l2.rgarciasuarez@rafael.kazibao.net>

Mauro Manfrin wrote in comp.lang.perl.misc:
>Someone can tell me how
>to create a file (in Perl)
>with a non default Group ID (GID)
>so that I not have to chown it after creating?

perldoc -f chown

Note that, unless the Perl scripts runs as root, you may need to be a
member of the new group.

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: 4 Oct 2000 09:59:09 GMT
From: daniel@chetlin.com (Daniel Chetlin)
Subject: Re: die() ignores tied STDERR?
Message-Id: <8rev1d02t0n@news2.newsguy.com>

On 3 Oct 2000 22:39:54 GMT,
 Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
>who wrote in article <8rdk180du6@news1.newsguy.com>:
>>   [~] $ perl -e'use overload q/""/,sub{"$_[0]"};$r=bless{};print$r'
>>   Segmentation fault (core dumped)
>
>Why so hairy?  This should be more or less equivalent to
>
>  perl -we 'sub a {my $x=shift; a($x)} a(1)'
>
>If it is not, something is buggy...

Yes, it is now equivalent to your code. However, I might claim that it
shouldn't be. I feel that this sort of magic (overloading, tieing, etc.)
should be cognizant of itself and not allow that kind of recursion.

Obviously my example is a minimal test case which you wouldn't really
expect someone to do, but consider this:

  package MyOops;
  use overload q/""/ => sub {
                            my $self=shift;
                            "$self->{foo} - $self-{bar}"
                        };

  package main;
  $obj = bless {foo=>1,bar=>2},"MyOops";
  print "$obj\n";

See how easy it is to screw that up?

I recently patched overloading so that things like

  use overload q/""/ => sub { shift };

don't choke -- it's easy to check for that. What's harder is those other
examples, where the recursive stringification happens in the subroutine
itself. I think the way to solve it is to keep a list of objects we've
already AMAGICally stringified, and not do it more than once. Whether
it'd scream and die or just turn off the magic, I don't know. But I'm
not at the point where I can implement that yet.

I dunno, maybe I'm crazy and there's no difference between infinite
recursion through magic and infinite recursion through just calling
subroutines, but to me it feels like magic should be protected from that
sort of thing.

And in the case of self-ties, apparently at some point they were
supposed to work, so I can't be completely off-base.

-dlc


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

Date: Wed, 04 Oct 2000 10:35:08 GMT
From: wbuchan@uk.noha-systems.com
Subject: Fork creates grandchildren?
Message-Id: <8rf14s$jkh$1@nnrp1.deja.com>

Hi,

I'm just experimenting with forking and I'm a bit puzzled.  This is
probably a lack of understanding about what is going on with unix
processes but I'd appreciate any advice.

I'm calling fork (code similar to that on p.167 of the Camel book if
anyone's checking!) and in the child process calling exec gzip which
reads from a named pipe.  The child process is 1844 but what I see when
I do a ps -ef seems to show that this child has created it's own child.

 wbuchan  1845  1844  0 11:20:58 pts/6    0:00 sh -c gzip -6 > exp.dat <
/u01/exports/exp_pipe

 wbuchan  1844     1  0 11:20:58 pts/6    0:00 sh -c gzip -6 > exp.dat <
/u01/exports/exp_pipe

It does work: anything I send to the pipe gets compressed.  And if I
manually decompress then I get back the original input.  However I'm a
bit puzzled/concerned why there appears to be two gzip processes
created.  I tried puting a print before the exec but this is only called
once.

Any enlightenment would be much appreciated.

Many thanks
- Bill.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 04 Oct 2000 13:04:09 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Fork creates grandchildren?
Message-Id: <dVFC5.22$lw3.1479@eagle.america.net>

On Wed, 04 Oct 2000 10:35:08 GMT, wbuchan@uk.noha-systems.com
<wbuchan@uk.noha-systems.com> wrote:
>
>I'm calling fork (code similar to that on p.167 of the Camel book if
>anyone's checking!) and in the child process calling exec gzip which
>reads from a named pipe.  The child process is 1844 but what I see when
>I do a ps -ef seems to show that this child has created it's own child.
>
> wbuchan  1845  1844  0 11:20:58 pts/6    0:00 sh -c gzip -6 > exp.dat <
>/u01/exports/exp_pipe
>
> wbuchan  1844     1  0 11:20:58 pts/6    0:00 sh -c gzip -6 > exp.dat <
>/u01/exports/exp_pipe
>
>It does work: anything I send to the pipe gets compressed.  And if I
>manually decompress then I get back the original input.  However I'm a
>bit puzzled/concerned why there appears to be two gzip processes
>created.  I tried puting a print before the exec but this is only called
>once.
>
>Any enlightenment would be much appreciated.

The exec() function will use the shell to run your command unless it
is passed a list.  See perldoc -f exec.  

-- 
Garry Williams


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

Date: Wed, 4 Oct 2000 19:27:04 -0700
From: "Wang Mu Shan" <pete0501@hotmail.com>
Subject: Get remote image info
Message-Id: <8rf415$if8$1@clematis.singnet.com.sg>

Hi, there

I need to get width and height information of images which are residing on
the web.

I've tried to use Image::Size, but find it is only workable for local image
files.

My question is:

How can I get width and height of remote images without retrieving and
saving the whole image data to local disk first? ( I just want image header
info).

Thanks,
Mu Shan




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

Date: Wed, 04 Oct 2000 12:20:58 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Get remote image info
Message-Id: <slrn8tm8i3.3ti.rgarciasuarez@rafael.kazibao.net>

Wang Mu Shan wrote in comp.lang.perl.misc:
>Hi, there
>
>I need to get width and height information of images which are residing on
>the web.
>
>I've tried to use Image::Size, but find it is only workable for local image
>files.
>
>My question is:
>
>How can I get width and height of remote images without retrieving and
>saving the whole image data to local disk first? ( I just want image header
>info).

The image HTTP header is typically something like :
  Content-Type: image/gif
and it doesn't contain the size. You'll have to download the image file
to get its size. The package LWP::Simple (part of the LWP bundle) is a
straightforward way to do this.

A more sophisticated approach is to use LWP::UserAgent (part of the same
bundle) to download the image file, call a callback while it's being
downloaded, and stop downloading when enough data has been read to
determine the image size. The LWP::UserAgent manpage explains how this
can be made.

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: 04 Oct 2000 11:18:17 +0200
From: Hermen Lesscher <h.lesscher@galayaa.nl>
Subject: Re: Help with perl/cgi (using book: perl,cgi, and javascript complete)
Message-Id: <wksnqd0xt2.fsf@galayaa.nl>

I've had alot of use from O'Reilly's 'CGI Programming on the World Wide Web' 
by S. Gundavaram. O'Reilly might have more books that are of interest to you, 
see http://www.ora.com 

Hermen


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

Date: 4 Oct 2000 12:30:17 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: how to split text by number of words?
Message-Id: <slrn8tm8mp.9ps.clay@panix3.panix.com>

On 4 Oct 2000 03:50:02 GMT, Tina Mueller <tina@streetmail.com> wrote:

>In comp.lang.perl.misc Firestar <theebh@yahoo.com> wrote:
>> Hi, i need to break a long chunk of text into a few paragraphs, each
>> paragraph not more than 300 characters, for example. can i use regexp
>> for this? TIA.
>
>use Text::Wrap;

How is Text::Wrap going to break a "long chunk" of text into paragraphs of
no more than 300 characters? -- It allows you to set margins, but I didn't
notice any functionality to construction paragraphs from a glob of text.

-- 
Clay Irving <clay@panix.com>
Happiness is the interval between periods of unhappiness. 
- Don Marquis 


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

Date: Wed, 04 Oct 2000 12:34:08 GMT
From: Sunil Dua <sunil@solutionsny.com>
Subject: html embeded email
Message-Id: <8rf840$oln$1@nnrp1.deja.com>

Dear List members

I want to send html pages as the body of my mail through perl on linux
plateform. does anybody have any idea as to how to achieve this. I
shall be very greatful to you.

Thanks


--
Project Leader
Solutions Infosystems Pvt. Ltd.
New Delhi, India


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 4 Oct 2000 15:02:24 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: html embeded email
Message-Id: <yUFC5.356$u23.35681@news000.worldonline.dk>

Sunil Dua wrote:

> Dear List members
> 
> I want to send html pages as the body of my mail through perl on linux
> plateform. does anybody have any idea as to how to achieve this. I
> shall be very greatful to you.

Use one of the modules for sending mail, Mail::Send or Mail::Mailer, and 
put your html (file) in the body...

-anders
-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: Wed, 04 Oct 2000 09:25:08 GMT
From: a_ominous@my-deja.com
Subject: HTML optimisation in Perl
Message-Id: <8ret1f$h2v$1@nnrp1.deja.com>

hi
I'm working on a project and one of the recent requests was to 'clean-
up' the HTML.  Specifically to remove superfluous whitespace and HTML
comments.  The reason for doing this is that we are charged per byte by
our web hosting partner.

I have looked around to see if anyone has done this before.  Someone
has mentioned that the HTML on Amazon.com looks like it has been
optimized.  There are tools available on Windows, but they are GUIs.
I'm looking for something that can be run in a script.

Some of the HTML was generated from Net Dynamics, others hand coded.
We want to keep the nicely formatted files for internal testing as it
facilitates debugging and maintenance.  However we want to clean it up
to reduce our costs and speed up access for our customers.

We can write this ourselves, but I'd like to get something to help me
kick start the job.  Any ideas / pointers?

-AO-


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 04 Oct 2000 09:35:01 GMT
From: a_ominous@my-deja.com
Subject: Re: HTML optimisation in Perl
Message-Id: <8retk5$h8s$1@nnrp1.deja.com>

Please ignore, hadn't seen yesterday's reply.
-AO-

In article <8ret1f$h2v$1@nnrp1.deja.com>,
  a_ominous@my-deja.com wrote:
> hi
> I'm working on a project and one of the recent requests was to 'clean-
> up' the HTML.  Specifically to remove superfluous whitespace and HTML
> comments.  The reason for doing this is that we are charged per byte
by
> our web hosting partner.
>
> I have looked around to see if anyone has done this before.  Someone
> has mentioned that the HTML on Amazon.com looks like it has been
> optimized.  There are tools available on Windows, but they are GUIs.
> I'm looking for something that can be run in a script.
>
> Some of the HTML was generated from Net Dynamics, others hand coded.
> We want to keep the nicely formatted files for internal testing as it
> facilitates debugging and maintenance.  However we want to clean it up
> to reduce our costs and speed up access for our customers.
>
> We can write this ourselves, but I'd like to get something to help me
> kick start the job.  Any ideas / pointers?
>
> -AO-
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 04 Oct 2000 10:57:28 GMT
From: steven <steven@ircnet.dk>
Subject: IPC::Shareable 0.51 and make test
Message-Id: <8rf2em$klr$1@nnrp1.deja.com>

Hi,

Are there known problems with IPC::Shareable 0.51 under Perl 5.6.0 and
Solaris 7? When I make test I get 3 munged shared memory segment errors
and it doesn't even return from one test, have to break out of it.
Anyone else had the same thing? A CMS we use requires it, wondering if I
should downgrade my Perl.

Thanks,

--
steven


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 04 Oct 2000 12:26:43 +0100
From: nobull@mail.com
Subject: Re: LWP Newbie Question
Message-Id: <u9r95wrgng.fsf@wcl-l.bham.ac.uk>

Steve <m00fbe01@mcmail.comNOSPAM> writes:

> I contacted my ISP and asked whether or not the LWP module
> for Perl was loaded. They explained that it wasn't but could be
> installed locally in a directory in the CGI Bin. 
> i.e. in a new directory in my cgi-bin - Firstly is this correct?

Yes, see FAQ for details.

> Secondly I don't want to mess this up - so do I just download
> the module from CPAN then unzip and upload to a directory
> in the CGI-Bin. Once this is done direct the script to point
> towards the LWP directory?

Yes, more or less, see FAQ for details.
 
> If the above is not the case and you have to compile this module
> in simple terms how do you do this?

No, I think LWP is pure Perl (at least all the commonly used stuff is).

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


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

Date: Wed, 4 Oct 2000 10:34:01 -0500
From: "Stig Vilholm Petersen" <svp@mail.dk>
Subject: newFromPng
Message-Id: <8retcu$57n$1@phys-ma.sol.co.uk>

Hi,

I've made a script that reads in a .png file and display text using true
type fonts on top of it.

It works fine on my Solaris box, but when I run it under Apache on NT
perl.exe crashes - even when I run it from the command prompt!

This only happens if I include newFromPng() in my script. If I use new() to
create a blank image instead it works fine too!

What can be wrong? has anybody had similar problem?.

PS - I don't get any information in my apache log file. Perl just crashes.

Hope someone can help. Thanks in advance
Stig Vilholm Petersen




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

Date: 4 Oct 2000 10:34:45 GMT
From: Gregory Edigarov <greg@greg.kpi.kharkov.ua>
Subject: Perl & UUCP (address rewriting Q)
Message-Id: <8rf145$2ddf$1@uran.kharkiv.net>

Hello!

Supposing I was given "aaa!bbb!ccc!ddd" standard uucp bangpath, 
how can I rewrite it to "bbb!ccc!ddd@aaa.uucp" using just one regular 
expression? Is this possible?

-- 
With best regards, 
Gregory Edigarov	System Administrator of IBM ES/9000
GE1403-RIPE		Kharkov State Politechnic University
		


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

Date: 4 Oct 2000 10:40:06 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Perl & UUCP (address rewriting Q)
Message-Id: <slrn8tm284.f8v.bernard.el-hagin@gdndev25.lido-tech>

On 4 Oct 2000 10:34:45 GMT, Gregory Edigarov <greg@greg.kpi.kharkov.ua> wrote:
>Hello!
>
>Supposing I was given "aaa!bbb!ccc!ddd" standard uucp bangpath, 
>how can I rewrite it to "bbb!ccc!ddd@aaa.uucp" using just one regular 
>expression? Is this possible?

$_ = "aaa!bbb!ccc!ddd";
s/^([^!]*)!([^!]*![^!]*![^!]*)$/$2\@$1.uucp/;
print;

Cheers,
Bernard
--
perl -le '$#="Just Another Perl Hacker"; print \Bernard'


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

Date: 4 Oct 2000 10:53:01 GMT
From: Gregory Edigarov <greg@greg.kpi.kharkov.ua>
Subject: Re: Perl & UUCP (address rewriting Q)
Message-Id: <8rf26d$2ddf$2@uran.kharkiv.net>

Bernard El-Hagin <bernard.el-hagin@lido-tech.net> wrote:
> On 4 Oct 2000 10:34:45 GMT, Gregory Edigarov <greg@greg.kpi.kharkov.ua> wrote:
>>Hello!
>>
>>Supposing I was given "aaa!bbb!ccc!ddd" standard uucp bangpath, 
>>how can I rewrite it to "bbb!ccc!ddd@aaa.uucp" using just one regular 
>>expression? Is this possible?

> $_ = "aaa!bbb!ccc!ddd";
> s/^([^!]*)!([^!]*![^!]*![^!]*)$/$2\@$1.uucp/;
> print;

Thank you. But what if I have more elements in my bangpath? Say five or six?
Is there a more universal solution? Again, only one regexp allowed.

-- 
With best regards, 
Gregory Edigarov	System Administrator of IBM ES/9000
GE1403-RIPE		Kharkov State Politechnic University
		


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

Date: 4 Oct 2000 10:55:11 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Perl & UUCP (address rewriting Q)
Message-Id: <slrn8tm34e.f8v.bernard.el-hagin@gdndev25.lido-tech>

On 4 Oct 2000 10:40:06 GMT, Bernard El-Hagin
<bernard.el-hagin@lido-tech.net> wrote:
>On 4 Oct 2000 10:34:45 GMT, Gregory Edigarov <greg@greg.kpi.kharkov.ua> wrote:
>>Hello!
>>
>>Supposing I was given "aaa!bbb!ccc!ddd" standard uucp bangpath, 
>>how can I rewrite it to "bbb!ccc!ddd@aaa.uucp" using just one regular 
>>expression? Is this possible?
>
>$_ = "aaa!bbb!ccc!ddd";
>s/^([^!]*)!([^!]*![^!]*![^!]*)$/$2\@$1.uucp/;
>print;

What a silly git I am:

s/^([^!]*)!(.*)$/$2\@$1.uucp/;

Cheers,
Bernard
--
perl -le '$#="Just Another Perl Hacker"; print \Bernard'


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

Date: 4 Oct 2000 10:56:22 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Perl & UUCP (address rewriting Q)
Message-Id: <slrn8tm36k.f8v.bernard.el-hagin@gdndev25.lido-tech>

On 4 Oct 2000 10:53:01 GMT, Gregory Edigarov <greg@greg.kpi.kharkov.ua> wrote:
>Bernard El-Hagin <bernard.el-hagin@lido-tech.net> wrote:
>> On 4 Oct 2000 10:34:45 GMT, Gregory Edigarov <greg@greg.kpi.kharkov.ua> wrote:
>>>Hello!
>>>
>>>Supposing I was given "aaa!bbb!ccc!ddd" standard uucp bangpath, 
>>>how can I rewrite it to "bbb!ccc!ddd@aaa.uucp" using just one regular 
>>>expression? Is this possible?
>
>> $_ = "aaa!bbb!ccc!ddd";
>> s/^([^!]*)!([^!]*![^!]*![^!]*)$/$2\@$1.uucp/;
>> print;
>
>Thank you. But what if I have more elements in my bangpath? Say five or six?
>Is there a more universal solution? Again, only one regexp allowed.

The second solution I sent solves that problem.

Cheers,
Bernard
--
perl -le '$#="Just Another Perl Hacker"; print \Bernard'


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

Date: 4 Oct 2000 11:02:43 GMT
From: Gregory Edigarov <greg@greg.kpi.kharkov.ua>
Subject: Re: Perl & UUCP (address rewriting Q)
Message-Id: <8rf2oj$2ddf$3@uran.kharkiv.net>

Bernard El-Hagin <bernard.el-hagin@lido-tech.net> wrote:
> On 4 Oct 2000 10:40:06 GMT, Bernard El-Hagin
> <bernard.el-hagin@lido-tech.net> wrote:
>>On 4 Oct 2000 10:34:45 GMT, Gregory Edigarov <greg@greg.kpi.kharkov.ua> wrote:
>>>Hello!
>>>
>>>Supposing I was given "aaa!bbb!ccc!ddd" standard uucp bangpath, 
>>>how can I rewrite it to "bbb!ccc!ddd@aaa.uucp" using just one regular 
>>>expression? Is this possible?
>>
>>$_ = "aaa!bbb!ccc!ddd";
>>s/^([^!]*)!([^!]*![^!]*![^!]*)$/$2\@$1.uucp/;
>>print;


> s/^([^!]*)!(.*)$/$2\@$1.uucp/;
All right, that works now!!!
Thank you.

-- 
With best regards, 
Gregory Edigarov	System Administrator of IBM ES/9000
GE1403-RIPE		Kharkov State Politechnic University
		


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4515
**************************************


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