[25877] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8107 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 24 00:05:25 2005

Date: Mon, 23 May 2005 21:05:04 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 23 May 2005     Volume: 10 Number: 8107

Today's topics:
        anyone getting rid of perlable-laptop?  slow=OK.  (for  (David Combs)
    Re: FormMail Problem <apeiron+usenet@coitusmentis.info>
    Re: FormMail Problem <noreply@gunnar.cc>
    Re: HTML::TableExtract punctuation parsing <maqo@yahoo.com>
        input record separator and the modifiers /s and /m. <jblno@spamhotmail.com>
    Re: input record separator and the modifiers /s and /m. <jgibson@mail.arc.nasa.gov>
        Strange 'for' behaviour? <softouch@softouch.on.ca>
    Re: Strange 'for' behaviour? <1usa@llenroc.ude.invalid>
    Re: Test <kst-u@mib.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 23 May 2005 20:42:15 -0400
From: dkcombs@panix.com (David Combs)
Subject: anyone getting rid of perlable-laptop?  slow=OK.  (for YAPC-trip)
Message-Id: <d6tt97$cf6$1@panix2.panix.com>

Myself, I use a sun workstation (blade-100), and have
no laptop (haven't needed one).

I'm going to this year's YAPC (yet another perl conf)
up in Toronto, and I'd really like to be able to
try perl stuff while there -- where there'll be hundreds
of perl mostly-experts (not me!) around to get feedback
from.

(Work at home, alone, with no perl expert or even user
around to talk to here.)

So, I'd like to get a laptop for this trip -- and
for eg vacations.

Question: anyone upgrading to a newer laptop, and 
wants to get rid of what he/she's got now?

(price *is* an issue, as I don't *really* need
a laptop for my business -- just for going to eg
YAPC, going into NYC to a perl-event, etc.)

Thanks!

David Combs

(am in New Rochelle, NY -- 30 min train ride north of Manhattan.)




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

Date: 23 May 2005 22:55:54 GMT
From: Christopher Nehren <apeiron+usenet@coitusmentis.info>
Subject: Re: FormMail Problem
Message-Id: <slrnd94nrq.tdu.apeiron+usenet@prophecy.dyndns.org>

On 2005-05-23, Gunnar Hjalmarsson scribbled these
curious markings:
> Olen R. Pearson wrote:
>> I am using FormMail.CGI v. 1.92 (04/21/02) to process s form on a Website.
>> Though I am not familiar with Perl,
> If you don't get help that way (you probably don't...), try one of the 
> form-to-mail solutions at http://nms-cgi.sourceforge.net/scripts.shtml 
> instead.

Even if you *do* get help that way, *stop* using FormMail now. It's
horribly, horrendously insecure and thoroughly broken.

Best Regards,
Christopher Nehren
-- 
I abhor a system designed for the "user", if that word is a coded
pejorative meaning "stupid and unsophisticated". -- Ken Thompson
If you ask the wrong people questions, you get "Joel on Software".
Unix is user friendly. However, it isn't idiot friendly.


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

Date: Tue, 24 May 2005 01:20:47 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: FormMail Problem
Message-Id: <3ff7g6F7jh9mU1@individual.net>

Christopher Nehren wrote:
>> Olen R. Pearson wrote:
>>> I am using FormMail.CGI v. 1.92 (04/21/02) to process s form on a
>>> Website.
> 
> *stop* using FormMail now. It's
> horribly, horrendously insecure and thoroughly broken.

Even if I'm not sure, I have a feeling that you are referring to 
previous versions. If also v. 1.92 deserves that verdict, it would be 
nice if you (or somebody else) could explain *how* it's broken.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Tue, 24 May 2005 02:10:04 GMT
From: Maqo <maqo@yahoo.com>
Subject: Re: HTML::TableExtract punctuation parsing
Message-Id: <02wke.105$jU5.300157@twister.nyc.rr.com>

Bob Walton wrote:

> My browser says that web page is Unicode with UTF-8 encoding.  If you 
> process it as Unicode with UTF-8 encoding, you'll probably be fine.  
> Otherwise, as you noted, you'll get gibberish.  If you view the results 
> of your print() with a Unicode with UTF-8 viewer, you should be OK, as 
> you are doing nothing that should alter the non-ASCII characters.

Thanks Bob, that's what I had suspected as well, which is why I can't 
for the life of me understand why this is still giving me gibberish (I 
must be missing something with respect to proper decoding of UTF-8):

use LWP::UserAgent;
use HTML::Encoding 'encoding_from_http_message';
use Encode;

my $URL = 
"http://www.pimco.com/LeftNav/Late+Breaking+Commentary/IO/2005/IO+May-June+2005.htm";

my $content = LWP::UserAgent->new->get($URL, 'Accept-Charset'=>'UTF-8');
my $enco = encoding_from_http_message($content);
my $utf8 = decode($enco => $content->content());
open (OUT, ">:encoding(utf8)", "out.html");
print OUT $utf8;
close (OUT);


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

Date: Tue, 24 May 2005 00:16:17 GMT
From: jbl <jblno@spamhotmail.com>
Subject: input record separator and the modifiers /s and /m.
Message-Id: <i5p4915au1cm4sit49p66npvde93qnic4i@4ax.com>


I  don't use perl everyday, so I seem to get my thinking muddled
between sessions when it comes to using/changing the input record
separator and the modifiers /s and /m.

I guess that I am trying to state my understanding of this in my own
words and see from any comments, if I am anywhere close.

Without altering $/ ( input/read file line by line)

neither of the following would have any/much effect

/m	 ^ and $ match next to embedded \n

 (^ and $ would both be useless here as the regex cannot look before
the start of the line or after the end of the line.)

/s	 Dot (.) matches newline.

same here because there is nothing in $_ except the current line

after using 

undef $/; # or some other quantifier like : , 

The entire file is read in as one string, or defined paragraph

The /m modifier asserts that, when used, /^reg.+?exp$/m, simply means
that the target regexp cannot span across newlines, and that it begins
immediately following a newline.

The /s modifier asserts that, when used, /^reg.+?exp$/s, the target
regexp can span newlines but will not either start immediately after a
newline or end immediately before a newline, as it appears.

The /sm modifier asserts that, when used, /^reg.+?exp$/sm, the target
regexp begins immediately following a newline and ends immediately
before a newline, but can span across multiple newlines


I hear and see the term "multiline mode". Is this just referring ro
using undef $/; # or some other quantifier like : ,  causing input to
get the whole file or a portion defined by another quantifier, and the
/s modifier 

thanks
jbl


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

Date: Mon, 23 May 2005 17:37:32 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: input record separator and the modifiers /s and /m.
Message-Id: <230520051737328271%jgibson@mail.arc.nasa.gov>

In article <i5p4915au1cm4sit49p66npvde93qnic4i@4ax.com>, jbl
<jblno@spamhotmail.com> wrote:

> I  don't use perl everyday, so I seem to get my thinking muddled
> between sessions when it comes to using/changing the input record
> separator and the modifiers /s and /m.
> 
> I guess that I am trying to state my understanding of this in my own
> words and see from any comments, if I am anywhere close.
> 
> Without altering $/ ( input/read file line by line)
> 
> neither of the following would have any/much effect
> 
> /m   ^ and $ match next to embedded \n
> 
>  (^ and $ would both be useless here as the regex cannot look before
> the start of the line or after the end of the line.)

No, they are useful, since ^ can match the beginning of the string and
$ the end of the string, thereby anchoring the match.

> 
> /s   Dot (.) matches newline.
> 
> same here because there is nothing in $_ except the current line

But there could be a \n character at the end of the string if you have
not removed it (not too useful though as using $ is more normal).

> 
> after using 
> 
> undef $/; # or some other quantifier like : , 
> 
> The entire file is read in as one string, or defined paragraph
> 
> The /m modifier asserts that, when used, /^reg.+?exp$/m, simply means
> that the target regexp cannot span across newlines, and that it begins
> immediately following a newline.

or at the beginning of the string.

> 
> The /s modifier asserts that, when used, /^reg.+?exp$/s, the target
> regexp can span newlines but will not either start immediately after a
> newline or end immediately before a newline, as it appears.

In fact the match must start at the beginning of the string and end at
the end of the string.

> 
> The /sm modifier asserts that, when used, /^reg.+?exp$/sm, the target
> regexp begins immediately following a newline and ends immediately
> before a newline, but can span across multiple newlines

but can start at the beginning of the string and end at the end of the
string (if there is not a newline at the end).

> 
> 
> I hear and see the term "multiline mode". Is this just referring ro
> using undef $/; # or some other quantifier like : ,  causing input to
> get the whole file or a portion defined by another quantifier, and the
> /s modifier 

I don't know.


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---


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

Date: Mon, 23 May 2005 19:52:51 -0400
From: Amer Neely <softouch@softouch.on.ca>
Subject: Strange 'for' behaviour?
Message-Id: <U1uke.1$FB.0@read1.cgocable.net>

Read the FAQ plus numerous books I have on hand about a 'for' loop and 
the '..' range operator. Every example I've seen assumes the list is in 
ascending order.

I'm stumped as to the behaviour of a for loop I'm trying to get working.

for $year (1999 .. 2005)
{
     print "$year,";
}

does what you would expect .. prints '1999, 2000, 2001, 2002, 2003, 
2004, 2005'.

But thie:

for $year (2005 .. 1999)
{
     print "$year,";
}

prints nothing. Pourqoui? What is going on that I don't see?

-- 
Amer Neely, Softouch Information Services
Home of Spam Catcher
W: www.softouch.on.ca
E: trudge@softouch.on.ca
Perl | MySQL | CGI programming for all data entry forms.
"We make web sites work!"



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

Date: Tue, 24 May 2005 00:06:39 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Strange 'for' behaviour?
Message-Id: <Xns965FCC6281319asu1cornelledu@127.0.0.1>

Amer Neely <softouch@softouch.on.ca> wrote in
news:U1uke.1$FB.0@read1.cgocable.net: 

> Read the FAQ plus numerous books I have on hand about a 'for' loop and
> the '..' range operator. Every example I've seen assumes the list is
> in ascending order.

It seems like you did not look at the documentation that explains how 
the range operator works:

perldoc perlop

> for $year (2005 .. 1999)
> {
>      print "$year,";
> }
> 
> prints nothing. Pourqoui? What is going on that I don't see?

From the documentation mentioned above:

  Range Operators
    ... In list context, it returns a list of values counting (up by 
    ones) from the left value to the right value. If the left value 
    is greater than the right value then it returns the empty list. 

Besides, what you are doing with the loop is seriously ugly:

#! /usr/bin/perl

use strict;
use warnings;

my $asc = join ',', 1999 .. 2005;
my $dsc = join ',', reverse 1999 .. 2005;

print "$asc\n$dsc\n";

__END__

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


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

Date: Tue, 24 May 2005 00:46:21 GMT
From: Keith Thompson <kst-u@mib.org>
Subject: Re: Test
Message-Id: <lnll65zc0y.fsf@nuthaus.mib.org>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:
> test <test@freenet.de> wrote in comp.lang.perl.misc:
>> It's only a test.
>> Please klick on link to test:
>> [link deleted]
>
> Stop that.  Use a test group.

The "Test" posting appears to be spam; it came from the same site as
the "PORNO SEX PICS" that followed it shortly after.  The original
poster never saw your followup.

And if you do post a followup to a spam, troll, or whatever, please
don't quote any URLs included in the message.  It only publicizes them
further.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.


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

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 V10 Issue 8107
***************************************


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