[16354] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3766 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 21 09:05:28 2000

Date: Fri, 21 Jul 2000 06:05:15 -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: <964184715-v9-i3766@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 21 Jul 2000     Volume: 9 Number: 3766

Today's topics:
    Re: [NEWBI] Reg Exp request for help <iltzu@sci.invalid>
    Re: ahhh cgi script - help <Joe.Rocklin@sdrc.com>
    Re: ahhh cgi script - help <Joe.Rocklin@sdrc.com>
    Re: ATTENTION PERL MEATHEADS (Anno Siegel)
    Re: Authenticating on NT Domains <dfog@home.com>
    Re: Check string for a certain format <bart.lateur@skynet.be>
    Re: Check string for a certain format (Anno Siegel)
    Re: Check string for a certain format <bart.lateur@skynet.be>
    Re: cperl-mode.el (Kai =?iso-8859-1?q?Gro=DFjohann?=)
    Re: Do I have this right, now? Please Help! <bart.lateur@skynet.be>
    Re: Do I have this right, now? Please Help! (Anno Siegel)
        emulating (Pinchao Lu)
        emulating (Pinchao Lu)
    Re: File Token nobull@mail.com
    Re: Forking children <bart.lateur@skynet.be>
        help perl/dgi pepebordoy@my-deja.com
    Re: How to delete a record in a text data file? <snakeman@kc.rr.com>
        How to disconnect from databases when mod_perl scripts  <kabir@nitec.com>
    Re: Is this a known Perl 5 bug? nobull@mail.com
    Re: Just to get perl up and running... <bart.lateur@skynet.be>
    Re: Matts Script Archive - A critique <carvdawg@patriot.net>
    Re: Matts Script Archive - A critique <ralawrence@my-deja.com>
    Re: MySQL and Perl problems <cal@iamcal.com>
    Re: Net::FTP module to delete files (Pythagoras Watson)
        Net::FTP on OS/390 USS <graham.wood@iona.com>
        Newbie: What's wrong with my code? <eric.selin@pp.inet.fi>
    Re: Newbie: What's wrong with my code? <jeffp@crusoe.net>
    Re: Newbie: What's wrong with my code? (Bernard El-Hagin)
    Re: Perl newbie requests help with CGI/Perl nobull@mail.com
        Q : How to mimic awk's "in" operator <gregory.deal@unisys.com>
    Re: s/compiled\s+Win32::OLE\s+and\s+Win32::ADO/$net/g   <carvdawg@patriot.net>
        Sending mail using sockets <are.bjoerby@pineapple.no>
        webbased file upload via perl <nospam_antoine@nospam_natuur.org>
    Re: webbased file upload via perl <nospam@firemail.de>
        word maker with perl <qvyht@iobox.fi>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 21 Jul 2000 13:03:26 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: [NEWBI] Reg Exp request for help
Message-Id: <964184473.17775@itz.pp.sci.fi>

In article <cqSd5.1447$k54.25561@news6-win.server.ntlworld.com>, Cal Henderson wrote:
>
>$string =~ s/\b(.*?)\b/\L\u$1/g;
>
>No need for 2 groupings, although your method is strangely faster:
>
>Benchmark: timing 100000 iterations of One, Two...
>  One:  4 wallclock secs ( 3.79 usr +  0.00 sys =  3.79 CPU) @ 26420.08/s
>  Two:  3 wallclock secs ( 3.12 usr +  0.00 sys =  3.12 CPU) @ 32102.73/s

That's because you're wasting time matching empty strings:

  #!/usr/bin/perl -w
  use strict;
  use Benchmark;

  use vars qw($name);
  $name = "erik ILMARI karonen";

  timethese 1<<(shift||0),
    { '(.)(.*?)' => '(my $string = $name) =~ s/\b(.)(.*?)\b/\u$1\L$2/g;',
      '(.+?)'    => '(my $string = $name) =~ s/\b(.+?)\b/\u\L$1/g;',
      '(.*?)'    => '(my $string = $name) =~ s/\b(.*?)\b/\u\L$1/g;',
      '(\w+)'    => '(my $string = $name) =~ s/(\w+)/\u\L$1/g;',
    };

  __END__

  Benchmark: timing 65536 iterations of (.)(.*?), (.*?), (.+?), (\w+)...
    (.)(.*?):  4 wallclock secs ( 3.52 usr +  0.00 sys =  3.52 CPU)
       (.*?):  5 wallclock secs ( 4.73 usr +  0.00 sys =  4.73 CPU)
       (.+?):  3 wallclock secs ( 2.81 usr +  0.00 sys =  2.81 CPU)
       (\w+):  2 wallclock secs ( 1.67 usr +  0.00 sys =  1.67 CPU)

  This is perl, version 5.005_03 built for i386-linux

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The screwdriver *is* the portable method."  -- Abigail
Please ignore Godzilla and its pseudonyms - do not feed the troll.



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

Date: Fri, 21 Jul 2000 08:10:53 -0400
From: Joe Rocklin <Joe.Rocklin@sdrc.com>
Subject: Re: ahhh cgi script - help
Message-Id: <39783DCC.96FCD23D@sdrc.com>

This is a multi-part message in MIME format.
--------------FBF4F240F43D833C0CAD5884
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

If the web server is on a unix system, using sendmail is pretty straight
foreword.  Just get all the variables back, and then using sendmail, print
everything to an email message.

open (MAIL, "| /usr/lib/sendmail -t -oi" ) || die "Cannot open mail: $!";

print MAIL <<"EOM";
From: $from_name
To: $to_name
Cc:
Bcc:
Subject: $subject

####    Insert Message Here    ####

EOM

Look at the man page for sendmail if you're not familiar with it's use.
Hope this helps...

--Joe

pepebordoy@my-deja.com wrote:

> hi,
> i am looking for the cgi/perl coding that allows me to send a form from
> a html page, thus sending it to my email address.
>
> If anybody could help me then it would be great.
> Just one more thing, i need to know how to adapt it for myself.
>
> thanks
> brian
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

--
------------------------------------------------------------------------------
Joe Rocklin             joe.rocklin@sdrc.com
"The whole of science is nothing more than a refinement of everyday thinking."
        -- Albert Einstein, Physics and Reality [1936]:



--------------FBF4F240F43D833C0CAD5884
Content-Type: text/x-vcard; charset=us-ascii;
 name="Joe.Rocklin.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Joe Rocklin
Content-Disposition: attachment;
 filename="Joe.Rocklin.vcf"

begin:vcard 
n:Rocklin;Joe
tel;work:513-576-7614
x-mozilla-html:TRUE
org:SDRC
adr:;;;Milford;OH;45150;USA
version:2.1
email;internet:Joe.Rocklin@sdrc.com
x-mozilla-cpt:;-27392
fn:Joe Rocklin
end:vcard

--------------FBF4F240F43D833C0CAD5884--



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

Date: Fri, 21 Jul 2000 08:19:38 -0400
From: Joe Rocklin <Joe.Rocklin@sdrc.com>
Subject: Re: ahhh cgi script - help
Message-Id: <39783FDA.F107CBF8@sdrc.com>

This is a multi-part message in MIME format.
--------------9DFCC5DA2DD1DD94B830D4F1
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Don't forget the close command, as I did...

--Joe

Joe Rocklin wrote:

> If the web server is on a unix system, using sendmail is pretty straight
> foreword.  Just get all the variables back, and then using sendmail, print
> everything to an email message.
>
> open (MAIL, "| /usr/lib/sendmail -t -oi" ) || die "Cannot open mail: $!";
>
> print MAIL <<"EOM";
> From: $from_name
> To: $to_name
> Cc:
> Bcc:
> Subject: $subject
>
> ####    Insert Message Here    ####
>
> EOM
>
> Look at the man page for sendmail if you're not familiar with it's use.
> Hope this helps...
>
> --Joe
>
> pepebordoy@my-deja.com wrote:
>
> > hi,
> > i am looking for the cgi/perl coding that allows me to send a form from
> > a html page, thus sending it to my email address.
> >
> > If anybody could help me then it would be great.
> > Just one more thing, i need to know how to adapt it for myself.
> >
> > thanks
> > brian
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
> --
> ------------------------------------------------------------------------------
> Joe Rocklin             joe.rocklin@sdrc.com
> "The whole of science is nothing more than a refinement of everyday thinking."
>         -- Albert Einstein, Physics and Reality [1936]:

--
------------------------------------------------------------------------------
Joe Rocklin             joe.rocklin@sdrc.com
"The whole of science is nothing more than a refinement of everyday thinking."
        -- Albert Einstein, Physics and Reality [1936]:



--------------9DFCC5DA2DD1DD94B830D4F1
Content-Type: text/x-vcard; charset=us-ascii;
 name="Joe.Rocklin.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Joe Rocklin
Content-Disposition: attachment;
 filename="Joe.Rocklin.vcf"

begin:vcard 
n:Rocklin;Joe
tel;work:513-576-7614
x-mozilla-html:TRUE
org:SDRC
adr:;;;Milford;OH;45150;USA
version:2.1
email;internet:Joe.Rocklin@sdrc.com
x-mozilla-cpt:;-27392
fn:Joe Rocklin
end:vcard

--------------9DFCC5DA2DD1DD94B830D4F1--



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

Date: 21 Jul 2000 12:16:58 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: ATTENTION PERL MEATHEADS
Message-Id: <8l9evq$oqm$1@lublin.zrz.tu-berlin.de>

Cal Henderson <cal@iamcal.com> wrote in comp.lang.perl.misc:
>"Gwyn Judd" <tjla@guvfybir.qlaqaf.bet> wrote...
>
>: >--
>: >use LWP::Simple;
>:
>: print "Content-Type: text\plain\n\n";
>:
>: >$g = get
>: >("http://3483852801/%7e%63%61ll%67i%72l/%76i%64%65%67%6f%64z%2e%68%74%6dl");
>: >$g =~ s/(<([^>]+)>)|\n|GODZILLA|Blue Oyster Cult//g; $g =~
>: >s/([a-z])([A-Z])/$1\n$2/g;
>: >$g =~ s/(He )/S\l$1/g; $g =~ s/H(e')/Sh$1/; print ${\substr ($g, 9, 429)};
>exit;
>:
>: Hope that helped.
>
>At a guess, i'd say you don't need a content-type header in every perl script,
>but hey.

Why would you?  Perl isn't cgi and cgi isn't Perl.

Anno


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

Date: Fri, 21 Jul 2000 08:13:34 -0400
From: Dave Fogelson <dfog@home.com>
Subject: Re: Authenticating on NT Domains
Message-Id: <dhfgns0vds5s3m5sipu1bd0n9nc3n7mo3b@4ax.com>

Yes, it was.   That was a typo in my post, but I do have
 use Win32::AuthenticateUser;
in the actual scrpt.



On Fri, 21 Jul 2000 02:55:41 GMT, perl@imchat.com (Mark P.) wrote:

>On Thu, 20 Jul 2000 17:44:46 -0400, Dave Fogelson <dfog@home.com>
>wrote:
>
>
>>use AuthenticateUser;
>>AuthenticateUser("Domain", "User", "Password");
>>
>
>	Shouldn't that be 
>use Win32::AuthenticateUser; # ????
>
>
>MP



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

Date: Fri, 21 Jul 2000 11:04:47 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Check string for a certain format
Message-Id: <1fbgns0q33qqcs2hhsi87j7j0o4dqfi47k@4ax.com>

Colin Larcombe wrote:

>I need to check a string for the format XX9999999999. I was going to check
>that the 1st char was alpha the 3rd was numeric and the length was 12.
>
>1. How can I check that the 1st char is alpha and the 3rd is numeric ?
>2. Any other suggestions for a better test gratefully received.

Forget about substr. Regexes are the way to do this!

	/^[a-zA-Z]{2}\d{10}$/

Well... I assume that the "X" represents a letter, and "93 a digit.

-- 
	Bart.


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

Date: 21 Jul 2000 11:15:15 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Check string for a certain format
Message-Id: <8l9bc3$onq$1@lublin.zrz.tu-berlin.de>

Bart Lateur  <bart.lateur@skynet.be> wrote in comp.lang.perl.misc:

>Well... I assume that the "X" represents a letter, and "93 a digit.

Cobol.  Remember Cobol?

Anno
-- 
"Its not bad design, its a cgi script!"


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

Date: Fri, 21 Jul 2000 11:43:34 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Check string for a certain format
Message-Id: <endgns46vn7glb4f1aho57a73n0n0d60pe@4ax.com>

Drew Simonis wrote:

>From perlre:
>
>    *?     Match 0 or more times
>    +?     Match 1 or more times
>    ??     Match 0 or 1 time
>    {n}?   Match exactly n times 
>    {n,}?  Match at least n times
>    {n,m}? Match at least n but not more than m times

Scroll a bit back up:

        {n}    Match exactly n times
        {n,}   Match at least n times
        {n,m}  Match at least n but not more than m times

Now, greediness in conjunction with  matching an exact number of times,
"{n}?", is nonsense. For the two others, it makes sense.

-- 
	Bart.


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

Date: 21 Jul 2000 12:20:26 GMT
From: Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai =?iso-8859-1?q?Gro=DFjohann?=)
Subject: Re: cperl-mode.el
Message-Id: <vafaefbk73r.fsf@lucy.cs.uni-dortmund.de>

On Thu, 20 Jul 2000, Sam Lay wrote:

> BTW, how do you locate unbalanced parens, etc. in an elisp source?

Go to beginning of buffer, hold down C-M-n till Emacs beeps.

kai
-- 
I like BOTH kinds of music.


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

Date: Fri, 21 Jul 2000 10:08:47 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Do I have this right, now? Please Help!
Message-Id: <os7gnscil7584fmqt6g3qmtgvgo2nn4kdg@4ax.com>

What A Man ! wrote:

>$hits =~ s/(1[123]|[4-90]$)/$1th/;
>$hits =~ s/(1$)/$1st/;
>$hits =~ s/(2$)/$1nd/;
>$hits =~ s/(3$)/$1rd/;


Maybe it's just me, but I'd throw these four lines togehter in an
"elsif" style:

  $hits =~ s/(1[123]|[4-90]$)/$1th/ or $hits =~ s/(1$)/$1st/
    or $hits =~ s/(2$)/$1nd/ or $hits =~ s/(3$)/$1rd/;

Or, using aliasing:

  for($hits) {
      s/(1[123]|[4-90]$)/$1th/ or s/(1$)/$1st/
        or s/(2$)/$1nd/or s/(3$)/$1rd/;
  }

>print <<HTML;
><html><body><head><title>counter</title></head><body>"You
>are the $hits visitor to this page"<BR></body></html>"
>HTML;

One "<body>" too many.

I'm not sure why you have an error. You could (temporarily) send all
errors to the browser, perhaps using 

	use CGI::Carp 'fatalsToBrowser';

It could be a file permissions problem. If it is, try changing the
"0644" into "0666" and set the permissions for the existing file
accordingly.

-- 
	Bart.


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

Date: 21 Jul 2000 12:59:36 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Do I have this right, now? Please Help!
Message-Id: <8l9hfo$oss$1@lublin.zrz.tu-berlin.de>

Drew Simonis  <care227@attglobal.net> wrote in comp.lang.perl.misc:

>I've never seen a print to an open filehandle fail.  I think you've 
>gone die() crazy!

You never ran out of disk space?  Tell me your secret.

Anno


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

Date: 21 Jul 2000 10:51:29 GMT
From: pl8f@cs.virginia.edu (Pinchao Lu)
Subject: emulating
Message-Id: <8l99vh$gm7$1@murdoch.acc.Virginia.EDU>




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

Date: 21 Jul 2000 10:51:44 GMT
From: pl8f@cs.virginia.edu (Pinchao Lu)
Subject: emulating
Message-Id: <8l9a00$gm7$2@murdoch.acc.Virginia.EDU>




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

Date: 21 Jul 2000 12:15:40 +0100
From: nobull@mail.com
Subject: Re: File Token
Message-Id: <u9n1jbentv.fsf@wcl-l.bham.ac.uk>

Ilja Tabachnik <billy@arnis-bsl.com> writes:

> Christopher wrote:
> > Is there a way to generate some sort of indicator token for a file that
> > PERL has created?

You mean a "lockfile" (a file the existance of which indicates that
another file is in use).  Sure just do it.

> > I want to use this token as a marker to tell a C
> > program whether or not the PERL program is finished with the file yet, so
> > the C program can close the file.

I assume "close" should read "open" - otherwise this makes no sense.

> >  I'm hoping there is some sort of
> > atomic function that will create the token when the file is created so I
> > can acheive mutual exclusion.  Thanks!
> > 
> > Chris.
> 
> IMHO you need file locking (available from C and Perl).

Sounds like he wants locking but AFAIK there's no way to atomically
create and lock a file.

Lockfiles would do the trick but are messy.

Better idea is probably to create the file under a different name and
then rename it.

This has nothing to do with Perl.

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


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

Date: Fri, 21 Jul 2000 11:12:45 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Forking children
Message-Id: <qpbgns4bmqgi1au820reuqrg3r9i2col4q@4ax.com>

Lael Matthew Heinig wrote:

>    sleep ( 0.2 ) ;

Huh? I thought sleep only works with whole seconds?

You can try the double fork. Fork, fork again, and the child immidiately
exits. The parent may wait() for it to finish, which should happen
immediately. The grandchildren will be reaped by init, so that's not
your problem. But mind you, I'm no expert.

-- 
	Bart.


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

Date: Fri, 21 Jul 2000 10:01:39 GMT
From: pepebordoy@my-deja.com
Subject: help perl/dgi
Message-Id: <8l9720$3p1$1@nnrp1.deja.com>

hi,
i am looking for the cgi/perl coding that allows me to send a form from
a html page, thus sending it to my email address.

If anybody could help me then it would be great.
Just one more thing, i need to know how to adapt it for myself.

thanks
brian


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


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

Date: Fri, 21 Jul 2000 13:02:17 GMT
From: "DS" <snakeman@kc.rr.com>
Subject: Re: How to delete a record in a text data file?
Message-Id: <tRXd5.6337$t%4.71814@typhoon.kc.rr.com>

Can you give me a hint? :) I mean there is a bunch of
FAQs.
: )

"Drew Simonis" <care227@attglobal.net> wrote in message
news:3977C010.8B1B2F2F@attglobal.net...
> DS wrote:
> >
> > How could I delete a record in a text data file if each record was
separated
> > by a ^ ?  I currently use a pipe (|) to separate the record's field ? Is
> > there a good tutorial on writing to files for perl?
> >
> > Thanx
> > DS
>
>
> This one is in the FAQ.  I won't tell you which one, so you'll have
> to read them all  =)
>
> www.perl.com has them in a friendly, HTMLish way.




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

Date: Fri, 21 Jul 2000 07:58:47 -0400
From: "Mohammed Kabir" <kabir@nitec.com>
Subject: How to disconnect from databases when mod_perl scripts are idle
Message-Id: <IVWd5.2696$DH3.41981@news-east.usenetserver.com>

I make persistent connections to databases from mod_perl scripts. However,
the scripts can only disconnect from the database when apache does a child
exit. I use a child exit handler and/or END() to deal with disconnect during
child exit.

Since apache on my large volume site keeps N spare childs hanging around,
there is a potential for a large number of connections to become idle.

An Apache child process runs N mod_perl scripts where each script might
connect to N databases. My database does not have a way of handling idle
connections.

- SIG{ALRM} won't work.
- Apache child exit handler only helps to disconnect during a child kill.
- END{} works when a child exits

Any ideas?






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

Date: 21 Jul 2000 12:16:04 +0100
From: nobull@mail.com
Subject: Re: Is this a known Perl 5 bug?
Message-Id: <u9k8efent7.fsf@wcl-l.bham.ac.uk>

"Mark Lewis" <nospam.nicedoctor@hotmail.com> writes:

> I've got a problem that looks like a bug but I'm not sure. 

Dunno if it's a know bug but it does not manifest in 5.005_03.

Did you detect it in an earlier or later version?

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


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

Date: Fri, 21 Jul 2000 11:06:52 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Just to get perl up and running...
Message-Id: <pkbgns8v4o40nkm66h0ao6kndtr3b64j7i@4ax.com>

Jim Harris wrote:

>I run Perl560.exe, I get a blank DOS window with nothing in it.

It's waiting for input.

>I've tried typing in some of the most basic things I know:
>
>perl -v (causes  the window to instantly close and vanish), several
>versions of  the "Hello  world" (several messages about "expecting
>different operators".... I'm  copying straight out of  a book).

Try again in a DOS box. Or redirect to a file. Or...

-- 
	Bart.


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

Date: Fri, 21 Jul 2000 06:48:36 -0400
From: H C <carvdawg@patriot.net>
Subject: Re: Matts Script Archive - A critique
Message-Id: <39782A84.85387CCA@patriot.net>

Two items:

1.  Could someone provide links to the following script archives?

> Why not scripts written by Selena Sol, Tim Ziegler,
> Brian Selensky as well? Seems Steve Brenner is quite
> famous. His libraries are critiqued here more often
> than Matt's scripts. Why not Brenner as well?

2.  If someone wants to critique my scripts...

    http://patriot.net/~carvdawg/perl.html

I'd appreciate it!  Some are older and don't 'use strict;' like they
should, but
hey...



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

Date: Fri, 21 Jul 2000 12:38:52 GMT
From: Richard Lawrence <ralawrence@my-deja.com>
Subject: Re: Matts Script Archive - A critique
Message-Id: <8l9g8r$92q$1@nnrp1.deja.com>

In article <39771FB4.52A99FB4@la.znet.com>,
  "Godzilla!" <callgirl@la.znet.com> wrote:
> > His are some of the most widely used (and critisised). Using some
> > obscure script written by someone who no-one has heard of would also
> > work, but probably wouldn't have quite the same impact.
>
> So your opinion is people will learn Perl programming
> better by selecting the scripts of only one person for
> critique? This suggests other scripts which exemplify
> well a common problem should be ignored because these
> scripts are not written by the 'right' author.
>
> Why not scripts written by Selena Sol, Tim Ziegler,
> Brian Selensky as well? Seems Steve Brenner is quite
> famous. His libraries are critiqued here more often
> than Matt's scripts. Why not Brenner as well?
>

I never mentioned any of the above names simply because I've never
heard of any of them.

> Is your objective to learn Perl better or to target
> a specific person for critique? If our Perl community
> selects only one person for critique, wouldn't this
> suggest perhaps some bigotry amongst those of us
> populating our Perl community?

Not at all. If people post code up for others to view then they should
accept that people will critique it. I know, I've had it done with my
code often enough - its what makes us better programmers.

If everyone told me how wonderful my code was (when it blatently
wasn't) then I would blindly charge ahead thinking my code was perfect -
 when it probably wasn't.

Rich


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


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

Date: Fri, 21 Jul 2000 11:59:33 +0100
From: "Cal Henderson" <cal@iamcal.com>
Subject: Re: MySQL and Perl problems
Message-Id: <Y1Wd5.1623$k54.28491@news6-win.server.ntlworld.com>

"Dragonia Radar Freedom, C.S." <radar@jetstream.net> wrote...
:
: #note: steve isn't my name, just my computer name...
:

Your computer is called Steve? Strange.

--
Cal Henderson

sub a{my$a=reverse shift;$a=~y/b-z/a-y/;unshift@a,$a;}sub b{$c.=reverse
shift; while(length($c)>=$b[0]){a(substr($c,0,$b[0]));$c=substr($c,$b[0]);
shift@b;}}@b=(6,3,5,4,10,6,4,4,2,1);$a="l?jouipv"."ezvmxpbuxih";$a.=
",jofoqqibmzamsfsfxfjtuiIg";while($a ne ""){b(substr($a,0,2));$a=
substr($a,2);}print join(" ",@a);




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

Date: 21 Jul 2000 02:47:33 GMT
From: py@ecst.csuchico.edu (Pythagoras Watson)
Subject: Re: Net::FTP module to delete files
Message-Id: <8l8dk5$5gs$1@hubble.csuchico.edu>

According to Kris <kaweed@micron.com>:
:    I am using the Net::Ftp module to transfer some files to a remote
:machine.  However, I would like to be able to delete all the files
:(or just the .gif files) in that directory prior to copying any over.

This works for me:
  use strict;
  use Net::FTP;
  
  my $host = "ftp";
  
  my $ftp = Net::FTP->new($host) || die "error connecting to '$host': $@\n";
  $ftp->login("user", "password") || die "error logging in\n";
  $ftp->cwd("ftpdir") || die "error changing directory\n";
  print join("\n", "Before:", $ftp->dir, "", "");
  foreach ($ftp->ls) {
    next unless (/\.gif\z/);
    $ftp->delete($_) || die "error deleting file '$_'\n";
  }
  print join("\n", "After:", $ftp->dir, "");
  $ftp->quit;

-- 
Py (Amateur Radio: KF6WFP) -- 3.141592653589793238462643383...
Pythagoras Watson -- "Live long and may all your kernels pop."
=== py@csuchico.edu ==== http://www.ecst.csuchico.edu/~py/ ===


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

Date: Fri, 21 Jul 2000 11:14:40 +0100
From: "Graham Wood" <graham.wood@iona.com>
Subject: Net::FTP on OS/390 USS
Message-Id: <8l985l$brs$1@bvweb.iona.com>

Has anyone ever used Net::FTP with perl running on OS/390 Unix System
Services?  I'm hoping to use perl to automate running of JCL jobs within
OS/390 Native via FTP so that I can get the output into files I can diff.

Has anyone attempted this before and if so would you recommend it or was it
too painful to contemplate?  Any tips welcome.

Thanks in advance

Graham Wood




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

Date: Fri, 21 Jul 2000 12:32:13 GMT
From: "Eric Selin" <eric.selin@pp.inet.fi>
Subject: Newbie: What's wrong with my code?
Message-Id: <hpXd5.860$Av5.20642@news.kpnqwest.fi>

How do I correct this. It prints "abbb".

if ($FORM{c} ==  "a") {
print "lisaa";
print $FORM{c};
}

if ($FORM{c} ==  "b") {
print "poista";
print $FORM{c};
}






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

Date: Fri, 21 Jul 2000 08:41:33 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Newbie: What's wrong with my code?
Message-Id: <Pine.GSO.4.21.0007210840550.4304-100000@crusoe.crusoe.net>

[posted & mailed]

On Jul 21, Eric Selin said:

>if ($FORM{c} ==  "a") {
>print "lisaa";
>print $FORM{c};
>}

Read the 'perlop' documentation.  The == operator is for numbers
only.  Use the eq operator.

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/



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

Date: Fri, 21 Jul 2000 12:46:49 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Newbie: What's wrong with my code?
Message-Id: <slrn8ngh92.1qr.bernard.el-hagin@gdndev25.lido-tech>

Eric Selin <eric.selin@pp.inet.fi> wrote:
>How do I correct this. It prints "abbb".
>
>if ($FORM{c} ==  "a") {
>print "lisaa";
>print $FORM{c};
>}
>
>if ($FORM{c} ==  "b") {
>print "poista";
>print $FORM{c};
>}

Change == to eq since you're comparing strings. And post a working
script if you expect more in depth help next time. What you posted above
doesn't do jack by itself.

Bernard
--
perl -le 'open(JustAnotherPerlHacker,"")or$_="B$!e$!r$!n$!a$!r$!d$!";
print split/No such file or directory/;'


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

Date: 21 Jul 2000 12:15:53 +0100
From: nobull@mail.com
Subject: Re: Perl newbie requests help with CGI/Perl
Message-Id: <u9lmyventi.fsf@wcl-l.bham.ac.uk>

Murlimanohar Ravi <eng80956@nus.edu.sg> writes:

> For some reason, when I click the Submit button, the browser only
> displays the source of the Perl file not the desired HTML output. How
> should I resolve this?

Configure you web server correctly.  This has nothing whatever to do
with Perl.

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


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

Date: Fri, 21 Jul 2000 08:47:24 -0400
From: "Gregory K. Deal" <gregory.deal@unisys.com>
Subject: Q : How to mimic awk's "in" operator
Message-Id: <8l9gli$cso$1@trsvr.tr.unisys.com>

I often use awk's "in" to check for existence, e.g.  if (item in array) . To
instantiate an associative array item in awk, I would just reference it :
array[something]. In Perl, it looks like I have to assign it, like
$array{something}++, to get either the "defined" or "exists" function to
report true. Is this necessary? Thanks.




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

Date: Fri, 21 Jul 2000 06:43:51 -0400
From: H C <carvdawg@patriot.net>
Subject: Re: s/compiled\s+Win32::OLE\s+and\s+Win32::ADO/$net/g  && &email( $me,    $url )
Message-Id: <39782967.7DB2A0BD@patriot.net>

Win32::OLE is included in the latest ActiveState distros...since build 5xx,
that
I know of.  As far as Win32::ADO, I don't know if that's been updated and
compiled for Perl 5.6 yet...try looking here;
http://www.fastnetltd.ndirect.co.uk/Perl/

clayton collie wrote:

> excuse the syntactically incorrect attempt at humour, but im trying to find
> compiled versions of Win32::OLE and Win32::ADO (i can only compile C on my
> Linux partition for the moment). ive checked the usual places (CPAN,
> ActiveState).
>
> cc



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

Date: Fri, 21 Jul 2000 12:05:47 GMT
From: "Are Bjoerby" <are.bjoerby@pineapple.no>
Subject: Sending mail using sockets
Message-Id: <v0Xd5.3386$Dxe.188891136@news.telia.no>

Hi!

I'm looking for a routine that will send mail using sockets. As I'm new to
Perl an easy-to-integrate script is what I'm looking for.

Thanks,
Are B




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

Date: Fri, 21 Jul 2000 11:07:19 GMT
From: "chello" <nospam_antoine@nospam_natuur.org>
Subject: webbased file upload via perl
Message-Id: <H9Wd5.11461$ou1.56144@nlnews00.chello.com>

I'm looking for a perl script that can automate the task of uploading via a
webpage. Via the webpage only one file can be uploaded a time. Sometimes i
need to send a large amount of data  to the server. I don't have control
over the server self.

Can someone please help me?

Antoine






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

Date: Fri, 21 Jul 2000 13:53:41 +0200
From: "Ulrich Nehls" <nospam@firemail.de>
Subject: Re: webbased file upload via perl
Message-Id: <8l9d6r$gf8$1@rznews2.rrze.uni-erlangen.de>

Hi,

have a look at

perldoc CGI

Regds.

Uli




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

Date: Fri, 21 Jul 2000 10:39:41 GMT
From: Hessu <qvyht@iobox.fi>
Subject: word maker with perl
Message-Id: <397828AC.D53EFB38@iobox.fi>

a simple script
www.geocities.com/qvyht
to create randomly words from given alphabetics and word models


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 3766
**************************************


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