[23607] in Perl-Users-Digest
Perl-Users Digest, Issue: 5814 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 17 00:05:51 2003
Date: Sun, 16 Nov 2003 21:05:09 -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 2003 Volume: 10 Number: 5814
Today's topics:
Re: binmode and the diamond operator (J. Romano)
Calling a different shell than the inherited one (dn_perl@hotmail.com)
Calling a sql script from perl (dn_perl@hotmail.com)
Re: Calling a sql script from perl <spam@thecouch.homeip.net>
Re: Calling a sql script from perl <nospam@bigpond.com>
Re: Calling a sql script from perl <jwillmore@remove.adelphia.net>
Re: is there the simplest way to do this: logon to my e <reg1-at-hatless-dot-com@nospam.net>
Re: last index of array reference <abigail@abigail.nl>
Re: last index of array reference <pinyaj@rpi.edu>
Re: last index of array reference <bmb@ginger.libs.uga.edu>
Re: last index of array reference <bmb@ginger.libs.uga.edu>
Re: Learn Regex or Perl Frist? (Tad McClellan)
Re: Learn Regex or Perl Frist? <jwillmore@remove.adelphia.net>
MIME::Lite Attaching a file <provicon@earthlink.net>
MIME::Lite Test with MSN Dial Up SMTP <provicon@earthlink.net>
Re: Whitespace removal in html generated by cgi <nospam@bigpond.com>
Re: Whitespace removal in html generated by cgi <REMOVEsdnCAPS@comcast.net>
Re: Whitespace removal in html generated by cgi <REMOVEsdnCAPS@comcast.net>
Re: Whitespace removal in html generated by cgi <nospam@bigpond.com>
Re: Whitespace removal in html generated by cgi <nospam@bigpond.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Nov 2003 18:47:44 -0800
From: jl_post@hotmail.com (J. Romano)
Subject: Re: binmode and the diamond operator
Message-Id: <b893f5d4.0311161847.5b679474@posting.google.com>
Steve Grazzini <grazz@pobox.com> wrote in message news:<RZAtb.38543$bQ3.10222@nwrdny03.gnilink.net>...
> J. Romano <jl_post@hotmail.com> wrote:
> > So how do you tell the diamond operator to open files in binmode?
>
> use open IN => ':raw';
Hey, thanks, Steve! That works perfectly! Now the following code
reports the same number of bytes and characters on files on Win32
platforms:
#!/usr/bin/perl -w
use strict;
use open IN => ':raw';
$/ = undef; # set "slurp" mode
while (<>) {
my $fileLen = -s $ARGV;
my $numChars = length $_;
print "File \"$ARGV\" contains $fileLen bytes",
" and $numChars characters.\n";
}
__END__
Thanks again!
-- Jean-Luc
------------------------------
Date: 16 Nov 2003 18:55:51 -0800
From: dn_perl@hotmail.com (dn_perl@hotmail.com)
Subject: Calling a different shell than the inherited one
Message-Id: <97314b5b.0311161855.214ef879@posting.google.com>
I often use C-shell for reasons beyond my control.
I want to call 'sqlplus' from within a perl script while
using c-shell. But I want the sqlplus to run in k-shell
or bash-shell. How can I do this? This is just an academic doubt.
If I use :
system("sqlplus username/password << EOH");
sqlplus statement one
sqlplus statement two
EOH
... then won't the sqlplus run within the inherited C shell?
Or is there no such thing as the called sqlplus (or any other
called command) running within some shell?
------------------------------
Date: 16 Nov 2003 18:09:04 -0800
From: dn_perl@hotmail.com (dn_perl@hotmail.com)
Subject: Calling a sql script from perl
Message-Id: <97314b5b.0311161809.658244a5@posting.google.com>
I am calling a shell script from a perl script and the shell script
invokes an sql script. I would like to invoke the sql script direct
from perl.
How can I do it?
Perl script :
-----------------------
system("call_shell_script 'input_file' ");
-----------------------
Contents of shell script 'call_shell_script' :
------------
#!/bin/ksh
LOGSQL=rep.log
sqlplus -s << EOH 2>gen_rep.errlog
userid/passwd
spool ${LOGSQL}
@call_sql_script.sql
spool off
EOH
------------
Can I simply combine the two steps above with these lines in perl
script :
(I don't have access to perl environment today, so can't try this
out.)
------------
system("sqlplus -s << EOH 2>gen_rep.errlog");
userid/passwd
spool ${LOGSQL}
@call_sql_script.sql
spool off
EOH
------------------
Thanks In Advance.
------------------------------
Date: Sun, 16 Nov 2003 21:38:20 -0500
From: Mina Naguib <spam@thecouch.homeip.net>
Subject: Re: Calling a sql script from perl
Message-Id: <7vWtb.32029$ti.637693@weber.videotron.net>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
dn_perl@hotmail.com wrote:
> I am calling a shell script from a perl script and the shell script
> invokes an sql script. I would like to invoke the sql script direct
> from perl.
> How can I do it?
use DBI;
use DBD::Oracle;
See http://search.cpan.org/~timb/DBI-1.38/DBI.pm and
http://search.cpan.org/~timb/DBD-Oracle-1.14/Oracle.pm
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uDSgeS99pGMif6wRAl0bAJ9S3h7ZtTGnH9f6lTPTV8TwoGcBdgCg3daD
dweaDEfah5zbUSsdKiYOBso=
=Z1qw
-----END PGP SIGNATURE-----
------------------------------
Date: Mon, 17 Nov 2003 12:49:34 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Calling a sql script from perl
Message-Id: <34494911.HUVVIscJch@gregs-web-hosting-and-pickle-farming>
It was a dark and stormy night, and dn_perl@hotmail.com managed to scribble:
> I am calling a shell script from a perl script and the shell script
> invokes an sql script. I would like to invoke the sql script direct
> from perl.
> How can I do it?
>
>
> Perl script :
> -----------------------
> system("call_shell_script 'input_file' ");
> -----------------------
>
>
> Contents of shell script 'call_shell_script' :
>
> ------------
> #!/bin/ksh
> LOGSQL=rep.log
> sqlplus -s << EOH 2>gen_rep.errlog
> userid/passwd
> spool ${LOGSQL}
> @call_sql_script.sql
> spool off
> EOH
> ------------
>
>
> Can I simply combine the two steps above with these lines in perl
> script :
> (I don't have access to perl environment today, so can't try this
> out.)
>
> ------------
> system("sqlplus -s << EOH 2>gen_rep.errlog");
> userid/passwd
> spool ${LOGSQL}
> @call_sql_script.sql
> spool off
> EOH
> ------------------
>
>
> Thanks In Advance.
By using sqlplus I take it you are using Oracle.
While attempting to read your mind I think the following untested code is what you want to do:
#set up load file
my $logsql='rep.log';
#do a pipe open, send stderr to a file
open(FILEHANDLE,'|sqlplus -s 2>gen_rep.errlog');
print FILE "userid/passwd\n";
# write the result of this sqlplus session to $logsql
print FILE, "spool $logsql\n";
# run an Oracle script
print FILE, "@call_sql_script.sql\n";
# can even do some inline sql
print FILE, "select * from tab;\n";
close (FILE);
For more on pipe opens see http://www.perldoc.com/perl5.8.0/pod/perlopentut.html
gtoomey
------------------------------
Date: Mon, 17 Nov 2003 03:17:04 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Calling a sql script from perl
Message-Id: <20031116221704.44718f4e.jwillmore@remove.adelphia.net>
On 16 Nov 2003 18:09:04 -0800
dn_perl@hotmail.com (dn_perl@hotmail.com) wrote:
<snip>
> ------------
> system("sqlplus -s << EOH 2>gen_rep.errlog");
> userid/passwd
> spool ${LOGSQL}
> @call_sql_script.sql
> spool off
> EOH
> ------------------
--untested--
my $sql_cmd = <<EOH;
userid/passwd
spool ${LOGSQL}
@call_sql_script.sql
spool off
EOH
system("sqlplus -s $sql_cmd 2>gen_rep.errlog");
--untested--
Read over the following by typeing (at the command line):
perldoc -q "Why don't my <<HERE documents work"
And might I suggest you check out the DBI module :-)
HTH
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
Facts are stubborn, but statistics are more pliable.
------------------------------
Date: Mon, 17 Nov 2003 04:50:44 GMT
From: Steve Koppelman <reg1-at-hatless-dot-com@nospam.net>
Subject: Re: is there the simplest way to do this: logon to my email account and delete bulk emails?
Message-Id: <EsYtb.172344$ao4.565445@attbi_s51>
walala wrote:
> I got too many spam email every day...
>
> Is there such a utility/program, or can I do some programming in the
> simplest way, to do the following:
>
> 1) automatically logon to my mail.yahoo.com account with my account username
> and password;
>
> 2) click on the "empty bulk email folder" link to empty the folder;
> 3) then log out the account;
>
> I only know a little programming on Windows, such as VC++, etc. Very little
> about Perl. Let me know
> if I can write several lines to do the above task, or there is some
Fair question. Ignore the trolls here. WWW::Mechanize might be one way
to get there, as someone said.
In general, when you have a question like this, the first place to look
is CPAN, to see if there's a module out there for doing the kinds of
operations you want. Either head over to http://www.cpan.org/ or try a
Google search along the lines of "CPAN yahoo mail".
Which leads us to the Mail::Webmail::Yahoo module from CPAN as
documented here:
http://search.cpan.org/~sdrabble/Mail-Webmail-Yahoo-0.601/Yahoo.pm
Seems like as long as the module still works (and it may not, given the
way Yahoo changes their webmail user interface a bit every few months),
you could indeed get the job done with a few lines of Perl.
<grumble type="minor">
Last I checked, this newsgroup was a perfectly good forum for sketching
out a problem and asking whether there's a well-tested Perl way of
tackling it. Granted, a search of CPAN for "Yahoo" would have turned
this up, but it's not as though CPAN's website and search function are
the friendliest things on earth for newcomers.
Don't forget to take your medication every morning, folks. It may not
have been a particularly juicy CompSci variety question, but it was
about the applicability of Perl to a task and she or he didn't ask the
newsgroup to write their code for her or him.
</grumble>
------------------------------
Date: 16 Nov 2003 23:45:04 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: last index of array reference
Message-Id: <slrnbrg300.grp.abigail@alexandra.abigail.nl>
Brad Baxter (bmb@ginger.libs.uga.edu) wrote on MMMDCCXXVIII September
MCMXCIII in <URL:news:Pine.A41.4.58.0311142206510.17570@ginger.libs.uga.edu>:
:)
:) Perhaps beside the point:
:)
:) perl -le 'print $#{[1..3]}' prints "2"
Expected, [1 .. 3] is a reference to an array.
:) perl -le 'print $#{1 .. 3}' prints "-1"
Ah, a combination of *two* weirdnesses. First the $#{ARRAY} that's
been the subject of the thread, and secondly that 1 .. 3 under certain
conditions returns an array:
$ perl -le 'map {print ++ $_} 1, 2, 3'
Modification of a read-only value attempted at -e line 1.
$ perl -le 'map {print ++ $_} 1 .. 3'
234
$
:) perl -le 'print $#{1}' prints "-1"
perl -le '@1 = (1 .. 3); print $#{1}' prints "2"
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Sun, 16 Nov 2003 20:25:36 -0500
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
Subject: Re: last index of array reference
Message-Id: <Pine.SGI.3.96.1031116201225.182782A-100000@vcmr-64.server.rpi.edu>
On 16 Nov 2003, Abigail wrote:
>Brad Baxter (bmb@ginger.libs.uga.edu) wrote on MMMDCCXXVIII September
>MCMXCIII in <URL:news:Pine.A41.4.58.0311142206510.17570@ginger.libs.uga.edu>:
>
>:) perl -le 'print $#{1 .. 3}' prints "-1"
>
>Ah, a combination of *two* weirdnesses. First the $#{ARRAY} that's
>been the subject of the thread, and secondly that 1 .. 3 under certain
>conditions returns an array:
Well, that's not what's happening. I expected this:
@1 = qw( two elements );
@2 = qw( );
@3 = qw( this has four elements );
@{"4E0"} = qw( ah ha );
print "$#{1 .. 4}: $_" while <DATA>;
__DATA__
foo
bar
blat
quux
to output:
1: foo
-1: bar
3: blat
1: quux
Because the $#{1 .. 4} is the scalar flip-flop, and it's equivalent to
$#{($. == 1) .. ($. == 4)}. The last time that's true, of course, it
returns the value of $. with "E0" appended to it.
--
Jeff Pinyan RPI Acacia Brother #734 2003 Rush Chairman
"And I vos head of Gestapo for ten | Michael Palin (as Heinrich Bimmler)
years. Ah! Five years! Nein! No! | in: The North Minehead Bye-Election
Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)
------------------------------
Date: Sun, 16 Nov 2003 20:39:38 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: last index of array reference
Message-Id: <Pine.A41.4.58.0311161917410.17312@ginger.libs.uga.edu>
On Sun, 16 Nov 2003, Abigail wrote:
> Brad Baxter (bmb@ginger.libs.uga.edu) wrote on MMMDCCXXVIII September
> MCMXCIII in <URL:news:Pine.A41.4.58.0311142206510.17570@ginger.libs.uga.edu>:
> :)
> :) perl -le 'print $#{[1..3]}' prints "2"
>
> Expected, [1 .. 3] is a reference to an array.
Agreed.
> :) perl -le 'print $#{1 .. 3}' prints "-1"
>
> Ah, a combination of *two* weirdnesses. First the $#{ARRAY} that's
> been the subject of the thread, and secondly that 1 .. 3 under certain
> conditions returns an array:
>
> $ perl -le 'map {print ++ $_} 1, 2, 3'
> Modification of a read-only value attempted at -e line 1.
> $ perl -le 'map {print ++ $_} 1 .. 3'
> 234
> $
Bizarre.
> :) perl -le 'print $#{1}' prints "-1"
>
> perl -le '@1 = (1 .. 3); print $#{1}' prints "2"
Cool.
Thanks! :-)
Brad
--
#!/usr/local/bin/perl
use strict;
use warnings;
sub AUTOLOAD{ $_ = $main::AUTOLOAD;s }
.+::(.+)}$1}x;m$_$?s?_?$/?:s:.+:$_$":;
print} use subs qw;
Just another Perl _
Hacker am I few of mine _
awards are many ;;_
mine are awards few _
many of another Just _
I am Hacker Perl _
------------------------------
Date: Sun, 16 Nov 2003 21:02:25 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: last index of array reference
Message-Id: <Pine.A41.4.58.0311162056050.17312@ginger.libs.uga.edu>
On Sun, 16 Nov 2003, Jeff 'japhy' Pinyan wrote:
> On 16 Nov 2003, Abigail wrote:
>
> >Brad Baxter (bmb@ginger.libs.uga.edu) wrote on MMMDCCXXVIII September
> >MCMXCIII in <URL:news:Pine.A41.4.58.0311142206510.17570@ginger.libs.uga.edu>:
> >
> >:) perl -le 'print $#{1 .. 3}' prints "-1"
> >
> >Ah, a combination of *two* weirdnesses. First the $#{ARRAY} that's
> >been the subject of the thread, and secondly that 1 .. 3 under certain
> >conditions returns an array:
>
> Well, that's not what's happening. I expected this:
>
> @1 = qw( two elements );
> @2 = qw( );
> @3 = qw( this has four elements );
> @{"4E0"} = qw( ah ha );
>
> print "$#{1 .. 4}: $_" while <DATA>;
> __DATA__
> foo
> bar
> blat
> quux
>
> to output:
>
> 1: foo
> -1: bar
> 3: blat
> 1: quux
>
> Because the $#{1 .. 4} is the scalar flip-flop, and it's equivalent to
> $#{($. == 1) .. ($. == 4)}. The last time that's true, of course, it
> returns the value of $. with "E0" appended to it.
Holy cow. Yes, I get it now. No, I don't expect to go there.
Regards,
Brad
------------------------------
Date: Sun, 16 Nov 2003 13:48:36 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Learn Regex or Perl Frist?
Message-Id: <slrnbrfl4k.7hh.tadmc@magna.augustmail.com>
Don Kim <nihilistcoder@yahoo.com> wrote:
> "Ben Morrow" <usenet@morrow.me.uk> wrote in message
> news:bp8cas$hf7$1@wisteria.csv.warwick.ac.uk...
>> My recommendation would be: first get the hang of the language,
>> treating a regex as a black box.
>
> Hmm. Does that mean there are functions or modules in perl that encapsulate
> regex calls?
Sure, but that isn't (I think) what Ben meant.
He meant don't _try_ to understand the terse regexs for now, just
use them.
(and be sure to reverse that when you are writing production code. :-)
You can do lots of useful stuff while learning Perl even if your
programs don't need or use regexs.
(more accurately: if they don't use one of the pattern matching
operators. "Regexes" don't _do_ anything, "operators" do things).
> Does this same analogy hold for Perl with respect to regex?
You can write modules (Perlspeak for "libraries") to do
just about anything, including pattern matching. See:
http://search.cpan.org/search?query=regex&mode=all
and
http://search.cpan.org/~abigail/Regexp-Common-2.113/
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 17 Nov 2003 01:03:44 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Learn Regex or Perl Frist?
Message-Id: <20031116200343.2e301d21.jwillmore@remove.adelphia.net>
On Sun, 16 Nov 2003 11:30:58 -0800
"Don Kim" <nihilistcoder@yahoo.com> wrote:
> "James Willmore" <jwillmore@remove.adelphia.net> wrote in message
> news:20031116135434.0db71dcf.jwillmore@remove.adelphia.net...
<snip>
> Thanks! I also looked at the regex library in boost and one called
> "Greta" from a guy in microsoft. How does this compare to those?
> Assuming you've looked at them.
I looked over pcre++. I've done more in Perl than C++. The
construction of a regex in pcre++ and Perl are about the same. I
can't speak of performance. I didn't run benchmarks, so I'm not 100%
sure.
<snip>
> Actually, I already purchased the book, but I got it used for $12 so
> it was worth it. I hear you though, I'm sick of buying books only
> to find it wasn't useful to me. :-(
At least it wasn't full boat ;-)
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
Deliberation, n.: The act of examining one's bread to determine
which side it is buttered on. -- Ambrose Bierce, "The Devil's
Dictionary"
------------------------------
Date: Mon, 17 Nov 2003 04:29:11 GMT
From: "John B. Kim" <provicon@earthlink.net>
Subject: MIME::Lite Attaching a file
Message-Id: <r8Ytb.4322$n56.3939@newsread1.news.pas.earthlink.net>
Could anyone tell me how I can attach a pdf file through MIME::Lite??
I don't know how I can specify PATH value.. Do I put down the directory
location of the file I am attaching?? I tried it, but that didn't work.
Any help will be deeply appreciated.. Please help me attach a pdf file
through MIME::Lite.
Thanks.
------------------------------
Date: Mon, 17 Nov 2003 04:06:37 GMT
From: "John B. Kim" <provicon@earthlink.net>
Subject: MIME::Lite Test with MSN Dial Up SMTP
Message-Id: <hPXtb.4297$n56.374@newsread1.news.pas.earthlink.net>
I am having trouble with the code below:
=================================================
use MIME::Lite;
use Net::SMTP;
$msg = MIME::Lite->new(
From =>'jbyungro@msn.com',
To =>'jbyungro@msn.com',
Subject =>'Helloooooo, nurse!',
auth =>"john@msn.com, 00777777",
Data =>"How's it goin', eh?"
);
MIME::Lite->send('smtp', 'smtp.email.msn.com');
$msg->send();
=====================================================
However, when I run the code below, I get the following error message:
----------------------------------------------------------------------------
-------------------------------
.. SMTP MAIL command failed:
..5.7.3 Requested action aborted; mailbox unavailable
----------------------------------------------------------------------------
-------------------------------
Above code works perfectly fine in my office with earthlink DSL. And when I
run the code above with my MSN dial connection at home, I am not getting it
through.
One difference with earthlink and MSN is that with MSN, I have to 'Log On
using Secure Password Authentication (SPA)' while earthlink DSL does not
require that.
So I added the line above:
auth => john@msn.com, 00777777 expecting this helps with
Authentication.
But that does not solve the problem. I still get the same error message.
Could anyone please tell me how I can make this MIME::Lite work with my MSN
dialup (smtp.email.msn.com)??
Any help will be deeply appreciated.
John
------------------------------
Date: Mon, 17 Nov 2003 09:10:43 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Whitespace removal in html generated by cgi
Message-Id: <3072218.31r3eYUQgx@gregs-web-hosting-and-pickle-farming>
It was a dark and stormy night, and Eric J. Roode managed to scribble:
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
>
> Gregory Toomey <nospam@bigpond.com> wrote in
> news:1933712.m1tGeoNVPB@gregs-web-hosting-and-pickle-farming:
>
>> A few weeks ago a question was asked in this group about removing
>> whitespace from html, in particular from html generated by cgi. Here's
>> a simple technique I developed for Linux:
>
> What is the goal of this? Reducing the amount of data that is
> transmitted to the client browser?
Yes.
>If so, you would probably be better
> off compressing the output with gzip -- all major browsers support gzip
> compressed data.
Yes I use Apache with gzip so that's another level of compression.
People hate waiting for pages to load, especially for people on dialup.
>
> [...]
>> #newlines are not needed
>> #except for Content-type-text/html\n\n
>> # which occurs at the start
>> print;
>> print "\n" if $count++<4;
>
> Newlines are needed in <pre>...</pre> sections, and sometimes in
> <textarea>...</textarea> sections.
>
> - --
> Eric
> $_ = reverse sort $ /. r , qw p ekca lre uJ reh
> ts p , map $ _. $ " , qw e p h tona e and print
>
> -----BEGIN xxx SIGNATURE-----
> Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
>
> iQA/AwUBP7f0GWPeouIeTNHoEQKoQACg4qJhX/JKb6y7ZCOK9eiMVqXih9EAn2px
> YT5a72WavpE6GErYnLOzUQ+d
> =zRRz
> -----END PGP SIGNATURE-----
------------------------------
Date: Sun, 16 Nov 2003 18:41:40 -0600
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Whitespace removal in html generated by cgi
Message-Id: <Xns9435C8704BFB0sdn.comcast@216.196.97.136>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Jeff 'japhy' Pinyan <pinyaj@rpi.edu> wrote in
news:Pine.SGI.3.96.1031116171158.181912A-100000@vcmr-64.server.rpi.edu:
> Not to mention that, although most HTML renders multiple whitespace as a
> SINGLE space, a SINGLE newline IS needed, because the browser will render
> it as a space. That is, "foo\nbar" is rendered as "foo bar", while a
> string like "foo \n bar" is also just rendered as "foo bar".
Ooh, good point.
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBP7gZY2PeouIeTNHoEQJuPwCePA4BQ8lKxNoFVeJK7PeCK7vOgaUAn1xC
xlc/HAuS24OiXl9X1RTYqVPZ
=iONd
-----END PGP SIGNATURE-----
------------------------------
Date: Sun, 16 Nov 2003 18:43:22 -0600
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Whitespace removal in html generated by cgi
Message-Id: <Xns9435C8BA3199Dsdn.comcast@216.196.97.136>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Gregory Toomey <nospam@bigpond.com> wrote in news:3072218.31r3eYUQgx@gregs-
web-hosting-and-pickle-farming:
>
> People hate waiting for pages to load, especially for people on dialup.
Have you verified that the extra time your CGI scripts take to execute is
less than the transfer time of the spaces you are eliminating? :-)
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBP7gZyWPeouIeTNHoEQJc6QCfRsU9IVVvuPbf1LCJ65Ot7K+TVJUAnRXm
MizOFx2ThfFeAocFzgE/LLZ/
=fWE0
-----END PGP SIGNATURE-----
------------------------------
Date: Mon, 17 Nov 2003 12:15:16 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Whitespace removal in html generated by cgi
Message-Id: <11262883.YIb4lfRANm@gregs-web-hosting-and-pickle-farming>
It was a dark and stormy night, and Eric J. Roode managed to scribble:
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
>
> Gregory Toomey <nospam@bigpond.com> wrote in
> news:3072218.31r3eYUQgx@gregs- web-hosting-and-pickle-farming:
>
>>
>> People hate waiting for pages to load, especially for people on dialup.
>
> Have you verified that the extra time your CGI scripts take to execute is
> less than the transfer time of the spaces you are eliminating? :-)
>
The server I use for cgi is about 2.6GHz and averages 20% CPU utilisation.
Running the script to remove whitespace takes under 1 second for 1000 lines of HTML, and does not increase the load to any discernable extent.
The database-driven cgi I use is disk IO bound, not CPU bound.
gtoomey
------------------------------
Date: Mon, 17 Nov 2003 12:19:56 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Whitespace removal in html generated by cgi
Message-Id: <6153765.DrrUeNxg0K@gregs-web-hosting-and-pickle-farming>
It was a dark and stormy night, and Eric J. Roode managed to scribble:
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
>
> Jeff 'japhy' Pinyan <pinyaj@rpi.edu> wrote in
> news:Pine.SGI.3.96.1031116171158.181912A-100000@vcmr-64.server.rpi.edu:
>
>> Not to mention that, although most HTML renders multiple whitespace as a
>> SINGLE space, a SINGLE newline IS needed, because the browser will render
>> it as a space. That is, "foo\nbar" is rendered as "foo bar", while a
>> string like "foo \n bar" is also just rendered as "foo bar".
>
> Ooh, good point.
>
I tried it on a dozen cgis and it worked.
To make this foolproof your need to write a HTML parser - this is left as an exercise for the reader!
gtoomey
------------------------------
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 5814
***************************************