[18876] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1044 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 2 18:05:56 2001

Date: Sat, 2 Jun 2001 15:05:12 -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: <991519512-v10-i1044@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 2 Jun 2001     Volume: 10 Number: 1044

Today's topics:
    Re: 1 milj passwords (Mark Jason Dominus)
        ANNOUNCE: Attribute::Handlers 0.70 (Damian Conway)
        ANNOUNCE: Text::Balanced 1.85 (Damian Conway)
    Re: Api function to call up an input box in Perl (Helgi Briem)
    Re: Can anyone find the problem with this script ?!?!?! (E.Chang)
    Re: Can anyone find the problem with this script ?!?!?! (E.Chang)
        Complex Parser... <joeb@jagas.demon.co.uk>
    Re: Complex Parser... (Eric Bohlman)
        Configuration of formmail perl script in a Linux enviro <iskm@yahoo.com>
    Re: date calc modules <chickenmilkbomb@hotmail.com>
    Re: date calc modules <chickenmilkbomb@hotmail.com>
    Re: from ASP to Perl <davidaslanian@hotmail.com>
    Re: from ASP to Perl <krahnj@acm.org>
        getpwnam - Unimplemeted Function <shmink@keysdigital.com>
    Re: HELP: modifying a referenced array from a library s <goldbb2@earthlink.net>
    Re: Installing CGI.PM with FTP client <flavell@mail.cern.ch>
    Re: Installing CGI.PM with FTP client <godzilla@stomp.stomp.tokyo>
    Re: IPC:Shareable vs mod_perl ipcs not dying <djberg96@hotmail.com>
    Re: Match Parsing Glitch <nospam@xx.com>
    Re: Match Parsing Glitch <nospam@xx.com>
    Re: Microsoft Access <kylekrom@bellatlantic.net>
    Re: module for MS SQL (Dave Bailey)
        Net::IRC::Connection and whois(), userhost() and who() <jaykay@rgh.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 02 Jun 2001 17:28:02 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: 1 milj passwords
Message-Id: <3b192210.7513$319@news.op.net>

In article <C5RR6.21775$zb7.2795352@news1.cableinet.net>,
Ciaran McCreesh <keesh@users.sf.net> wrote:
>while ((length keys %passwords) < 1000000) {

That will generate rather more than one million passwords.


-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: 2 Jun 2001 21:44:01 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: ANNOUNCE: Attribute::Handlers 0.70
Message-Id: <9fbmn1$k85$1@towncrier.cc.monash.edu.au>
Keywords: perl, module, release

==============================================================================
                Release of version 0.70 of Attribute::Handlers
==============================================================================


NAME
    Attribute::Handlers - Simpler definition of attribute handlers

DESCRIPTION
    This module, when inherited by a package, allows that package's class to
    define attribute handler subroutines for specific attributes. Variables
    and subroutines subsequently defined in that package, or in packages
    derived from that package may be given attributes with the same names as
    the attribute handler subroutines, which will then be called at the end
    of the compilation phase (i.e. in a `CHECK' block).

EXAMPLE

	package UNIVERSAL;
	use Attribute::Handlers;

	my %name;
	sub name { return $name{$_[2]}||*{$_[1]}{NAME} }

	sub Name    :ATTR { $name{$_[2]} = $_[4] }

	sub Purpose :ATTR { print STDERR "Purpose of ", &name, " is $_[4]\n" }

	sub Unit    :ATTR { print STDERR &name, " measured in $_[4]\n" }


	package main;

	my $capacity : Name(capacity)
		     : Purpose(to store max storage capacity for files)
		     : Unit(Gb);

	package Other;

	sub foo : Purpose(to foo all data before barring it) { }


AUTHOR
    Damian Conway (damian@conway.org)

COPYRIGHT
             Copyright (c) 2001, Damian Conway. All Rights Reserved.
           This module is free software. It may be used, redistributed
          and/or modified under the terms of the Perl Artistic License
                (see http://www.perl.com/perl/misc/Artistic.html)


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

CHANGES IN VERSION 0.70


	- Added __CALLER__ pseudo class for 'autotie'

	- Added multi-phasic attribute handlers (thanks Garrett)

	- Fixed nasty $SIG{__WARN__}-induced bug

	- Cached ref/symbol mapping for better performance and more
	  reliable symbol identification under evil typeglob manipulations

	- Added option to pass arguments when autotied classes are imported
	  (thanks Marcel)

	- Fixed bug in handling of lexical SCALAR refs

	- Cleaned up interactions with other class hierarchies
	  (due to being base class of UNIVERSAL)

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

AVAILABILITY

Attribute::Handlers has been uploaded to the CPAN
and is also available from:

	http://www.csse.monash.edu.au/~damian/CPAN/Attribute-Handlers.tar.gz

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


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

Date: 2 Jun 2001 21:47:51 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: ANNOUNCE: Text::Balanced 1.85
Message-Id: <9fbmu7$k7l$1@towncrier.cc.monash.edu.au>
Keywords: perl, module, release

==============================================================================
                  Release of version 1.85 of Text::Balanced
==============================================================================


NAME

    Text::Balanced - Extract delimited text sequences from strings.


SUMMARY (see Balanced.pod for full details)

    Text::Balanced::extract_delimited
    
        `extract_delimited' extracts the initial substring of a string
        which is delimited by a user-specified set of single-character
        delimiters, whilst ignoring any backslash-escaped delimiter
        characters.

    Text::Balanced::extract_bracketed
    
        `extract_bracketed' extracts a balanced-bracket-delimited substring
        (using any one (or more) of the user-specified delimiter brackets:
        '(..)', '{..}', '[..]', or '<..>').
    
    Text::Balanced::extract_quotelike
    
        `extract_quotelike' attempts to recognize and extract any one of the
        various Perl quote and quotelike operators (see "perlop(3)"). Embedded
        backslashed delimiters, nested bracket delimiters (for the
        quotelike operators), and trailing modifiers are all correctly handled.
    
    Text::Balanced::extract_codeblock
    
        `extract_codeblock' attempts to recognize and extract a
        balanced bracket-delimited substring which may also contain
        unbalanced brackets inside Perl quotes or quotelike
        operations. That is, `extract_codeblock' is like a combination
        of `extract_bracketed' and `extract_quotelike'.

    Text::Balanced::extract_tagged
    
        `extract_tagged' attempts to recognize and extract a
        substring between two arbitrary "tag" patterns (a start tag
	and an end tag).

    
INSTALLATION

    It's all pure Perl, so just put the .pm file in its appropriate
    local Perl subdirectory.


AUTHOR

    Damian Conway (damian@cs.monash.edu.au)


COPYRIGHT

       Copyright (c) 1997-2000, Damian Conway. All Rights Reserved.
     This module is free software. It may be used, redistributed
     and/or modified under the terms of the Perl Artistic License
          (see http://www.perl.com/perl/misc/Artistic.html)


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

CHANGES IN VERSION 1.85


	- Fixed bug in extract_variable recognizing method calls that
	  start with an underscore (thanks Jeff)


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

AVAILABILITY

Text::Balanced has been uploaded to the CPAN
and is also available from:

	http://www.csse.monash.edu.au/~damian/CPAN/Text-Balanced.tar.gz

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


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

Date: Sat, 02 Jun 2001 16:43:13 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: Api function to call up an input box in Perl
Message-Id: <3b19163c.287761389@news.isholf.is>

On Fri, 1 Jun 2001 13:57:01 +0100, "bernie" <b.duffy@mvt.ie>
wrote:

>I am wondering how to call an API function from Perl which will pop up an
>input box and the value returned
>to Perl.
>Thanks

Below is an example using Tk.  I hope this helps.

Regards,
Helgi Briem

#!/c:/Perl/bin/perl.exe -w

use strict;
use Tk;

my $input;

my $mw = MainWindow->new; 
$mw->title("Enter something here"); 
$mw->Label(
	-text => "\n\n Enter something) here: \n\n",
	-font =>"Arial 10 normal")->pack; 
	
my $enter_primer1  = $mw->Entry(
-textvariable => \$input
)->pack;


my $add_button    = $mw->Button(
	-text      =>'Ok',
	-width     => 10,
	-command   => [sub {&do_stuff_with_input($input); destroy
$mw;}],
)->pack;

my $cancel_button = $mw->Button(
	-text 	   =>'Cancel',
	-width     => 10,
	-command   => [sub {destroy $mw;}],
)->pack;

MainLoop; 

sub do_stuff_with_input
{
	my ($input) =@_;
	print "$input\n";
}



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

Date: Sat, 02 Jun 2001 17:51:16 GMT
From: echang@netstorm.net (E.Chang)
Subject: Re: Can anyone find the problem with this script ?!?!?!
Message-Id: <Xns90B48D6A6F45Dechangnetstormnet@207.106.92.86>

"SilverSting" <reply@group.thanx> wrote in
<9f9qnu$l0m$1@dns3.cae.ca>: 

>Here is my script, write form info to text file.  Can anyone help me
>with errors.
>
>#!/usr/bin/perl

 #!/usr/bin/perl -w
 use diagnostics;

Enabling warnings will help you discover problems, and diagnostics will 
explain the warnings in greater detail.

Also, read up on scoping variables using my() ("perldoc -f my" or 
http://www.perldoc.com/perl5.6/pod/func/my.html) and on using strict.

  use CGI qw(:standard);
  use CGI::Carp qw(fatalsToBrowser);

Looks (below) like you are trying to use the param() function from 
CGI.pm module.  You have to include that module first. And while 
debugging you'll want to be able see the error messages easily. 

># Get Form Info
>$firstname = param(fname);

[snip]

>> Open Text File
>open(CLIENTINFO,">>client.txt") or die "Can't open file $!" ; 
>
You should test to see if the open was successful or not. 

># Client Acceptance
>print "<center><strong>"
>print "Thank you for your request, you should hear from us with
>24-48 hours."
>print "</strong></center>"

 You're missing some semicolons here.

And follow the advice to look into http://learn.perl.org

-- 
EBC


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

Date: Sat, 02 Jun 2001 18:12:06 GMT
From: echang@netstorm.net (E.Chang)
Subject: Re: Can anyone find the problem with this script ?!?!?!
Message-Id: <Xns90B490F23F0FEechangnetstormnet@207.106.92.86>

echang@netstorm.net (E.Chang) wrote in 
<Xns90B48D6A6F45Dechangnetstormnet@207.106.92.86>:

Oops - one more:  You should quote the arguments in the param() calls - 
 For example, $firstname = param('fname');

-- 
EBC


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

Date: Sat, 02 Jun 2001 21:55:03 +0100
From: Joe B <joeb@jagas.demon.co.uk>
Subject: Complex Parser...
Message-Id: <3B1952A7.48FEA5A5@jagas.demon.co.uk>

Hello All,

I am trying to write a script that will take input from a web form and
parse
it, however I am having some difficulties. Any help will be appreciated:

The Output from the form posting will be like this:
(London OR South-West OR Midlands OR Telework) AND (Solaris OR Sun) AND
(awk
OR C OR DHCP OR Ethernet OR HP-UX OR HPUX OR JumpStart OR Korn OR Legato
OR
shellscript OR TCP OR UNIX) AND NOT (Permanent OR "1st Line" OR
Programmer
OR DBA OR "First Line" OR Helpdesk OR Junior OR Operator OR Tester OR
"Test
Analyst" OR "Test Engineer")

and I want it parsed to:

 select * from table WHERE MATCH col1
 AGAINST('(London South-West Midlands  Telework) +(Solaris Sun) +(awk
 C DHCP Ethernet HP-UX HPUX JumpStart Korn Legato
shellscript TCP UNIX) ~(Permanent "1st Line" Programmer
DBA "First Line" Helpdesk Junior Operator Tester "Test
Analyst" "Test Engineer")')
AND NOT col1 LIKE '%1st Line%'
AND col1 LIKE '"First Line"';




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

Date: 2 Jun 2001 21:41:12 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Complex Parser...
Message-Id: <9fbmho$pmi$4@bob.news.rcn.net>

Joe B <joeb@jagas.demon.co.uk> wrote:
> I am trying to write a script that will take input from a web form and
> parse
> it, however I am having some difficulties. Any help will be appreciated:

> The Output from the form posting will be like this:
> (London OR South-West OR Midlands OR Telework) AND (Solaris OR Sun) AND
> (awk
> OR C OR DHCP OR Ethernet OR HP-UX OR HPUX OR JumpStart OR Korn OR Legato
> OR
> shellscript OR TCP OR UNIX) AND NOT (Permanent OR "1st Line" OR
> Programmer
> OR DBA OR "First Line" OR Helpdesk OR Junior OR Operator OR Tester OR
> "Test
> Analyst" OR "Test Engineer")

> and I want it parsed to:

>  select * from table WHERE MATCH col1
>  AGAINST('(London South-West Midlands  Telework) +(Solaris Sun) +(awk
>  C DHCP Ethernet HP-UX HPUX JumpStart Korn Legato
> shellscript TCP UNIX) ~(Permanent "1st Line" Programmer
> DBA "First Line" Helpdesk Junior Operator Tester "Test
> Analyst" "Test Engineer")')
> AND NOT col1 LIKE '%1st Line%'
> AND col1 LIKE '"First Line"';

Text::Query and some of its relatives might help here; it includes 
routines for parsing Boolean queries of the sort that you describe, and 
Loic Dachary has written some SQL output routines for it.



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

Date: Sun, 3 Jun 2001 07:00:44 +1000
From: "Iskandar" <iskm@yahoo.com>
Subject: Configuration of formmail perl script in a Linux environment?
Message-Id: <9fbk3d$5am$1@perki.connect.com.au>

Hi.

I'm currently doing a simple form mail in Flash and I forgot that my uni
server is a Redhat Linux and I'm working on a Windows 2000 NT workstation.

I was wondering whether I need to change any configuration in my formmail
perl script that has to be in my cgi-bin.  Any inputs of help will be
sweeeeeeeeet.

============
Isk.
High in phat,
low in moral fibre.




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

Date: Sat, 02 Jun 2001 22:00:01 GMT
From: "Rob Parker" <chickenmilkbomb@hotmail.com>
Subject: Re: date calc modules
Message-Id: <20010602.150042.165344818.279@marley.wntck1.sfba.home.com>

That is exactly what I am looking for. Thanks!

> Perhaps the Date::Business module is what you need?
> 
> http://search.cpan.org/search?dist=Date-Business
>


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

Date: Sat, 02 Jun 2001 22:02:00 GMT
From: "Rob Parker" <chickenmilkbomb@hotmail.com>
Subject: Re: date calc modules
Message-Id: <20010602.150244.434248626.279@marley.wntck1.sfba.home.com>

Thanks for taking the time to set me straight...


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

Date: Sat, 02 Jun 2001 18:30:04 -0000
From: David Aslanian <davidaslanian@hotmail.com>
Subject: Re: from ASP to Perl
Message-Id: <thic5ct7g6k367@corp.supernews.com>


bc wrote:
> 
> 
> i use mandrake (and/or) redhat, i also use ASP/VBScript with my windows 
box,
> i want to change to Perl on my linux box, but i do not know how to 
install
> it 
(I assume your talking about installing perl)
> and or get to the point of coding it in a text editor?  where or how,
> any advice anyone, i'de appreciate it, lots!  :)
1. go to http://aspn.activestate.com/ASPN/Downloads/ActivePerl/ and 
download perl for linux, and follow instructions to install it
2. LEARN PERL! I would consider buying the Llama book from O'Reilly 
(learning perl). The book starts from the beginning and gets you going.



--
Posted via CNET Help.com
http://www.help.com/


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

Date: Sat, 02 Jun 2001 21:16:38 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: from ASP to Perl
Message-Id: <3B1957DA.5EA0C4E7@acm.org>

bc wrote:
> 
> i use mandrake (and/or) redhat, i also use ASP/VBScript with my windows box,
> i want to change to Perl on my linux box, but i do not know how to install
> it and or get to the point of coding it in a text editor?  where or how,
> any advice anyone, i'de appreciate it, lots!  :)

If you have Linux you probably already have Perl installed. Type "which
perl" (without quotes) at the shell prompt and if Perl is installed it
will display its location e.g.
$ which perl
/usr/bin/perl

If it isn't installed it should be on the cd-rom that you installed
Linux from. If it's not on the cd-rom then you can get it from
http://www.cpan.org



John
-- 
use Perl;
program
fulfillment


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

Date: Sat, 2 Jun 2001 11:06:12 -0400
From: "KeysDigital" <shmink@keysdigital.com>
Subject: getpwnam - Unimplemeted Function
Message-Id: <9favas019hi@enews3.newsguy.com>

Hello Group:

I'm trying to get a script running on an NT maching running IIS and Perl
5.6. The code I'm having a problem with is as follows:

sub CheckLogin {
   if (kDebugLevel >= kShowSubroutines) { print STDERR "CheckLogin - \n"; }
   (my $name, my $passwd) = getpwnam($userlogin);
   if ($passwd ne "") {
 if (crypt(&Obscure($userpassword), kEncryptedPassword) eq
kEncryptedPassword) {
           $cgi->delete("userlogin");
           $cgi->delete("userpassword");
     return 1;
 }
    }
   $cgi->delete_all();
    return 0;
 }

When I call the program, I get an error message saying that "The getpwanm
function is unimplemented at XXXXXXX  line 382".

Folks, I'm stumped. If I try "use User::pwent" I get the same message
(different file and line #).

Any suggestions or fixes would be appreciated.

Mike Hagstrom








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

Date: Sat, 02 Jun 2001 17:40:56 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: HELP: modifying a referenced array from a library subroutine...
Message-Id: <3B195D68.669446D6@earthlink.net>

Anno Siegel wrote:
> 
> According to Bruno Boettcher <bboett@erm1.u-strasbg.fr>:
> > hello!
> >
> > again i have some trouble....
> > from the readings i thought that by passing vaules by reference it
> > allowed me to modify the real values in subroutines, but seems as if i
> > understood it badly another time :D
> >
> > suppose i have a main script where i defined an array:
> >
> > my @operators = ();
> >
> > the ref to the array is put inside a hash:
> > $sysressource{"operators"} = \@operators;
> >
> > this thing is now passed to an anon sub defined in a separately compiled
> > lib file (linked with 'do') and which has thus no global ref on
> > @operators...  :
> >
> > &{$owneractions->{$commandtag}}( \%sysressource,$sLine,$restofline );
> >
> >
> > in the sub i retrieve a pointer to the array:
> > my @operators = @{$sysressource ->{"operators"}};
> 
> Here is where it happens.  This statement places a copy of the array
> referenced by $sysressource ->{operators} in @operators.
> 
> > then i modify this array, e.g.:
> > push  @operators,$newuser;
> 
> This pushes $newuser on the copy, not the original array, which
> is unchanged.  Do
> 
>     push @{$sysressource ->{operators}}, $newuser;
> 
> and you will find $newuser where you expect to find it.
> 
> [...]
> 
> Anno

Considering that lines of code can get long and unpretty if you do this,
you might want to make an alias for it... for example

	local *the_operators = $sysressource->{operators};
	push @the_operators, $newuser;

This can result in much clearer code than explicit dereferencing.

-- 
The longer a man is wrong, the surer he is that he's right.


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

Date: Sat, 2 Jun 2001 19:57:14 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Installing CGI.PM with FTP client
Message-Id: <Pine.LNX.4.30.0106021930230.28340-100000@lxplus003.cern.ch>


while tidying my scorefile, I stumbled on this:

On Fri, 1 Jun 2001, Godzilla! wrote:

> Here is a thought for you. You don't need Stein's CGI.pm module.

It's factually true, you don't _need_ it: the reason for recommending
it is a different one.

> In almost all cases, you can write
> your own code which is very short, very quick and...

 ...probably at least as insecure as any written by Matt.

And if my experience is anything to go by, that "quick hack" will turn
into a long-term kludge, which will acquire features one by one, and
end up as a maintenance nightmare.  When bugs are discovered, and
fixed in whatever module(s) one should have been using, it won't just
be a matter of plugging-in a new version of the module; it'll be a
matter of a complete code-review to see where the weaknesses might
lie.

> runs program circles around Stein's module,

I'll leave that uninterpreted...

> without all the problems.

If you knew of any problems, it would surely be your moral duty to
report them to the author?

> How do you suppose real programmers coded for many
> years before CGI.pm came along

I'm well aware of how "real programmers" coded, having met my first
computer in 1958, years before I even knew what a compiler was.

> and became a highly worshipped Cargo Cult icon?

Those who are competent to not use CGI.pm seem to fall into two
classes: those who know why they don't use it, and those who choose to
use it anyway.  Both have reasonable arguments going _for them_.  But...

But to those who need to seek help here, there seems to me to be
only one answer, as long as they're aiming to create production code:
use the peer-reviewed modules, they encapsulate the best ideas and
practice of serious Perl programmers.  CGI.pm isn't the only module
which addresses this area, but it can tackle pretty much any task, and
thus seems to be the recommendation of choice.

Sure, if they want to know how things work, at the nuts and bolts
level, then it's just fine for them to play with the low level
components, nothing wrong with that.  Write machine-code, if they
really want to.  They should just understand that they're unlikely to
be producing production-quality software with that approach.

L.Stein is also the author of a reputed FAQ on web security.  He knows
of what he speaks.  Just once or twice I've caught him out in a small
error - but not nearly as often as I've caught myself out in a bigger
one, in spite of knowing how to read the RFCs and how to write
programs.  This is no blind religious fervour as you would want to
characterise it: I simply know from experience that it makes good
business sense to use the peer-reviewed modules, and particularly
where CGI is at stake.

Keep in mind that a CGI script is in effect an extension to a web
server.  That carries definite responsibilities towards other users
of the 'net, to keep your systems safe from being exploited as a
platform from which to attack others.

OK, I'm back to the scorefile tidying.



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

Date: Sat, 02 Jun 2001 14:37:13 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Installing CGI.PM with FTP client
Message-Id: <3B195C89.5008E87E@stomp.stomp.tokyo>

"Alan J. Flavell" wrote:
 
> while tidying my scorefile, I stumbled on this:

I glanced in a mirror and discovered 
I am Aphrodite Pandemos!

 
> On Fri, 1 Jun 2001, Godzilla! wrote:
 
> > Here is a thought for you. You don't need Stein's CGI.pm module.
 
> It's factually true, you don't _need_ it: the reason for recommending
> it is a different one.

Huh? A different one what? To what are making
a comparsion? 

You are saying, paraphrased, "The reason for recommending
it is different than saying you don't need it."

Yeah, sure, ok!!

 
> > In almost all cases, you can write
> > your own code which is very short, very quick and...
 
> ...probably at least as insecure as any written by Matt.

You have no valid premise for this statement. You are saying,
paraphrased, "No matter how skilled, a programmer will always
write bad code in place of Stein's module."

Whew... 

 
> And if my experience is anything to go by, that "quick hack" will turn
> into a long-term kludge, which will acquire features one by one, and
> end up as a maintenance nightmare.

My presumption is you lack any meaningful experiences
using Perl. My experiences have taught me how to write
code which is significantly superior to CGI.pm. However,
I will acknowledge Perl 5 Cargo Cultists like yourself,
do lack in true programming experience. I suppose it is
unfair to fault you and others for your shortcomings.


> > runs program circles around Stein's module,
 
> I'll leave that uninterpreted...

Of course. I have posted ample comparative codes
over time showing true programming is quicker and
more efficient than use of this module. Nonetheless,
I wouldn't want to confuse you with facts with your
mind already being lost to Perl 5 Cargo Cultism.

 
> > without all the problems.
 
> If you knew of any problems, it would surely be your moral duty to
> report them to the author?

Moral duty? Gosh, you truly are a preacher. This Perl 5 Cargo Cult
thing runs deeper than I thought!

Obviously you are not familiar with the long and extensive
revision history of CGI.pm over time to correct problems.

* wonders why so many articles pertain to problems with CGI.pm *

 
> > How do you suppose real programmers coded for many
> > years before CGI.pm came along
 
> I'm well aware of how "real programmers" coded, having met my first
> computer in 1958, years before I even knew what a compiler was.

My goodness, you are much older than I thought! You must in your
late sixties to early seventies. A seasoned senior citizen!

Your vacuum tube still work?

 
> > and became a highly worshipped Cargo Cult icon?
 
> Those who are competent to not use CGI.pm seem to fall into two
> classes: those who know why they don't use it, and those who choose to
> use it anyway.  Both have reasonable arguments going _for them_.  But...

No! No!

Those who know how to program and,
those who are copy and paste babies!

 
> But to those who need to seek help here, there seems to me to be
> only one answer, as long as they're aiming to create production code:
> use the peer-reviewed modules, they encapsulate the best ideas and
> practice of serious Perl programmers.  CGI.pm isn't the only module
> which addresses this area, but it can tackle pretty much any task, and
> thus seems to be the recommendation of choice.

It is indeed a very popular module! Just think about how many
articles are posted here and elsewhere asking how to make
CGI.pm work right! Very popular, yes.

 
> Sure, if they want to know how things work, at the nuts and bolts
> level, then it's just fine for them to play with the low level
> components, nothing wrong with that.

Ahh... you are saying, paraphrased,

"Those who write programs without modules are not skilled
enough to write anything beyond low level programming."

How insulting!


> Write machine-code, if they really want to.  They should 
> just  understand that they're unlikely to be producing 
> production-quality software with that approach.

Production quality software is well known for being buggy
and problem ridden. Production quality is another way of
saying, "Knock off crap." 

 
> L.Stein is also the author of a reputed FAQ on web security.  He knows
> of what he speaks.  Just once or twice I've caught him out in a small
> error - but not nearly as often as I've caught myself out in a bigger
> one, in spite of knowing how to read the RFCs and how to write
> programs.  This is no blind religious fervour as you would want to
> characterise it: I simply know from experience that it makes good
> business sense to use the peer-reviewed modules, and particularly
> where CGI is at stake.

This is somehow related to learning how to program rather
than producing cheap quality modular production code?

I would think Stein knows a bit about security considering
how many times he has patched CGI.pm to plug security holes!
A module with a long history of security problems is surely
ideal for commercial production, uh huh.

 
> Keep in mind that a CGI script is in effect an extension to a web
> server.  That carries definite responsibilities towards other users
> of the 'net, to keep your systems safe from being exploited as a
> platform from which to attack others.

Yep. This is why I never use CGI.pm in my scripts. My preference
is to write scripts which I know to be significantly secure, above
and beyond any security offered by this module.

 
> OK, I'm back to the scorefile tidying.

I am back to admiring moi, Aphrodite Pandemos, in my mirror!


Jeesshh... you would think these boys would tire of forever
chanting Perl 5 Cargo Cult incantations. 


Godzilla!


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

Date: Sat, 02 Jun 2001 20:09:14 GMT
From: "Daniel Berger" <djberg96@hotmail.com>
Subject: Re: IPC:Shareable vs mod_perl ipcs not dying
Message-Id: <KJbS6.41168$V6.2094645@typhoon.mn.mediaone.net>

> >Sorry if this is a re-post.  Doesn't look like my first post showed up.
>
> >Anyway, at the end of your program (probably within an END block), do
> >IPC::Shareable->clean_up().
> Would that destroy all or just the possibly temporary assigned additional
> space? The server should keep running and should keep the rest of the
array.
>
> Konstantin

From the IPC::Shareable docs---

"This is a class method that provokes IPC::Shareable to remove all shared
memory segments created by the process. Segments not created by the calling
process are not removed."

I'm not sure if that answers your question or not.  For more info, see
http://search.cpan.org/doc/BSUGARS/IPC-Shareable-0.60/lib/IPC/Shareable.pm.
Also note that the "clean_up()" method occasionally fails for me - about 1
in 20 times.  I realized this when I stored a sql query result in shared
memory, changed the query completely, and got the old result back when I ran
the new query.  That was partly my fault - I should have used "$$" as the
key to keep it unique each time I ran the program, just to make sure (ok -
it's *possible* that I could end up using the same pid again, but at least
I'm significantly reducing the odds).

"clean_up_all()" has never worked for me and is broken as far as I can tell.

If you use the same key for each shared memory segment in your array, then I
think "clean_up" will wipe out everything.  You'll have to make each key
unique somehow, perhaps with $$.

I've only tinkered with this a little myself so I can't be of much more use.
Sorry.

Regards,

Dan




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

Date: Sat, 02 Jun 2001 14:04:35 -0700
From: Eric <nospam@xx.com>
Subject: Re: Match Parsing Glitch
Message-Id: <3B1954E3.4E58F8A9@xx.com>

Abe Timmerman wrote:
> In general (and please don't take this the wrong way), I get the feeling
> you are trying to run before you can walk. You just made two big changes
> to code that didn't run to begin with. Try to make it run first, then
> extend to your needs step by step.

I think trying to "panic jog" is a better description :-)  Thank you so
much, Abe, for your insightful and helpful assistance.  I need to start
sleeping with the documentation.  I relate better to instructional
videos and graphical presentations, however.  Maybe someone will come
out with a Perl "Instructional CD-ROM".

Eric


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

Date: Sat, 02 Jun 2001 14:08:57 -0700
From: Eric <nospam@xx.com>
Subject: Re: Match Parsing Glitch
Message-Id: <3B1955E9.23AA97E5@xx.com>

Abigail wrote:
> 
> It's likely to be either a user error, or a broken installation.
> Which, since windows tends to be single-user, is a user error as well.
> 
Tnx, Abigal.  With my luck, probably both :0)

RE: ??  

>Do you always use filenames whose final character is a newline?

Umh, I don't think so.

>(And why quote $filename?)

That's a very good question indeed for which I have no answer...except
that I really don't need the quotes.  Duh on me.


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

Date: Sat, 02 Jun 2001 16:06:04 GMT
From: Kyle Krom <kylekrom@bellatlantic.net>
Subject: Re: Microsoft Access
Message-Id: <3B190CDA.78E16447@bellatlantic.net>



"Michael R. McPherson" wrote:

> I need to query a Microsloth Access database on another server from
> Linux/perl.
>
> I am running smp redhat 6.2 kernel2.2.14-5.1 with perl 5.6
>
> I have DBI installed.
>
> Now what I am looking for is what modules I would need to connect and some
> SIMPLE STRAIGHTFORWARD THIS IS HOW YOU DO IT kind of documentation on
> DBD::ODBC with Microsloth Access.

There is a FAQ on this subject at
http://tlowery.hypermart.net/perl_dbi_dbd_faq.html

Hope that helps.

buckaduck




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

Date: 02 Jun 2001 20:57:41 GMT
From: dave@sydney.daveb.net (Dave Bailey)
Subject: Re: module for MS SQL
Message-Id: <slrn9hiakb.vdf.dave@sydney.daveb.net>

On Sat, 2 Jun 2001 13:25:24 +0000 (UTC), Abigail <abigail@foad.org> wrote:
>rich (nospam@newsranger.com) wrote on MMDCCCXXXI September MCMXCIII in
><URL:news:PQIR6.241$v4.3542@www.newsranger.com>:
>^^  
>^^  Hi,
>^^  I usually use the MySQL database along with the module, DBI::MYSQL. 
>^^  For one reason or another I have to use Microsofts SQL server now. 
>^^  Could anybody recommend the best module for connecting to this 
>^^  database?
[...]
>I've never used MS SQL server, but I've used Sybase a lot. And since MS SQL
>branched off Sybase, you should be able to connect to MS SQL using the
>Sybase Client libraries (althought I guess, MS being MS, at one point, this
>will no longer be possible). I've always used Sybase::DBlib to connect to
>Sybase servers, without much problems.

If that doesn't work with SQL Server, you [rich] can always use 
DBD::ODBC after setting up the OpenLink's ODBC client library.  Go 
to www.openlinksw.com, click "Software Availability and Download", 
then go to "Multi Tier Download" (by server operating system), and 
get the driver they provide for a Windows server *and* client OS (the
SQL Server one is named "ntadmzzz.zip").  It is an ODBC proxy agent
which lets you map an ODBC DSN to an SQL Server database so you can
use DBD::ODBC to connect to the proxy agent on NT, or, even more 
annoying, you can set up a DBI::Proxy which uses DBD::ODBC on the NT
machine, and connect to that from wherever you want.  

--
Dave Bailey
davidb54@yahoo.com


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

Date: Sat, 2 Jun 2001 19:55:47 +0100
From: "Jeekay" <jaykay@rgh.org>
Subject: Net::IRC::Connection and whois(), userhost() and who()
Message-Id: <9fbcri$100$1@newsg2.svr.pol.co.uk>

Am writing a small script that connects to an IRC server and generally just
makes itself useful.
However, on receiving a mode change notification, I only have the nickname
of the person who's mode has just changed. I need to find the full
userhost() from this, for verification at a later stage.

However, whenever I call $conn->(whois|userhost|who)($nick) all I get back
is a number, usually 12, 14 or 27.
Ive tried parsing it as an array instead of a string and it made no
difference....
I have the same problem with $conn->topic($chan) too - it returns a number,
not a string.

Any ideas how to get some kind of sensible answer out of it instead of a
number?

Thanks in advance,
GK





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

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


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