[13484] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 894 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 23 19:07:31 1999

Date: Thu, 23 Sep 1999 16:05:09 -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: <938127909-v9-i894@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 23 Sep 1999     Volume: 9 Number: 894

Today's topics:
    Re: (-d $filename) test (Vasile Calmatui)
    Re: (-d $filename) test <tchrist@mox.perl.com>
    Re: (-d $filename) test (Michael Stevens)
    Re: compiler-a3 problem with setuid <marc_erickson@my-deja.com>
    Re: dates (Larry Rosler)
    Re: DBD::Pg problem (Michael Stevens)
    Re: decomposing an outline-style text body (ugly regexp (Larry Rosler)
    Re: Getting the first occurence of a string (Larry Rosler)
    Re: Getting the first occurence of a string <tom.kralidis@ccrs.nrcanDOTgc.ca>
    Re: Grouping in REs, no doc found <rick.delaney@home.com>
    Re: How do I get this to work? <bhwang@prodigy.net>
    Re: How do I get this to work? (Larry Rosler)
    Re: How do I get this to work? (Michael Stevens)
    Re: How to RLOGIN - try again <g-preston1@ti.com>
    Re: How to validate a URL? <cassell@mail.cor.epa.gov>
    Re: How to validate a URL? <rootbeer@redcat.com>
        Link errors building MySQL client for Win32 perl 5.004_ <ajg@mesasys.com>
    Re: pattern matching options <rick.delaney@home.com>
        Regex & URL parsing... <sunfox@home.com>
        Using Perl to send mail in Windows ldh7@my-deja.com
        win32 perlscript for transfering files <rick@lowcountry.net>
    Re: You should be admired, or What does this have to do <cassell@mail.cor.epa.gov>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 23 Sep 1999 22:22:48 GMT
From: vasile@club-internet.fr (Vasile Calmatui)
Subject: Re: (-d $filename) test
Message-Id: <37eaa6e0.14366313@news.club-internet.fr>

lr@hpl.hp.com (Larry Rosler) wrote:

>> >Ack!  Don't *DO* that.  Win32 can understand paths separated by '/' just
>> >as well.
>> 
>> You mean Win32 Perl "understand ...", isn't it ?
>
>No.  It means the Windows/DOS file systems understand ...

I'm afraid it's not true...

  C:\>dir temp/
  Commutateur non valide - /

In french it means "invalid switch".

>> >little) you should ever use '\\' in a Win32 system is when you're passing 
>> >arguments to CMD.EXE.
>> 
>> You mean "passing arguments outside Perl", isn't it ?
>
>No, essentially the problem is restricted to the so-called command 
>interpreter, as he said.

And you think that if you make in C an fopen("c:/temp/foo.txt")
it'll work ?

I doubt...

--
Vasile Calmatui
vasile@club-internet.fr
http://www.chez.com/vasile/


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

Date: 23 Sep 1999 16:54:18 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: (-d $filename) test
Message-Id: <37eaaf9a@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    vasile@club-internet.fr writes:
:lr@hpl.hp.com (Larry Rosler) wrote:
:
:>> >Ack!  Don't *DO* that.  Win32 can understand paths separated by '/' just
:>> >as well.
:>> 
:>> You mean Win32 Perl "understand ...", isn't it ?
:>
:>No.  It means the Windows/DOS file systems understand ...
:
:I'm afraid it's not true...

Yes, it is.

:  C:\>dir temp/
:  Commutateur non valide - /


That's not a program.  It's a shell built-in.  It is the shell
that is broken.  It parses / differently.  The kernel isn't
so stupid.

:And you think that if you make in C an fopen("c:/temp/foo.txt")
:it'll work ?
:
:I doubt...

Do not doubt.  Test it.  You'll find it works.  (Although your fopen()
call is missing an arg and a return value).

--tom
-- 
"If you understand what you're doing, you're not learning anything."
                -- Abraham Lincoln


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

Date: 23 Sep 1999 22:50:03 GMT
From: mstevens@ashre.demon.co.uk (Michael Stevens)
Subject: Re: (-d $filename) test
Message-Id: <slrn7ulbkr.1qq.mstevens@swirl.internal.fict>

On Thu, 23 Sep 1999 22:22:48 GMT, Vasile Calmatui <vasile@club-internet.fr> wrote:
>lr@hpl.hp.com (Larry Rosler) wrote:
>>No, essentially the problem is restricted to the so-called command 
>>interpreter, as he said.
>And you think that if you make in C an fopen("c:/temp/foo.txt")
>it'll work ?
>I doubt...

May I suggest experimentation? (damn where's purl when you need her)


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

Date: Thu, 23 Sep 1999 21:57:14 GMT
From: Marc Erickson <marc_erickson@my-deja.com>
Subject: Re: compiler-a3 problem with setuid
Message-Id: <7se7nj$sa3$1@nnrp1.deja.com>

Malcom et al.,

I saw this old thread (included below) regarding compiling perl on
scripts run with setuid.  Although old, I'm running into the same thing
with 5.00503...The C-code generated by the O/B/C modules uses the line:
  fakearg[1] = "-e";

which gets prepended to the main arguments and subsequently passed to
perl_parse().  When running the compiled program I get the message:
  No -e allowed in setuid scripts

Any thoughts on workarounds and/or modifications to the "main" function
in the C code to get around this problem?  Or is it a much deeper change
to the bowels of perl that is required?

Regards,
Marc


Yiu Kin Ho <khyiu@glink.net.hk> wrote:
Recently, we try to compile this perl program.  The program need to
setuid with the permission --s--x--x.  The compilation is success.
However, when we chmod the same permission mode with the compiled
program, it appear with the error:
  No -e allowed in setuid scripts

[snip]

Malcom wrote:
Not enough of perl's internals are exposed to the external compiler kit
to allow it to start up a program nicely without parsing it. The best it
can do is fake up arguments "-e ''" so that perl will parse the blank
program ''. Unfortunately, -e triggers the check done by perl when it's
doing its suid stuff. The compiler will be more closely integrated with
the core for 5.005 and, time permitting, I might be able to clean things
up somewhat so that the "-e ''" kludge is no longer necessary.

--Malcolm


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 23 Sep 1999 15:27:21 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: dates
Message-Id: <MPG.12544919d2c95f50989fcd@nntp.hpl.hp.com>

In article <7sdu9d$l31$1@nnrp1.deja.com> on Thu, 23 Sep 1999 19:16:12 
GMT, gddt@my-deja.com <gddt@my-deja.com> says...
> Hello Perl guru's can some one help me with ??

Guruness not required for this one!

> I would like to create a perl script to do the following.
> key in a julian date such as 990923

I suggest you look more closely into the term 'julian date'.  '990923' 
isn't.

> and have it print corresponding date  Thu Sep 23 12:11:03 MST 1999
> 
> is this possible ??

Yes, and easy, using no more than a module already in the standard Perl 
distribution.

Break the date down into components, suitably adjusted according to the 
conventions of localtime().  Be prepared to handle dates that happen 
four months from now, by the way.

perldoc -f localtime

Then:

perldoc Time::Local

and put it together timelocal() together with scalar localtime().

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 23 Sep 1999 22:51:33 GMT
From: mstevens@ashre.demon.co.uk (Michael Stevens)
Subject: Re: DBD::Pg problem
Message-Id: <slrn7ulbnl.1qq.mstevens@swirl.internal.fict>

On Thu, 23 Sep 1999 21:56:21 GMT, Codex <codex@bearclaw.bogus.net> wrote:
>Michael Stevens <mstevens@ashre.demon.co.uk> wrote:
>> I think the problem is that you're trying to 'do' a statement handle,
>> when do is meant to be given a query in string form. see perldoc DBI.
>Damnit, you might be right.
>[...]
>You sure are. I shouldn't use prepare() at all! Perhaps the DBD::Pg
>is a little ambiquous?
>Or perhaps I am on crack?
>Thanks a bunch! I've been reading DBD::Pg so much I thought my eyes would
>wear out.

As general advice, I normally find the DBI man page is more useful
than the DBD::whatever man page. Plus, it has the added benefits
you can expect your code to be more portable than it might otherwise be,
if there's a particularly funky DBD implementation.


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

Date: Thu, 23 Sep 1999 15:00:41 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: decomposing an outline-style text body (ugly regexp question)
Message-Id: <MPG.125442e5e86c0fd0989fcb@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7sdrht$ahh$1@winter.news.rcn.net> on Thu, 23 Sep 1999 
14:29:11 -0400, George Willman <george.willman@2asc.com> says...
 ...
> ...  The potential saving grace is a
> repeating identifying string ("Event:") in each main heading.

If I understand your problem correctly, the solution is much easier than 
you will believe.

Look in perlvar for $/ (aka $INPUT_RECORD_SEPERATOR).  You can use it to 
read an entire paragraph into a string with each <FILE> operation.  You 
may have to adjust conditions for the first and last records, but that 
is a small matter of programming.

> Thanks and have fun!

You're welcome, and you have fun too!

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 23 Sep 1999 15:08:53 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Getting the first occurence of a string
Message-Id: <MPG.125444cd2f39e12b989fcc@nntp.hpl.hp.com>

In article <2a1814d4.0ff616ea@usw-ex0108-057.remarq.com> on Thu, 23 Sep 
1999 11:56:14 -0700, Tim Diller <t.dillerNOipSPAM@xpres.com> says...
 ...
> $occurance_i_want = 4;
> $occurance_counter=0;
> 
> while(<>) {
>   if(/^STATIM(.*)$/) {
>     $string = $1;
>     $occurance_counter++;
>     if($occurance_counter = $occurance_i_want) {
                            ^
Hoo, boy!  Think about that one again.

And maybe test code before posting it.  (You can always simulate a short 
input file using the __END__ or __DATA__ source terminator and the DATA 
filehandle.

>       last;
>     }
>   }
> }

 ...

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 23 Sep 1999 18:25:29 -0400
From: Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca>
Subject: Re: Getting the first occurence of a string
Message-Id: <37EAA8D9.C19485B@ccrs.nrcanDOTgc.ca>

Larry, how about this??


$occurence_i_want = 1; # for first occurence.
$occurance_counter=0;

while (/^STATIM(.*)\b/gi)
{
  $string = $1 if (++$occurance_counter == $occurence_i_want);
}  

Furthermore, how can one assign each occurence to an array, then
extracting values bewteen each interval?  I've tried:

$CountNum = 0;

while(<FILE>)
{
  while ( /Tom/g )
  {
    $CountNum++;
    push(@array, "$CountNum");
  }     
}

 ...with no luck.
 ..Tom

Larry Rosler wrote:
> 
> In article <2a1814d4.0ff616ea@usw-ex0108-057.remarq.com> on Thu, 23 Sep
> 1999 11:56:14 -0700, Tim Diller <t.dillerNOipSPAM@xpres.com> says...
> ...
> > $occurance_i_want = 4;
> > $occurance_counter=0;
> >
> > while(<>) {
> >   if(/^STATIM(.*)$/) {
> >     $string = $1;
> >     $occurance_counter++;
> >     if($occurance_counter = $occurance_i_want) {
>                             ^
> Hoo, boy!  Think about that one again.
> 
> And maybe test code before posting it.  (You can always simulate a short
> input file using the __END__ or __DATA__ source terminator and the DATA
> filehandle.
> 
> >       last;
> >     }
> >   }
> > }
> 
> ...
> 
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com

-- 

-----------------------------------------------------------------------------------------
Tom Kralidis                                  Geo-Spatial Technologist 
Canada Centre for Remote Sensing              Tel: (613) 947-1828
588 Booth Street , Room 241                   Fax: (613) 947-1408
Ottawa , Ontario K1A 0Y7                     http://www.ccrs.nrcan.gc.ca
-----------------------------------------------------------------------------------------


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

Date: Thu, 23 Sep 1999 22:35:49 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Grouping in REs, no doc found
Message-Id: <37EAAB40.7D50E50C@home.com>

[posted & mailed]

lt lindley wrote:
> 
> Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> 
> :>Nope.  There are still 4 or 5 known bugs in the REx engine, and the
> :>mentioned above behaviour is one of them (though it happens for
> :>"simple" groups only).
> 
> Which mentioned above behavior is a bug?  That $1 is not reset after
> an unsucessful match?

No, that it is not always reset (think of \1 instead) *within* a
match-attempt when a failure causes the REx engine to backtrack or try
an alternative.

> A couple of examples would be nice.

Here's one:

  print "ok\n" if "abcab" =~ /(\w)?(abc)\1b/;# prints ok

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Thu, 23 Sep 1999 17:59:26 -0400
From: Burt Hwang <bhwang@prodigy.net>
Subject: Re: How do I get this to work?
Message-Id: <37EAA2BE.47C48506@prodigy.net>

Wouldn't you just use:
if ($password eq "$check")

Jordan DeLozier wrote:
> 
> Hello,
>         I have a couple of scripts and people have to put in their passwords to
> log in. The password looks something like this:
> 
> if ($password =~ "$check") {
> &dothis;
> }
> 
> if someone has a password of "Login" and they put in "Loginnow" as their
> password, it still thinks it is right. How can I make this script only take
> "Login" and not "Loginnow"? Exact Matches, not these type of things.
> 
> Thanks,
> Jordan DeLozier


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

Date: Thu, 23 Sep 1999 15:34:52 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How do I get this to work?
Message-Id: <MPG.12544ae29290ac4e989fce@nntp.hpl.hp.com>

In article <37EAA2BE.47C48506@prodigy.net> on Thu, 23 Sep 1999 17:59:26 
-0400, Burt Hwang <bhwang@prodigy.net> says...
> Wouldn't you just use:
> if ($password eq "$check")

I think he meant this:

  Wouldn't you just use:
  if ($password eq $check)

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 23 Sep 1999 21:55:25 GMT
From: mstevens@ashre.demon.co.uk (Michael Stevens)
Subject: Re: How do I get this to work?
Message-Id: <slrn7ul8ed.1qq.mstevens@swirl.internal.fict>

On Thu, 23 Sep 1999 21:36:22 GMT, Jordan DeLozier <master@openendon.com> wrote:
>Hello,
>	I have a couple of scripts and people have to put in their passwords to
>log in. The password looks something like this:
>if ($password =~ "$check") {
>&dothis;
>}
>if someone has a password of "Login" and they put in "Loginnow" as their
>password, it still thinks it is right. How can I make this script only take
>"Login" and not "Loginnow"? Exact Matches, not these type of things.

Read the documentation and find out what the =~ operator does, and what
the eq operator does.
Once you understand these things, you will know how to solve your
problems.



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

Date: Thu, 23 Sep 1999 17:48:21 -0500
From: Jerry Preston <g-preston1@ti.com>
Subject: Re: How to RLOGIN - try again
Message-Id: <37EAAE34.9C37C1ED@ti.com>

From within my Perl program,  I need to 'rlogin' to another server on  my
network with
password and user id.  Can you use system?

Thanks,

Jerry


Jerry Preston wrote:

> From with in my Perl program I need to "rlogin" this password and id to read
> some data.  How do I do this?
>
> Thanks,
>
> Jerry



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

Date: Thu, 23 Sep 1999 15:10:56 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How to validate a URL?
Message-Id: <37EAA570.674FF5BB@mail.cor.epa.gov>

Philip 'Yes, that's my address' Newton wrote:
> 
> On Thu, 23 Sep 1999 08:58:55 -0700, Tom Phoenix <rootbeer@redcat.com>
> wrote:
> 
> >Have you written to Fred and Barney yet? Try it and see for yourself!
> >
> >    <"fred and barney"(.@.&?<b>valid!</b>.@,,)@redcat.com>
> 
> I can't. Neither Pegasus nor Free Agent will let me.

Similar problems here, but *amazingly*, the soundly-reviled
Nyetscape Nauseator would let me send an e-mail to that
address.

You think it's just a total lack of error checking?  :-)

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 23 Sep 1999 15:33:36 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How to validate a URL?
Message-Id: <Pine.GSO.4.10.9909231532520.26916-100000@user2.teleport.com>

On Thu, 23 Sep 1999, Philip 'Yes, that's my address' Newton wrote:

> >Have you written to Fred and Barney yet? Try it and see for yourself!
> >
> >    <"fred and barney"(.@.&?<b>valid!</b>.@,,)@redcat.com>
> 
> I can't. Neither Pegasus nor Free Agent will let me.

Tsk tsk! Have you filed a bug report?

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Thu, 23 Sep 1999 18:10:33 -0400
From: "Andrew Gilmartin" <ajg@mesasys.com>
Subject: Link errors building MySQL client for Win32 perl 5.004_04
Message-Id: <EyxG3.9425$I6.360206@typ12.nn.bcandid.com>

Has anyone be been able to build the Msql-Mysql-modules-1.2207
perl module for Windows NT 4.0 using the prebuilt mysql clients
(winclients-3.22.26.zip or winclients-3.22.14.zip)? I am unable
to resolve all linker errors. The last errors are (not I am also
using the LINK environment variable set to "wsock32.lib
advapi32.lib /NODEFAULTLIB:libcmt.lib")

link -out:..\blib\arch\auto\DBD\mysql\mysql.dll -dll dbdimp.obj
    mysql.obj -Ld:\mysql/lib/opt
    D:\sandbox\mesa\perl\lib\CORE\perl.lib
    d:\mysql/lib/opt\mysqlclient.lib
    d:\mysql/lib/opt\zlib.lib -def:mysql.def

Microsoft (R) 32-Bit Incremental Linker Version 5.00.7022
Copyright (C) Microsoft Corp 1992-1997. All rights reserved.

wsock32.lib advapi32.lib /NODEFAULTLIB:libcmt.lib
LINK : warning LNK4044: unrecognized option "Ld:\mysql/lib/opt";
ignored
Creating library ..\blib\arch\auto\DBD\mysql\mysql.lib and object
 ..\blib\arch\auto\DBD\mysql\mysql.exp
mysqlclient.lib(default.obj) : error LNK2001: unresolved external
symbol __pctype
mysqlclient.lib(my_error.obj) : error LNK2001: unresolved
external symbol __pctype
mysqlclient.lib(default.obj) : error LNK2001: unresolved external
symbol ___mb_cur_max
mysqlclient.lib(my_error.obj) : error LNK2001: unresolved
external symbol ___mb_cur_max
 ..\blib\arch\auto\DBD\mysql\mysql.dll : fatal error LNK1120: 2
unresolved externals

---
Andrew Gilmartin             Mesa Systems Guild
ajg@mesasys.com              http://www.mesasys.com/
                             401-828-8500x128




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

Date: Thu, 23 Sep 1999 22:51:45 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: pattern matching options
Message-Id: <37EAAEFC.70029F77@home.com>

[posted & mailed]

Kragen Sitaker wrote:
> 
> You can't use (?g), but you probably don't want to.

You can use (?g) but you probably don't want to.

$ perl -le 'print $c++ while "foo" =~ /(?g)o/'
0
1

This bug's been around for a while.  Perhaps it's a creature waiting to
feep.  :-)

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Thu, 23 Sep 1999 22:18:51 GMT
From: "SHC" <sunfox@home.com>
Subject: Regex & URL parsing...
Message-Id: <fHxG3.783$5t2.11715@news1.rdc1.bc.home.com>

I'd like to be able to take all plain URL references in a text string - say
http://www.microsoft.com/windows/file.htm or www.ibm.com/pc/ and convert
them to HTML hotlinks - <A HREF="(address)">(address)</A>. I can start the
regex at http:// or www. easy, but I can't get it to stop at the right
place.

I'd like it only to ONLY stop the match for a blank space (/s), a !.,?:
followed by a blank space, two or more of the previous groups of character
(say if there's a ... or !!!) or a < alone (can be right against the rest of
the URL; something that's in the data I'm already working with at places). I
found a piece of regex generating code posted in this forum a few months
ago, but it doesn't seem to work for my needs (ends URLs too soon, etc...)

Any ideas? I'm stuck and would appreciate any help or LINKS to tutorials on
this. No, PerlDoc does not explain this properly for my purposes.... believe
me, I've tried.




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

Date: Thu, 23 Sep 1999 22:42:36 GMT
From: ldh7@my-deja.com
Subject: Using Perl to send mail in Windows
Message-Id: <7seacp$u03$1@nnrp1.deja.com>

I am currently working on a project where I am
trying to send email from a server running on
Windows 98 and/or Windows NT.  I would like to
use Perl 5.0 to send the mail; however, I am
having a bit of difficulty in creating the proper
program.  I tried using "Blat" but I could not
get my code to work properly.  However, I would
prefer just to use the "sendmail" feature of
Windows with Perl script rather than an external
product such as "Blat".

Any help or advice would be appreciated.

Thank you,
Laura


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 23 Sep 1999 18:48:13 -0400
From: Rick Bauman <rick@lowcountry.net>
Subject: win32 perlscript for transfering files
Message-Id: <37EAAE2D.724832A5@lowcountry.net>


Hello everyone, I am trying to get the file below to work with
activeperl build 519 on NT4.0 The script is supposed to transfer a file
from one machine to another via thje web.

I have used this file before on Linux and HPUX machines, but I am having

no luck on NT

The file gives no errors, and seems to complete it's operation just
fine, but the file being sent does not transfer.

I appreciate any help I can get.

Thanks

rick

Rick Bauman
rick@lowcountry.net

#######################################
  # Windows NT CGI file                 #
  # For web transfer                    #
  # of files                            #
  #                                     #
  # original author unknown    #
  #######################################

  use CGI qw(:standard);

  print header();
  print start_html(" Send Mail File ");
  print strong("Version "),$CGI::VERSION,p;

  print h1(" Send Mail File ");

  @types = ('count lines','count words','count characters');

  # Start a multipart form.
  print start_multipart_form(),
      "Enter the file to process:",
      filefield('filename','',45),
      br,
      checkbox_group('count',\@types,\@types),
      p,
      reset,submit('submit','Process File'),

      p,
      endform;

  # Process the form if there is a file name entered

  $\="";   #output field separator;
  $/="\r\n";


  if ($file = param('filename')) {

   unless ($file =~m/.txt$/  ||  $file =~ m/.xls$/  || $file=~m/.doc$/
|| $file=~m/.tpm$/)  {

          print ' Be sure to keep the EXACT same filename, as
      this is how the program recognizes the attachment.  One of the
following file extensions
      <i>must</i> be used: <b><font color=ff0000> .txt, .xls, .doc,
 .tpm</font></b>';

      }

      else {

      $tmpfile=tmpFileName($file);

          @filename1=split(/\\/, $file);
                          $file2 = $filename1[$#filename1];

      print hr(),
            h2($file),
            h3(
      a({href=>"c:\mailfile\$file2"},"$file2")  );
   #   my($lines,$words,$characters,@words) = (0,0,0,0);

  ###########################################################

  open (OUTFILE,">c:\mailfile\$file2");
  binmode (OUTFILE);
  $cnt = 0;
  while ($bytesread=sysread($file,$buffer,1024))
  {
          $cnt = $cnt + $bytesread;
          syswrite(OUTFILE,$buffer,$bytesread);
  }
  close OUTFILE;

  ##############################################

          }
          print "cnt = $cnt";
  }






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

Date: Thu, 23 Sep 1999 15:36:33 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: You should be admired, or What does this have to do with Perl?
Message-Id: <37EAAB71.610EBC17@mail.cor.epa.gov>

Chris Durbin [C] wrote:
[snip]
>         What I am losing respect for is this newsgroup. I came here to learn
> and explore the language, to be a better programmer, and write better

Well, this is a good place to learn how to write better code.
But it is also a battleground.  This ng gets about 2000 posts
a week.  There are not enough regular posters to deal with all
of this trayf unless someone [or a squadron of someones] insists
on making others adhere to the newsgroup charter, by means
fair or foul.

Unfortunately, that often produces 'means foul' if you know
what I mean.

And a lot of new posters drop by to ask something, and helpfully
give one or three answers while they're around.. only a lot of
the time those answers are either wrong, incomplete, misleading,
off-topic, or already answered better in the FAQ.  So now the
regular posters have to reply to *those* posts too and correct
those first replies, thereby cheesing off more people.

> code. What I now find myself faced with is monstrous amounts of
> bickering and partisan in-fighting. Finding threads of incredible length
> that seem to be about nothing more than a few various responses to
> childish insults.

I agree that those threads are not helpful.  Try pressing 'K'
and see if the whole thread just drops into the bit bucket.
Then you can ignore it, just as Abigail ignores the posts of
a large number of offenders.

>         I have read some of Abigail's responses to posts, and I have found them
> to be insultlingly condescending as a general rule. Absolutely correct,
> but very condescending. She is not alone in this. An atmosphere of
> exclusivity seems be bred in here, which is amazing, considering the
> number of posts and posters in this group.

Abigail is extremely helpful when posters are:
[1] on topic;
[2] trying to fix their code instead of asking for spoon-feeding; &&
[3] demonstrating that they have done their homework.

Abigail gives time freely to this NG and gives correct answers.
That makes Abigail a valued resource here.  The bar in this
NG is high, but is has been raised over the years in an attempt
to keep the flood of posts at a level where the experts can still
breathe.  Many Perl gurus have just given up and left this NG
for good due to this flood.  More struggle is needed to maintain
a workable newsgroup, or else this place will descend into the
depths of alt.perl .  Do you want some sort of comp.lang.perl.misc
Bizarro-world, where posters ask already-answered questions and
responders give wrong answers, all without fear of correction?
"Me hav answer 4 U.  Take '-w' off 1st line.  It bad.  Then
make code look more like BASIC.  And spell PURL rite next time!"

>         Instead of trying to prove how smart you are by tearing down someone
> else, why don't you just simply print an answer. If you know the answer

Some do.

> to someone's question, just answer it. It doesn't have to be an
> opportunity to score points by making them seem foolish, even if you
> think the solution is ridiculously simple. If someone has posted that
> question, it obviously stumped them to the point where they would turn
> to you jackals for advice. You are not children, stop acting like them.

_Ad_hominem_ arguments!  Oh boy!  

If you're going to complain about _ad_hominem_ ranting, then please
don't do it yourself.  It invalidates your position.

Now then.  The issue is NG ruthlessness.  The point is that some
people not only don't get the hint, but refuse to until beaten about
the head repeatedly with a blunt object.  Or a sharp tongue.
People who post here are expected to read the FAQ first.  To look
at some documentation.  The mini-FAQ tells them so.  Lurking and
seeing the abrupt responses should tell them so as well.  The
pointedness of the replies is often directed not only at the poster,
but at those who are going to post next week...  Or who were going
to post, but suddenly thought better of it and decided to look in
the FAQ first.

> If you need take pot-shots at each other go ahead, but stop masking as
> an authority on anything but stupidity. Take it somewhere else like
> comp.lang.perl.useless.chatter or comp.lang.perl.pointless.insults

If you feel so strongly about this, then I urge you to stand up
for your position in the way that matters.  Help out.  Answer
questions you are qualified to answer, testing your responses first
[as I learned to do the hard way], and making sure to cite the FAQ
when appropriate.  Show the courtesy you want others to show.

But after you try to be nice to a few confused posters and get nasty
"YOU SUCK YOU ARROGANT ASSHOLE" e-mails for your efforts, you may
feel a little differently.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

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


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