[23176] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5397 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 20 14:06:03 2003

Date: Wed, 20 Aug 2003 11:05:10 -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           Wed, 20 Aug 2003     Volume: 10 Number: 5397

Today's topics:
        ##Nevermind!## <res1kymn@verizon.net>
    Re: ##Not interested in Bangin' Code?## (Tad McClellan)
        [OT] Is the perl review still active? <mothra@nowhereatall.com>
    Re: and Randal L. Schwartz the hacker <chesucat@freeshell.org>
    Re: Best practice: initialisation of variables nobull@mail.com
        column_info (Philip M. Gollucci)
        Continous Ping with Timestamp? (John Davis)
    Re: Continous Ping with Timestamp? <ndronen@io.frii.com>
        downloading CPAN modules behind firewall (Madhu Nair)
    Re: Explain the method for a newbie (Tad McClellan)
    Re: Explain the method for a newbie (Didatus)
    Re: Explain the method for a newbie <noreply@gunnar.cc>
    Re: Explain the method for a newbie <slarti42@thhgttg.net>
    Re: Explain the method for a newbie <noreply@gunnar.cc>
    Re: Explain the method for a newbie <dave.nospam@ntlworld.com>
        How can I put my email address on my website without at <achim.baur@gmx.de>
    Re: How can I put my email address on my website withou <mrclean@protctorandgamble.com>
    Re: How can I put my email address on my website withou <matthew.garrish@sympatico.ca>
    Re: mod_perl 2 Setup ? <welton_bob@nospam_hotmail.com>
    Re: Module::Build is yet more broken... <nospam-abuse@ilyaz.org>
    Re: OS/2 line feed question <flavell@mail.cern.ch>
    Re: OS/2 line feed question <dave.nospam@ntlworld.com>
        OT but hey <mpapec@yahoo.com>
    Re: Perl or PHP for web work ? <jaspax@u.washington.edu>
        Proper way to export structures from a module (Steve D)
    Re: Regex - assign to new variable and replace in one l <mpapec@yahoo.com>
    Re: Regex - assign to new variable and replace in one l (Brad Walton)
    Re: Regular expression, getting href which is followed  (Tad McClellan)
    Re: Regular expression, getting href which is followed  <member36366@dbforums.com>
    Re: Regular Expression (Tad McClellan)
    Re: Replace words into a string with a space before or  (Tad McClellan)
    Re: Strange INC error when using perl 5.8.0 as a cgi sc <tony_curtis32@yahoo.com>
    Re: Strange INC error when using perl 5.8.0 as a cgi sc <ellem52@mac.com>
    Re: Tad/Randal Schwatz/Stonehenge Consulting...you all  (Brad Walton)
    Re:  <bwalton@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 20 Aug 2003 17:20:35 GMT
From: Tony <res1kymn@verizon.net>
Subject: ##Nevermind!##
Message-Id: <BB691BFD.3C26%res1kymn@verizon.net>

I'm sure now, that this is the wrong place for help. You guys have a good
day.

Tony



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

Date: Wed, 20 Aug 2003 07:36:24 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: ##Not interested in Bangin' Code?##
Message-Id: <slrnbk6qq8.73q.tadmc@magna.augustmail.com>

Tony <res1kymn@verizon.net> wrote:

> Wow! did I get someones attention?


With what?

This is the first post here from your address.

If you are referring to something that happened here, it is
customary to quote some context so that people will know
what you are talking about.

What are you talking about?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Wed, 20 Aug 2003 10:25:35 -0700
From: "Mothra" <mothra@nowhereatall.com>
Subject: [OT] Is the perl review still active?
Message-Id: <3f43a4c0$1@usenet.ugs.com>

Hi All,

Does anyone know if the perl review is still active? The last issue is Jan
of this year.
I was thinking of submitting an article and noticed it has been a while
since the
last pub.

Thanks

Mothra




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

Date: Wed, 20 Aug 2003 13:54:16 -0400
From: Chesucat <chesucat@freeshell.org>
Subject: Re: and Randal L. Schwartz the hacker
Message-Id: <Pine.NEB.4.33.0308201349320.4218-100000@vinland.freeshell.org>

On Wed, 20 Aug 2003, hudson wrote:

> did you ever come clean off of that?

He is a felon!  He can't vote and can't own a gun!  Most ex-cons generally
don't do so well after the 'big house' and they end up working day labor
jobs, until they commit another crime.  I really impress that he doing
well and not back in the system.  Most people don't give ex-cons and
felons a second chance!

chesucat

-- 
chesucat@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org
First, a few words about tools.

Basically, a tool is an object that enables you to take advantage of
the laws of physics and mechanics in such a way that you can seriously
injure yourself.  Today, people tend to take tools for granted.  If
you're ever walking down the street and you notice some people who look
particularly smug, the odds are that they are taking tools for
granted.  If I were you, I'd walk right up and smack them in the face.
		-- Dave Barry, "The Taming of the Screw"



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

Date: 20 Aug 2003 10:11:42 -0700
From: nobull@mail.com
Subject: Re: Best practice: initialisation of variables
Message-Id: <4dafc536.0308200911.25eef7bb@posting.google.com>

RA Jones <valid-till-end-Aug@dpw.clara.co.uk> wrote in message news:<j6owhABSzzQ$EwSM@nildram.co.uk>...
> This is a question about initialization of variables.

Are you sure?

> my %in = $q->Vars(); # stuff that comes in from the web-page

> foreach( @field_names ) { 
>    if ($in{$_} ne $ref->{$_})

> This works fine on UNIX running Apache 1.3.x, but hangs on Win32 running 
> the same server version. I have grown used to this difference, and I 
> know that it is probably caused by some 'Use of uninitialized value in 
> concatenation (.) or string' warnings going to the server error logs. 
> Presumably the problem occurs whenever I try to use one of the variables 
> in %in or $ref that does not contain a value.

> Although the script runs fine on the production server, I am trying to 
> get it ready for a mod_perl environment, so need to remove all warnings, 
> so I have included the following line after the 'foreach' statement :
> 
> $in{$_} ||= ''; $ref->{$_} ||= '';
> 
> I cannot risk doing a global '$in{$_} ||= '' foreach keys %in' as soon 
> as %in is defined, in case some of the variables contains a legitimate 
> '0'. So I do it only when I know the variable cannot contain '0'.
> 
> This gets rid of the warnings. But the problem is I have a great many 
> functions using %in and $ref throughout my script. The question is, do I 
> have to use the same line as above every time I use %in or create a new 
> %ref (huge duplication), and is this the correct way to do it anyway, or 
> should I do this instead:
> 
> if ($in{$_} && $in{$_} ne $ref->{$_}) { etc
>
> Or something better still?

Upgrade to a newer Apache that doesn't have the bug.

(This is kinda ducking the issue, production CGI scripts should not be
emitting warnings even on platforms where this doesn't kill Apache).

OR

Switch off the uninitialized warning globally.

OR

Switch off the uninitialized warning just for those expresions where
you have decided that you want to use possibly undefined variables in
a string context.


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

Date: 20 Aug 2003 07:35:12 -0700
From: pgollucci@ejpress.com (Philip M. Gollucci)
Subject: column_info
Message-Id: <75e6245d.0308200635.7df8a7a2@posting.google.com>

Hi, I've got an issue with $dbh->column_info for DBD::Oracle.

Basically the function returns undef to me and I've seen the exact
same code
work under DBD::ODBC.

    foreach my $column_nm (@column_nms) {
      my $sth = $dbh->column_info(undef, $schema, $table_nm,
$column_nm);
      my $hashref = $sth->fetchrow_hashref(); ### line 278
      my $type_name = $hashref->{'type_name'};
      my $size = $hashref->{'column_size'};

    }

Basically the fetchrow_hashref failes because: 
Can't call method "fetchrow_hashref" on an undefined value at
/opt/ejpress/ams/cgi-bin/AMSDbMaintenance.pm line 278.


I have 2 setups one of them is a clients (doesn't work) one of them is
my
local dev (works). Based on
http://search.cpan.org/author/TIMB/DBD-Oracle-1.14/Oracle.pm#column_info_
http://search.cpan.org/author/TIMB/DBI-1.37/DBI.pm

Client:
I do _not_ have root on this system.
uname -a
SunOS ejpnode1 5.9 Generic_112233-02 sun4u sparc SUNW,UltraAX-i2
perl -v
This is perl, v5.8.0 built for sun4-solaris
perl -MDBI -e 'print $DBI::VERSION'   => 1.37
perl -MDBD::Oracle -e 'print $DBD::Oracle::VERSION' => 1.14

Local:
Win2k SP3
perl -v
This is perl, v5.6.1 built for MSWin32-x86-multi-thread
perl -MDBD::Oracle -e 'print $DBD::Oracle::VERSION' => 1.14
perl -MDBD::ODBC -e 'print $DBD::ODBC::VERSION' => 1.05

------------------------------------------------------------------------------
Philip M. Gollucci
eJournalPress 
DBA / Software Engineer / System Administrator 
E-Mail: pgollucci [at] ejournalpress.com
URL   : http://www.ejournalpress.com 
Phone : 301.530.6375


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

Date: 20 Aug 2003 07:16:51 -0700
From: tudmuf2b@onebox.com (John Davis)
Subject: Continous Ping with Timestamp?
Message-Id: <7167a8d.0308200616.4f0ad20e@posting.google.com>

Hey folks,

I'm a Perl newbie and would like to know. Does perl have any module or
is there any source code out there that does a continuous ping with
timestamp attached to it?

On Solaris, I run this:

timson% /usr/sbin/ping -s ron
PING rover.isn.instinet.com: 56 data bytes
64 bytes from ron.iseen.yahoo.com (172.98.123.3): icmp_seq=0. time=25.
ms
64 bytes from ron.iseen.yahoo.com (172.98.123.3): icmp_seq=1. time=19.
ms
64 bytes from ron.iseen.yahoo.com (172.98.123.3): icmp_seq=2. time=23.
ms

I get continuous pings and also get back the time it takes, which I
want to log.

I want to be able to timestamp each ping attempt because there have
been some issue with latency and I want to be able to track ping times
with timestamps to see if I can pin point a delay (via our WAN) at the
time someone reports it.

Thanks!


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

Date: 20 Aug 2003 17:03:37 GMT
From: Nicholas Dronen <ndronen@io.frii.com>
Subject: Re: Continous Ping with Timestamp?
Message-Id: <3f43a9e9$0$194$75868355@news.frii.net>

John Davis <tudmuf2b@onebox.com> wrote:
JD> Hey folks,

JD> I'm a Perl newbie and would like to know. Does perl have any module or
JD> is there any source code out there that does a continuous ping with
JD> timestamp attached to it?

JD> On Solaris, I run this:

JD> timson% /usr/sbin/ping -s ron
JD> PING rover.isn.instinet.com: 56 data bytes
JD> 64 bytes from ron.iseen.yahoo.com (172.98.123.3): icmp_seq=0. time=25.
JD> ms
JD> 64 bytes from ron.iseen.yahoo.com (172.98.123.3): icmp_seq=1. time=19.
JD> ms
JD> 64 bytes from ron.iseen.yahoo.com (172.98.123.3): icmp_seq=2. time=23.
JD> ms

JD> I get continuous pings and also get back the time it takes, which I
JD> want to log.

JD> I want to be able to timestamp each ping attempt because there have
JD> been some issue with latency and I want to be able to track ping times
JD> with timestamps to see if I can pin point a delay (via our WAN) at the
JD> time someone reports it.

Net::Ping's hires() will accomplish that.

	http://search.cpan.org/search?query=Ping&mode=all

Regards,

Nicholas

-- 
"Why shouldn't I top-post?"    http://www.aglami.com/tpfaq.html
"Meanings are another story."  http://www.ifas.org/wa/glossolalia.html


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

Date: 20 Aug 2003 10:45:29 -0700
From: eloormadhu@hotmail.com (Madhu Nair)
Subject: downloading CPAN modules behind firewall
Message-Id: <ba154189.0308200945.1718be27@posting.google.com>

I read through FAQ, but still having some confusion.

In our network both in and out FTP is blocked in the firewall and port
80 is opened to out. Their is no ftp or http proxy.
So how can I use CPAN to update/install modules as currently it hangs
at ftp line

Thanks
madhu


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

Date: Wed, 20 Aug 2003 08:41:08 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Explain the method for a newbie
Message-Id: <slrnbk6ujk.73q.tadmc@magna.augustmail.com>

Naren <narendranath.ts@in.bosch.com> wrote:

> perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
> 
> This code prints prime if the input is prime

> Can anyone kindly give me the C implementation of the same or the algo
> followed


   http://montreal.pm.org/tech/neil_kandalgaonkar.shtml


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 20 Aug 2003 08:47:43 -0700
From: christian.hammer@dynarize.de (Didatus)
Subject: Re: Explain the method for a newbie
Message-Id: <a948a960.0308200747.2bc9ae70@posting.google.com>

Gunnar Hjalmarsson <noreply@gunnar.cc> wrote in message news:<bhvip4$3l46k$1@ID-184292.news.uni-berlin.de>...
> Naren wrote:
> > Hello Grp,
> >     I dont know anything of perl.
> 
> In that case, why on earth did you post here?

because this is a perl group and he has a perl code he don't
understand (because he dont know anything about perl) ? well i think
he is in the right group ...


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

Date: Wed, 20 Aug 2003 17:57:11 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Explain the method for a newbie
Message-Id: <bi05sf$3qjqm$1@ID-184292.news.uni-berlin.de>

Didatus wrote:
> Gunnar Hjalmarsson wrote:
>> Naren wrote:
>> 
>>> Hello Grp, I dont know anything of perl.
>> 
>> In that case, why on earth did you post here?
> 
> because this is a perl group and he has a perl code he don't 
> understand (because he dont know anything about perl) ? well i
> think he is in the right group ...

You should have read the Posting Guidelines before making such a
statement:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html

If you after having done so would keep thinking that your statement is
correct, please let us know. (In that case I have completely
misunderstood the purpose of clpmisc.)

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



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

Date: Wed, 20 Aug 2003 17:19:35 +0100
From: "Slartibartfast" <slarti42@thhgttg.net>
Subject: Re: Explain the method for a newbie
Message-Id: <bi072o$iav$1@coset.qualcomm.com>

"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message news:bi05sf$3qjqm$1@ID-184292.news.uni-berlin.de...
> Didatus wrote:
> > Gunnar Hjalmarsson wrote:
> >> Naren wrote:
> >>
> >>> Hello Grp, I dont know anything of perl.
> >>
> >> In that case, why on earth did you post here?
> >
> > because this is a perl group and he has a perl code he don't
> > understand (because he dont know anything about perl) ? well i
> > think he is in the right group ...
>
> You should have read the Posting Guidelines before making such a
> statement:
> http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
>
> If you after having done so would keep thinking that your statement is
> correct, please let us know. (In that case I have completely
> misunderstood the purpose of clpmisc.)
>

Extract from aforementioned guidelines:

   "Do not use these guidelines as a 'license to flame' or other
   meanness. It is possible that a poster is unaware of things
   discussed here.  Give them the benefit of the doubt, and just
   help them learn how to post, rather than assume"

Why does the Internet attract so many dysfunctional geeks with personality disorders?

I bet you don't talk to people in real life the way you do here. You'd certainly have some civility rammed down your throat.

-- 
#include <stdio.h>
char*f="#include <stdio.h>char*f=%c%s%c;main(){printf(f,34,f,34,10);}%c";
main(){printf(f,34,f,34,10);}




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

Date: Wed, 20 Aug 2003 18:34:20 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Explain the method for a newbie
Message-Id: <bi0825$3tlbc$1@ID-184292.news.uni-berlin.de>

Slartibartfast wrote:
> "Gunnar Hjalmarsson" wrote:
>> Didatus wrote:
>>> Gunnar Hjalmarsson wrote:
>>>> Naren wrote:
>>>>> Hello Grp, I dont know anything of perl.
>>>> 
>>>> In that case, why on earth did you post here?
>>> 
>>> because this is a perl group and he has a perl code he don't 
>>> understand (because he dont know anything about perl) ? well i 
>>> think he is in the right group ...
>> 
>> You should have read the Posting Guidelines before making such a 
>> statement: 
>> http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
>> 
>> If you after having done so would keep thinking that your
>> statement is correct, please let us know. (In that case I have
>> completely misunderstood the purpose of clpmisc.)
> 
> Extract from aforementioned guidelines:
> 
> "Do not use these guidelines as a 'license to flame' or other 
> meanness. It is possible that a poster is unaware of things 
> discussed here.  Give them the benefit of the doubt, and just help
> them learn how to post, rather than assume"
> 
> Why does the Internet attract so many dysfunctional geeks with
> personality disorders?

Are you possibly referring to yourself, "Slartibartfast"?

In reply to OP I just made clear that this group is not intended for
people who "don't know anything of perl".

My mentioning of the Posting Guidelines was in response to Didatus who
claimed that I was wrong. Was that uncivil?

You show civility when posting to a Usenet group by respecting both
the etiquette rules for Usenet in general and the group specific
posting guidelines.

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



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

Date: Wed, 20 Aug 2003 18:27:14 +0100 (BST)
From: "Dave Saville" <dave.nospam@ntlworld.com>
Subject: Re: Explain the method for a newbie
Message-Id: <qnirfnivyyragyjbeyqpbz.hjxvpe6.pminews@text.news.ntlworld.com>

On Wed, 20 Aug 2003 18:34:20 +0200, Gunnar Hjalmarsson wrote:

>Slartibartfast wrote:
>> "Gunnar Hjalmarsson" wrote:
>>> Didatus wrote:
>>>> Gunnar Hjalmarsson wrote:
>>>>> Naren wrote:
>>>>>> Hello Grp, I dont know anything of perl.
>>>>> 
>>>>> In that case, why on earth did you post here?
>>>> 
>>>> because this is a perl group and he has a perl code he don't 
>>>> understand (because he dont know anything about perl) ? well i 
>>>> think he is in the right group ...
>>> 
>>> You should have read the Posting Guidelines before making such a 
>>> statement: 
>>> http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html

Which begs the question that having found a group, presumably by
scanning group names in a newsreader, how does one know where to go for
guidelines? - if any - and I for one can't resolve that URL. 

Regards

Dave Saville

NB switch saville for nospam in address




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

Date: Wed, 20 Aug 2003 18:39:18 +0200
From: Achim Baur <achim.baur@gmx.de>
Subject: How can I put my email address on my website without attracting Spam?
Message-Id: <bi088d$3sscv$1@ID-13112.news.uni-berlin.de>

The subject speaks for itself: I am looking for a way to put my email 
address out there without generating Spam or attracting Worms.

On the other hand I don't want to ask to much of computer illaterates by 
simply writing "nospam" somewhere in the address.

Has anyone already thought of a more sophisticated method, like e.g. 
generating the address dynamically? Sorry if this has been asked before 
but I did not really find anything googling.

Achim



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

Date: Wed, 20 Aug 2003 16:58:09 GMT
From: Mr. Clean <mrclean@protctorandgamble.com>
Subject: Re: How can I put my email address on my website without attracting Spam?
Message-Id: <MPG.19ad6453a043f23989a5b@news-server.austin.rr.com>

In article <bi088d$3sscv$1@ID-13112.news.uni-berlin.de>, achim.baur@gmx.de 
says...
> The subject speaks for itself: I am looking for a way to put my email 
> address out there without generating Spam or attracting Worms.
> 
> On the other hand I don't want to ask to much of computer illaterates by 
> simply writing "nospam" somewhere in the address.
> 
> Has anyone already thought of a more sophisticated method, like e.g. 
> generating the address dynamically? Sorry if this has been asked before 
> but I did not really find anything googling.

Several ways. I used E_Cloaker to munge the links 
http://www.codefoot.com/software/ecloaker/index.shtml

I've also seen a really good one... RedSquirrel's SecurEmailL script.
Works very nicely on PHP hosts. 

http://rsscripts.tripod.com/scripts/securemaill.htm


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

Date: Wed, 20 Aug 2003 13:47:44 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: How can I put my email address on my website without attracting Spam?
Message-Id: <hvO0b.2433$c_.95785@news20.bellglobal.com>


"Achim Baur" <achim.baur@gmx.de> wrote in message
news:bi088d$3sscv$1@ID-13112.news.uni-berlin.de...
> The subject speaks for itself: I am looking for a way to put my email
> address out there without generating Spam or attracting Worms.
>
> On the other hand I don't want to ask to much of computer illaterates by
> simply writing "nospam" somewhere in the address.
>
> Has anyone already thought of a more sophisticated method, like e.g.
> generating the address dynamically? Sorry if this has been asked before
> but I did not really find anything googling.
>

Create a script to generate the mail for you using one of the mail modules
on cpan. All you need on your page is an entry field for the user's return
address and a textbox for the message. When you receive the automated email
you can then determine whether you want to respond to the person and reveal
your email address.

I have a contact page like so on a site I maintain that will also route the
messages to the appropriate person internally based on the subject the user
picks from a drop-down list (with any unmatched subjects coming to me so
I'll know if someone is trying to hack the form). It also has the advantage
of not requiring the person sending the email to have an email account on
the machine they're using.

If you do implement something like the above, just make sure the user has no
direct input into who the email gets delivered to (i.e., hard code your
address in your script, and avoid "courtesy" copies). Otherwise, you could
wind up writing the next formmail.pl...

Matt




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

Date: Wed, 20 Aug 2003 16:55:03 +0100
From: "Bob Welton" <welton_bob@nospam_hotmail.com>
Subject: Re: mod_perl 2 Setup ?
Message-Id: <bi05ts$iv8$1@news.freedom2surf.net>

Thanks Sam,

Please find attached    httpd.conf    and also  perl.conf

As you will see my index.pl is in
/apps/sites/staging.mydomain.com/cgi-bin
and my application .pm files are in
/apps/sites/staging.mydomain.com/perl

There appears to be a 2.1 second delay following Initial Connection to 1st
byte received when browsing my index.pl
I am assuming that this is the latency in 'interpreting' the Perl and am
hoping to get rid/reduce this through mod_perl

The code was originally developed on Apache 1.3x / Perl 5.8  so have also
tried adding:   PerlModule Apache::compat   to the httpd.conf, but this
errors are apache startup.

Many thanks for your help.

Cheers

Bob


"sam" <rbaba99@caramail.com> wrote in message
news:bhu1id$103l$1@news.cybercity.dk...
> > Thanks Sam, I've sent you the  httpd.conf etc
>
> Where ?
>
> The email address I use in the news group is fa....
>
> Please send to the news group.
>
>




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

Date: Wed, 20 Aug 2003 17:11:53 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Module::Build is yet more broken...
Message-Id: <bi0a4p$23n8$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Sam Holden
<sholden@cs.usyd.edu.au>], who wrote in article <slrnbk5gr0.d2f.sholden@flexal.cs.usyd.edu.au>:
> Simply because I can't see any reason why perl would want to do otherwise.
> 
> If there are such systems then replace "Build.PL" with "Setup.PL" and
> "Build" with "Build.PL" or whatever. The actual names of the files
> are pretty much irrelevant to me.

Same for me - as far the files differ by more than extension.  But
Module::Build does exactly this.

> If there is no platform independant way of specifying run the perl
> script "foo" and pass it the argument "bar", then I guess some sort
> of english description (better than mine, hopefully) would need to
> be used.

It is much easier to fix bugs/problems than document them.

> If there are a handful of wierdo architectures that are completely
> different then examples of those can be used along with the
> general case.

This is not acceptable.  I do not want my users to read 20-page README
just to find out how to install things on a non-broken system.  Too
many Perl installations are broken; if non-broken ones give troubles
too, the whole idea of supporting modules becomes a nightmare...

> If you have no problem with "perl Makefile.PL" as instructions
> then I can't see how some name other than "Makefile" can be
> a problem.

See above.

> > You mean "currently" or "in foreseeable future"?  I would not vouch in
> > the second case...

> Why would that ever change? perl5.8.0 still accepts ' as a package
> seperator, why would backwards compatibility be broken so badly for
> absolutely no gain whatsoever (as far as I can tell).

Simple: suppose a filesystem does not allow files with empty extensions.

Hope this helps,
Ilya


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

Date: Wed, 20 Aug 2003 15:09:01 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: OS/2 line feed question
Message-Id: <Pine.LNX.4.53.0308201501210.6361@lxplus089.cern.ch>

On Wed, Aug 20, Dave Saville inscribed on the eternal scroll:

> Needing to remove line feeds, but actually having both CRLF & LF data I
> did some poking about.

You don't give the impression of having read perldoc perlport where
it explains this ticklish issue.  Please do so, it will save a lot of
pointless detail in discussion.

> 1) $lf is *always* equal to \n

Internally, this is correct on many platforms.  (exceptions would be
Mac and presumably ebdcdic and possibly VMS, I forget the details).

> 2) The \n in the print statements, checked with a hexdumper *always*
> writes CRLF

Only if you open the file in text mode.  If you use binmode then
the CR will not be added.

> 3) irrespective of the input data having crlf or lf it *always* says
> its LF

Again this is a difference between text mode and binary mode.

> I ran the same tests on Solaris
>
> 1) is still true
> 2) \n produces lf - as expected
> 3) It can see the difference between crlf data & lf data

Correct.  Text mode is specifically tuned to work with _native_
newline format in external files.  It's not meant to work with
cross-platform data.

> So whats wonky in the OS/2 port?

Nothing that you've reported.  It's working as documented.

> Further - on the web what would I get from $cgi->param if the browser
> sent a line feed? I am thinking a comments field on a form. Do they
> send platform specific line feeds?

That is a non-native data format.  See also the part of perlport where
it discusses "sockets" newline (CRLF) representation - it's analogous.

The interworking specifications rule that the newline representation
in that context must be precisely CRLF.  However, I wouldn't stake my
life on it: I would write my code to be tolerant of other
possibilities within reason.



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

Date: Wed, 20 Aug 2003 17:37:13 +0100 (BST)
From: "Dave Saville" <dave.nospam@ntlworld.com>
Subject: Re: OS/2 line feed question
Message-Id: <qnirfnivyyragyjbeyqpbz.hjxte15.pminews@text.news.ntlworld.com>

On Wed, 20 Aug 2003 15:09:01 +0200, Alan J. Flavell wrote:

>On Wed, Aug 20, Dave Saville inscribed on the eternal scroll:
>
>> Needing to remove line feeds, but actually having both CRLF & LF data I
>> did some poking about.
>
>You don't give the impression of having read perldoc perlport where
>it explains this ticklish issue.  Please do so, it will save a lot of
>pointless detail in discussion.
>

Two problems with that 1) you have to know there *is* such a document
and 2) The build from sources of 5.8.0 on OS/2 does not seem to
build/install perldoc and his dependencies. But I read it on solaris
now you have pointed it out - thank you.

>Correct.  Text mode is specifically tuned to work with _native_
>newline format in external files.  It's not meant to work with
>cross-platform data.

HmmHmmbut I still don't understand why OS/2 sees everything as LF in
text mode and Solaris can see the difference.

>The interworking specifications rule that the newline representation
>in that context must be precisely CRLF.  However, I wouldn't stake my
>life on it: I would write my code to be tolerant of other
>possibilities within reason.

Damn right - that was the point of the exercise :-)


Regards

Dave Saville

NB switch saville for nospam in address




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

Date: Wed, 20 Aug 2003 18:05:31 +0200
From: Matija Papec <mpapec@yahoo.com>
Subject: OT but hey
Message-Id: <5b67kv8mefiejcbqc9nv7bpi8f6fd6jcq5@4ax.com>

hudson <scripts_you_know_the_drill_@hudsonscripting.com> wrote:
>>to your home, visit your dog/gold fish, relatives and such :>)
>
>this isn't a public forum? go ahead and send to abuse@supernews.com
>that I was posting to a public forum....
>
>and all you perl hackers can have my dog/gold fish...send me your
>address and I will fedex them to you to do what you please....hehe
>
>(well, I don't have any dogs/gold fish, but I'm really not concerned)

Ok, then you don't mind Tad publishing your home address,


   8950 W Olympic Blvd #389
   Beverly Hills, California 90211


so everybody can stop by. You can even get yourself a resume homepage with
all details. :)



-- 
Matija


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

Date: Wed, 20 Aug 2003 09:57:20 -0700
From: JS Bangs <jaspax@u.washington.edu>
Subject: Re: Perl or PHP for web work ?
Message-Id: <Pine.A41.4.56.0308200950340.98770@dante50.u.washington.edu>

James sikyal:

> On Tue, 19 Aug 2003 15:40:54 -0500, Phil Roberts
> <philrob@HOLYflatnetSHIT.net> scrawled:
>
> >With total disregard for any kind of safety measures Bob
> ><none@spammenever.com > leapt forth and uttered:
> >
> >This topic is so old its practically fossilised.
> >
> >> Most of what i plan to do is fairly basic web work... dealing
> >> with data in an out of databases, simple business calculations,
> >> etc. Thoughts on which is a better course to pursue ?
> >>
> >
> >Use PHP. PHP was designed for the web and Perl, for all its
> >flexibility and power, was not.

I will second this. Perl is a far better *general* programming tool, but
PHP was born and raised on the web, and has the functionality to make most
web programming tasks earlier. I also finds its database functions a bit
more intuitive than DBI, though much more verbose.

> I use both Perl and PHP extensively for work and hobbies, there are
> certain things that PHP isn't quite there yet with - e.g. handling
> XHTML documents ( none of the standard PHP XML modules can cope
> with HTML's character entities ); handling POST requests (except with
> the massive overhead of cURL )... It's also an extremely verbose
> language in comparison to the beautiful compactness of Perl...

I think this can be construed as a feature by the PHP crowd. I love being
able to say @ary = grep foo($_) map $_ => bar($_) @_; in Perl, but that's
quite confusing to the non-hackers, and is a bit harder to maintain. PHP
will make you write that out more explicitly, to the chagrin of those of
us who value terseness, but the benefit of future programmers.


--
Jesse S. Bangs jaspax@u.washington.edu
http://students.washington.edu/jaspax/
http://students.washington.edu/jaspax/blog

Jesus asked them, "Who do you say that I am?"

And they answered, "You are the eschatological manifestation of the ground
of our being, the kerygma in which we find the ultimate meaning of our
interpersonal relationship."

And Jesus said, "What?"


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

Date: 20 Aug 2003 10:13:36 -0700
From: google.deller@smsail.com (Steve D)
Subject: Proper way to export structures from a module
Message-Id: <e41b2b3b.0308200913.ea84938@posting.google.com>

I had some problems properly exporting variables (actually complex
reference structures) from a module with initialization inside of a
BEGIN block.  By the time I arrived at a solution, I was no longer
sure it was the best, or even a "proper", solution.  The key point
seemed to be to use "our" for the items.

Any comments on the following code (two files) would be welcome:

============== Test.pl ==================
#! /bin/perl

use lib "." ;
use strict ;
use warnings ;
use Tm ;
use Tm qw( $MN) ;

push @$M, "2" ;
$$MN{one} = 30;
print "M: @$M, MN: $$MN{one}\n" ;

============== Tm.pm ====================
package Tm ;
use strict ;
use warnings ;
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION) ;
use Exporter ;

@ISA = qw( Exporter ) ;

@EXPORT = qw ( $M ) ;
@EXPORT_OK = qw ( $MN ) ;

our ( $M, $MN ) ;

BEGIN {
    $M = [ 3 ] ;
    $MN = { one => 20 } ;
}

print "M: @$M, MN: $$MN{one}\n" ;

1 ;
=========================================

regards,
Steve D


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

Date: Wed, 20 Aug 2003 18:19:33 +0200
From: Matija Papec <mpapec@yahoo.com>
Subject: Re: Regex - assign to new variable and replace in one line?
Message-Id: <5e77kvcr8fenug7gp74du7bjpuo3elt3ai@4ax.com>

X-Ftn-To: David K. Wall 

"David K. Wall" <usenet@dwall.fastmail.fm> wrote:
>>>$missionname =~ s/.mis//;
>> 
>> s/.mis// for $missionname = $check[1];
>
>I hadn't seen that before -- and now that I have, I think I'll try to forget 
>it.  :-)

There is always more ways to forget it. ;)

Using known idioms is IMO good thing and one should always try to stick to
them.



-- 
Matija


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

Date: 20 Aug 2003 10:32:06 -0700
From: jw1454@sbc.com (Brad Walton)
Subject: Re: Regex - assign to new variable and replace in one line?
Message-Id: <35c9b416.0308200932.2824328d@posting.google.com>

>     ($missionname = $check[1]) =~ s/\.mis//;

Thank you everyone for your help. Works great!

Brad


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

Date: Wed, 20 Aug 2003 08:35:25 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Regular expression, getting href which is followed by img tag with specific src
Message-Id: <slrnbk6u8t.73q.tadmc@magna.augustmail.com>

fatted <fatted@yahoo.com> wrote:

> From a html file, I'd like to extract a href value of an <a> tag which
> contains an <img> tag who's src value I'm searching on.


You should use a module that understands HTML for processing HTML data.


> Basically (but theres more!):
><a href="IwantThis.html"><img src="importantimage.gif"></a>
> 
> (Un)Interesting part:
> I first match a line 


"lines" do not matter in HTML.


> So the line 
     ^^^^^^^^

"the line" is singular, you didn't post 1 line, you posted 4 lines.


> actually looks something like this:
><a class="red" href="uninteresting.html" target="_new">Not so exciting
> text</a><a href="equallyboring.html" class = "blue">yawn</a><a
> class="green" href="IwantThis.html"><img border="0"
> src="importantimage.gif" alt="MeMe"></a>


If that _was_ really all on a single line, then it would still be
equivalent HTML, since most whitespace does not matter in HTML data.

   <br>
and
   <br         >
and
   <br
   >

Are all the same HTML data.


> open(FILE,"<","4body.html");


You should always, yes *always*, check the return value from open():

   open(FILE, '<', '4body.html') or die "could not open '4body.html' $!";


> while(<FILE>)
> {
>         my $line = $_;


If you want it in $line instead of $_ then you can put it 
in $line straightaway:

   while ( my $line = <FILE> )


This will NOT do what you asked, because it does not handle
arbitrary HTML, it handles only the one case that you have shown. 

It can be easily broken by legal HTML.

It would work correctly if I had used a module that understands
HTML data...


------------------------------------
#!/usr/bin/perl
use strict;
use warnings;

my $html = '
<a class="red" href="uninteresting.html" target="_new">Not so exciting
text</a><a href="equallyboring.html" class = "blue">yawn</a><a
class="green" href="IwantThis.html"><img border="0"
src="importantimage.gif" alt="MeMe"></a>';


while ( $html =~ m#(<a\s.*?</a>)#sg ) {
   my $anchor = $1;
   next unless $anchor =~ /src="importantimage\.gif"/;

   print "$1\n" if  $anchor =~ /href="([^"]*)/;
}
------------------------------------


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Wed, 20 Aug 2003 09:28:36 -0400
From: codyhess <member36366@dbforums.com>
Subject: Re: Regular expression, getting href which is followed by img tag with specific src
Message-Id: <3264640.1061386116@dbforums.com>


Your parenthesis are set to capture the first bit of ".+" in the scalar.
If you want the third link you should make your expression more
specific.  Instead of

if($line =~
/<a.+?href="(.+?)".+?src="importantimage\.gif".+?><\/a>/) try

if($line =~ /<a.+?href=".+?".+?href=".+".+href="(.+).+src="importantima-
ge\.gif".+?><\/a>/)



Why are you using .+? instead of .+

uh....?


--
print &quot;Aspiring to be just another perl hacker,&quot;


Posted via http://dbforums.com


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

Date: Wed, 20 Aug 2003 07:34:14 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Regular Expression
Message-Id: <slrnbk6qm6.73q.tadmc@magna.augustmail.com>

Frederik Aerts <aerts_frederik@hotmail.com> wrote:

> I want to do a find-replace method using VBScripts Regular Expressions. 


This is the Perl newsgroup, you get answers in Perl here.

If you want to use some other language, it is up to you to
translate the answers to that language.


> Here is what I want to do:
> replace a certain word in a string with another word, but the word can 
> NOT be within double quotes!


   s/("[^"]*")|(desktop)/ defined $1 ? $1 : 'laptop' /ge;


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Wed, 20 Aug 2003 08:04:24 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Replace words into a string with a space before or after
Message-Id: <slrnbk6seo.73q.tadmc@magna.augustmail.com>

Francesco Moi <francescomoi@europe.com> wrote:

> I'm trying to replace 
> 'select' to 'choose'.

> $mytext =~ s/select/choose/g;

> But sometimes, my string can content 'selected' and it's replace
> to 'choosed'.
> 
> I would like to replace only the words 'select ' 


So 'preselect ' should become 'prechoose ' ?


> or ' selected' 


And don't you want ' chosen' rather than ' choose' substituted for that one?


> Does anybody have any experience?


Use a "word boundary":

   $mytext =~ s/\bselect\b/choose/g;
   $mytext =~ s/\bselected\b/chosen/g;


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Wed, 20 Aug 2003 08:35:02 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Strange INC error when using perl 5.8.0 as a cgi script
Message-Id: <873cfwv4e1.fsf@limey.hpcc.uh.edu>

>> On 20 Aug 2003 05:53:25 -0700,
>> ts@relson.net (Tony) said:

> #!/usr/local/bin/perl
> use CGI qw(:standard); print header; print "<h1> Hello
> World<h1>\n";

> When I run it from a web browser I get the following in
> the apache error log and a "Internal Sever Error" error
> on the browser.

> Can't locate CGI.pm in @INC (@INC contains:
> /usr/local/lib/perl5/5.8.0/aix
> ...
> BEGIN failed--compilation aborted at test.cgi line 3.

> Now if I run it from a unix shell as ./test.cgi I get
> this

If it runs fine from the command line then the problem is
elsewhere.

Most likely it is in your web server configuration and/or
the restrictions of the uid as which CGI programs run
(e.g. nobody).  There are plenty of these groups under
comp.infosystems.www.* including one for apache.


hth
t


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

Date: Wed, 20 Aug 2003 09:56:27 -0400
From: Lou Moran <ellem52@mac.com>
Subject: Re: Strange INC error when using perl 5.8.0 as a cgi script
Message-Id: <nbv6kvgab0ga7i7kp6q95rt8rg1tr4o5f7@4ax.com>

On 20 Aug 2003 05:53:25 -0700, ts@relson.net (Tony) wrote wonderful
things about me:

>Hi All, 
>
>	I have just compiled perl 5.8.0 on aix 4.3.3. I got the stable.tar
>from cpan. It complied fine without any errors.  The trouble starts
>when I try to use it to write cgi scripts.

5.8.0 & 5.6.1 are not binary compatible.  This is known and
documented.  Google is you friend.  Go get new modules.

--
Mac OS X: Because it was easier to make UNIX user friendly than fix Windows.


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

Date: 20 Aug 2003 10:40:12 -0700
From: jw1454@sbc.com (Brad Walton)
Subject: Re: Tad/Randal Schwatz/Stonehenge Consulting...you all suck
Message-Id: <35c9b416.0308200940.72c7c72d@posting.google.com>

> Actually, I've written 176 articles at last count, all for magazines
> with 100K+ circulation.  That means my name has been in print as in
> "by Randal Schwartz" at least 18 million times.

Randal, I really enjoy the 2 Perl books I have, written by you. Keep
up the great work!

Sincerely,
Brad


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

Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: 
Message-Id: <3F18A600.3040306@rochester.rr.com>

Ron wrote:

> Tried this code get a server 500 error.
> 
> Anyone know what's wrong with it?
> 
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {

(---^


>     dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
 ...
> Ron

 ...
-- 
Bob Walton



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

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


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