[13822] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1232 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 30 15:06:30 1999

Date: Sat, 30 Oct 1999 12:05:14 -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: <941310313-v9-i1232@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 30 Oct 1999     Volume: 9 Number: 1232

Today's topics:
        #!perl like <sun_tong@geocities.com>
    Re: Array reference processing (Tad McClellan)
    Re: Change group permissions to match user permissions <gellyfish@gellyfish.com>
    Re: Como Puedo trabajar con archivos de Foxpro <gellyfish@gellyfish.com>
    Re: Date::Calc problem <gellyfish@gellyfish.com>
    Re: Globbing files in dir and subdirs <gellyfish@gellyfish.com>
        if <ICEMOUNTAIN@prodigy.net>
    Re: indirect function call <sun_tong@geocities.com>
    Re: indirect function call <qumsieh@sympatico.ca>
    Re: indirect function call (Brett W. McCoy)
    Re: Is perl Under rated? (David Foster)
    Re: Is Perl Underrated? <qumsieh@sympatico.ca>
    Re: It is always like this here? (Tad McClellan)
    Re: It is always like this here? <ltl@rgsun40.viasystems.com>
    Re: It is always like this here? <gellyfish@gellyfish.com>
    Re: It is always like this here? <gellyfish@gellyfish.com>
    Re: It is always like this here? (David Foster)
    Re: It is always like this here? <jon@midnightbeach.com>
    Re: Need help fixing this multi-file ftp script <dutch@mindspring.com>
        newbie to perl ( looking to read the date on a file) <kf4dmb@tds.net>
    Re: pass file handle <lr@hpl.hp.com>
    Re: Perl disallowed at ACM programming contests? (Mark W. Schumann)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sat, 30 Oct 1999 12:47:21 -0400
From: * Tong * <sun_tong@geocities.com>
Subject: #!perl like
Message-Id: <381B2119.4397540E@geocities.com>

Hi,

I want to find a way to let sh pick perl for me instead of my hard
coding perl path into my perl script. 

I read the man page, and the "Why we use eval 'exec perl $0 -S
${1+"$@"}' " from FMTEYEWTK but still can't get it going:

Here is my version:

#!/bin/sh -- # -*- perl -*- 
eval 'exec perl $0 -S ${1+"$@"}';

and the result I got:

Argument "" isn't numeric in add at (eval 1) line 1.
Use of uninitialized value at (eval 1) line 1.
Use of uninitialized value at (eval 1) line 1.
Use of uninitialized value at (eval 1) line 1.

My questions are:

- How to make it works.

- what the -S mean? shouldn't it before $0?

thanks

-- Tong
Anti-spam: remove underscore to reply.
Welcome to my homepage http://maxpages.com/suntong
  - All free contribution & collection
  - freeware &  music from the heavens


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

Date: Sat, 30 Oct 1999 06:50:53 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Array reference processing
Message-Id: <diiev7.8f2.ln@magna.metronet.com>

Harry Walker (hw@netcomuk.co.uk) wrote:
: I create an array reference of the form
: $arrayref=\@array;

: I then want to pass the array reference to a subroutine and let the
: subroutine process each item in the array using a foreach loop. Is
: this possible since I cannot get this to work.

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

my @array = qw(zero one two three);
my $arrayref=\@array;
print_array($arrayref);

sub print_array {
   my($ra_ref) = @_;

   foreach ( @$ra_ref ) {    # de-reference it
      print "$_\n";          # process each array element
   }
}
------------------


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 30 Oct 1999 13:12:24 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Change group permissions to match user permissions
Message-Id: <7veqro$4lh$1@gellyfish.btinternet.com>

On Fri, 29 Oct 1999 17:56:54 -0400 Tom Cockerline wrote:
> Need to change the permissions for all directories and files beneath my
> home directory so the group permissions will be the same as the user
> permissions.
> 
> Can get the mode with stat. Can't figure out how to bit-manipulate it to
> get the group bits equal to the user bits, so I can then chmod the file
> or directory with the new mode.
> 

I'd cheat :


#!/usr/bin/perl -w

use strict;

my $file = shift;

my ($user,$group,$other ) = split //,sprintf "%o", +((stat($file))[2] & 07777);

my $newmode = sprintf("0%d%d%d",$user,$user,$other);

chmod oct($newmode), $file or die "Couldnt chmod $file - $!\n";


> I'm running AIX 4.2.1.
> 

I dont suppose that makes any difference.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 30 Oct 1999 11:07:07 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Como Puedo trabajar con archivos de Foxpro
Message-Id: <7vejgr$49t$1@gellyfish.btinternet.com>

On Fri, 29 Oct 1999 14:24:30 -0700 David Cassell wrote:
> Proyecto Conford wrote:
>> 
>> Proyecto Conford wrote in message <7v9vbh$5413@eccws12.dearborn.ford.com>...
>> >A quien pueda interesar
>> >
>> >Necesito para ver quien puede ayudarme con respestos a como manipular
>> >archivos DBF, IDX, CDX
> 
> If you want to read and write .dbf files, you can use the DBI
> module with the DBD::Xbase driver.  You can get both using the
> ppm program from the ActiveState archives:
> 
> ppm install DBI DBD-Xbase
> 
> But... this driver does not work with indices.
> 

The non-DBI XBase module *does* handle NTX & NDX indexes (not IDX or CDX
apparently) - a quick example not using indexes:


#!/usr/bin/perl

use XBase;

my $table = new XBase "phonetest.dbf" or die XBase->errstr;

for (0 .. $table->last_record) 
{
   my ($deleted, $refno, $name,$phone)
          = $table->get_record($_, "REFNO", "NAME","PHONE");

   print "$refno $name $phone unless ($deleted);

}



-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 30 Oct 1999 14:22:55 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Date::Calc problem
Message-Id: <7veuvv$59q$1@gellyfish.btinternet.com>

On 30 Oct 1999 11:30:06 GMT James Porritt wrote:
> Anyone had success compiling Date::Calc on UltraSparc Solaris 7? Included 
> below is the results of the tests of which most failed. Comments/suggestions
> welcome.
> 

<snip test results>

Could you post the bit of output from the make where it fails to build
properly (if indeed it does) - if I feel the urge to log in to work at
some stage today I'll try it out myself .

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 30 Oct 1999 14:33:52 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Globbing files in dir and subdirs
Message-Id: <7vevkg$5am$1@gellyfish.btinternet.com>

On Thu, 28 Oct 1999 20:59:35 -0700 PB wrote:
> Hello all,
> 
> I have a script that's globbing files from a $dir into an array @files.  It
> does this no problem:
>     chdir ($dir) || die "Cannot cd to $dir: $!";
>     @files = <*.log>;
> 
> However what I need it to do is to also grab all the files in sub-dirs and
> also put 'em in the same @files array.  I read on a recent post that
> File::Find can do this.  Can anyone out there shed some light into "how to"?
> 

No you cant use a glob to all the files in the sub-directories *and* the
current directory - to get the files in all the sub-directories you can
do :

   @files = <*/*.log>;

How nice that File::Find can do that for you ...


use File::Find;

my @files = ();

find ( \&blah,$dir) ; # assume you have set $dir before 

sub blah
{
  if ( -e && /\.log$/ )
    { 
     push @names, $File::Find::name;
    }
}

You will of course want to read the manpage for File::Find for more 
information...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 30 Oct 1999 14:58:34 -0400
From: <ICEMOUNTAIN@prodigy.net>
Subject: if
Message-Id: <7vffcr$1esc$1@newssvr03-int.news.prodigy.com>

I have a script to have patch traders add themselves to a list of other
patch traders and display the list. It has a place were they could post
their homepage too, but if they dont have one I dont want "homepage" to be
displayed, here is the part that displays it:

else {
 for($i=$FORM{'num'}; $i<=$#sortinfo; $i++) {
  ($name,$email,$comments,$home) = split(/\|/, @sortinfo[$i]);
 print "<p><a href=\"mailto:$email\">$name</a> - $comments<br>\n";

# this is what I'm talking about
if ( ($home eq "") || ($home eq "http://") || ($home eq "http://N/A") ) {
  print "</p>\n";
 }
 else {
  unless ( ($home eq "") || ($home eq "http://") || ($home eq
"http://N/A") ) {
  print "<b>Homepage:</b> <a href=\"$home\">$home</a></p>\n";
  }
 }
 }
 if ($prev > -1) {
 print "<center><a
href=\"trade.cgi?interest=$FORM{'interest'}\&num=$prev\">Previous</a></cente
r>\n";
  }
 }

shouldn't this work? Homepage is always dispayed when It should only be
displayed when there is a homepage in the text file.
here is a sample of the text file:

John Doe| anything@anything.net |I have over 400 patches to trade.|




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

Date: Sat, 30 Oct 1999 12:26:18 -0400
From: * Tong * <sun_tong@geocities.com>
Subject: Re: indirect function call
Message-Id: <381B1C2A.649D9F96@geocities.com>

got it myself. 

as simple as 

&$func;

but what does the following sentence really means? please supply with an
example. thanks.

> You can even call a function indirectly using a variable containing its
> name or a CODE reference to it, as in $var = \&function.

-- Tong
Anti-spam: remove underscore to reply.
Welcome to my homepage http://maxpages.com/suntong
  - All free contribution & collection
  - freeware &  music from the heavens


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

Date: Sat, 30 Oct 1999 16:55:14 GMT
From: Ala Qumsieh <qumsieh@sympatico.ca>
Subject: Re: indirect function call
Message-Id: <381B235A.FC42A8B@sympatico.ca>

* Tong * wrote:
> 
> got it myself.
> 
> as simple as
> 
> &$func;

Yep. I personally prefer:

	$func->();

though.

> but what does the following sentence really means? please supply with an
> example. thanks.
> 
> > You can even call a function indirectly using a variable containing its
> > name or a CODE reference to it, as in $var = \&function.

In the above sentence, $var is a reference to the subroutine function(). 
Just like you can have references to scalars, arrays, hashes, globs, etc
 ..,
you can have references to functions. The above sentence says that you
can
call a function if you merely have a reference to it. That's it.

HTH,
--Ala


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

Date: Sat, 30 Oct 1999 17:27:47 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: indirect function call
Message-Id: <slrn81matv.lp4.bmccoy@moebius.foiservices.com>

Also Sprach * Tong * <sun_tong@geocities.com>:

>You can even call a function indirectly using a variable containing its
>name or a CODE reference to it, as in $var = \&function.
>
>So I came up with the following codes, but it does not work, please
>help. Thanks
>
>- - >8 - -
>sub test{
>    print "Arguments passed are: " . join(", ", @_);
>}
>
>$func=shift;
>$ret = \&func @_;
>exit;

You could also do it little more succintly:

#!/usr/bin/perl -w

use strict;

my $func = sub {
        print 'arguments passed are: ' , join(", ", @_), "\n";
};

$func->('Hello');



-- 
Brett W. McCoy                             bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek)   http://www.foiservices.com
FOI Services, Inc./DIOGENES                301-975-0110
---------------------------------------------------------------------------


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

Date: 30 Oct 1999 14:22:09 -0400
From: dfoster@panix.com (David Foster)
Subject: Re: Is perl Under rated?
Message-Id: <7vfd0h$eem$1@panix.com>

In <7venk5$hkg$1@m2.c2.telstra-mm.net.au> "Douglas Garstang" <dgarstan@nsw.bigpond.net.au> writes:

>Its my perception that perl is very much underrated as a serious tool for
>developing applications (at least as far as a unix environment goes).

>I could understand the tendancy for companies to use C before they use perl.
>But WHY java (which seems quite common as a development tool)? You might
>hear the argument that C runs much faster than perl (which is for the most
>part true), but the same most definitely does not hold true for Java. Java
>is also only as portable as there is virtual machines for it, while perl
>similarly is available for several different operating systems. The reasons
>are different, but the end result is the same. We can't forget that perl can
>be OO as well.

'can be' is the operative point there.  It's much easier to enforce an
OO style in java than it is in perl.

While you can write bad code in anything, I'd suggest that it's a bit
easier to write unreadable code in perl than it is in many other
languages.

If I hand a module design to a beginning programmer to implement, the
implementation in java is probably going to be a whole lot cleaner than
the implementation in perl.  Easier to read and easier to debug.

Policies are much easier to enforce in java.  You *can't* reach into
the internals of a class and muck about; while in perl you're pretty
much free to do anything.  And I can force you to at least try to
handle exceptions correctly by the class definition.  You can't really
do that in perl.

Now you can also write good code in anything, and it's absolutely true
that perl code can be clean and elegant in an OO design.  But it's hard
to do that unless everyone on the team writes clean code.

Large-scale in-house development is one place where TMTOWTDI isn't
necessarily a feature.  And given my experience with management and
in-house IT dept's at large companies, I don't expect the situation to
change any time soon.


-- 
-- 
 David Foster            |  I am a camera with its shutter open
 dfoster@panix.com       |  quite passive, recording not thinking
 finger for PGP key      |              -- Christopher Isherwood


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

Date: Sat, 30 Oct 1999 17:21:41 GMT
From: Ala Qumsieh <qumsieh@sympatico.ca>
Subject: Re: Is Perl Underrated?
Message-Id: <381B2988.814CC36B@sympatico.ca>

Douglas Garstang wrote:

> Its my perception that perl is very much underrated as a serious tool for developing
> applications (at least as far as a unix environment goes).

I totally agree. Perl wasn't written to be the internet glue language.
It just happened
to become it due to its usefulness. I am really bothered when I read a
post that uses
the words "Perl" and "CGI" interchangably. Unfortunately, most of the
people don't know
better.

Bear in mind that although you can write a wide variety of applications
in Perl, there
are certain areas where Perl is a natural choice, and other areas where
something else 
should be used. Luckily, all of my applications involve parsing of huge
text files, and
thus, fall into the former area :)

> Would this be a true statement to make? For example, if I go to one of several I.T employment
> sites and do a search on 'perl', I will always get a match of positions that are basically web
> developers involving perl for CGI.
> 
> I don't recollect ever seeing any jobs advertised that involve developing some sort of
> application around perl. Nothing larger than could be classified as basic system
> administration anyway.

After I wrote my first Perl program for my company, my colleagues
started to shift from
using a combination of C and CShell, to Perl. The reason is that I was
able to quickly
develop the program, and was able to optimize it to run in a suitable
amount of time with
great results. I was the only one in my department that knew any Perl,
but now at least 20 
people are writing Perl scripts as part of their work. Our job ads
explicitly state that
knowledge of Perl is desirable (not for all job positions of course).

A few weeks ago, I attended a course in San Francisco and was chatting
with acquaintances
that work in different companies. The subject of shell scripting came
up, and they all
acknowledged that they mostly use Perl. One person even said that he
doesn't even know
CShell, or an other kind of shell scripting, and that he's perfectly
happy with Perl.

> I could understand the tendancy for companies to use C before they use perl. But WHY java
> (which seems quite common as a development tool)? You might hear the argument that C runs much
> faster than perl (which is for the most part true), but the same most definitely does not hold
> true for Java. Java is also only as portable as there is virtual machines for it, while perl
> similarly is available for several different operating systems. The reasons are different, but
> the end result is the same. We can't forget that perl can be OO as well.

I wonder whether Perl's license has anything to do with it, although it
is way less restrictive
than the Java licenses!!

--Ala


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

Date: Sat, 30 Oct 1999 06:43:26 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: It is always like this here?
Message-Id: <e4iev7.8f2.ln@magna.metronet.com>

Abigail (abigail@delanet.com) wrote:
: Martien Verbruggen (mgjv@wobbie.heliotrope.home) wrote on MMCCLI
: September MCMXCIII in <URL:news:slrn81kri2.jvv.mgjv@wobbie.heliotrope.home>:
: \\ 
: \\ 
: \\ Which was partly, although not explicitly stated, my point. I,
: \\ personally, try to be nice to new posters. However, I don't always
: \\ succeed. Most people here probrbaly try to be nice to new posters.
: \\ However, they don't always succeed. And for some people the 'not always'
: \\ is more often than for others.


: I think the accusation of nastiness against newbies is totally
: unjustified. It's simply not true. 


   There is confusion about it because nobody qualifies what they
   mean when they say "newbie".

   When experienced Usenauts rail against "newbies", they mean
   "new to Usenet".

   There are plenty of flames for these "newbies".


   Less experienced folk think "new to Perl" is what draws the flames.

   I don't see nearly as many flames for _these_ "newbies".


   But many "newbies" are actually *both* kinds simultaneously,
   and so miss the distinction.



: There is some flaming against people
: posting off-topic questions, FAQs, badly formatted or structured questions
: and a blantant lack of doing research.


   None of those things are due to being "new to Perl".

   All of those things are due to being "new to Usenet".


: While it's true that this behaviour happens more with newbies than
: people longer in this group - people are not flamed for being newbies.

: People are flamed for how they behave - not for what they are.


   People are flamed for behaviour that is socially unacceptable
   on Usenet.

   The problem is that new posters don't _know_ what is
   socially acceptable on Usenet.

   Their ISPs have thrown them into a foriegn society without even
   a hint that it _is_ a foreign society.

   Maybe it seen as politically incorrect to not promote users to
   First Grade even if they have not learned the lessons presented
   in Kindergarten.

   Or maybe it doesn't matter because they get to collect their fee
   either way, and it is easier to just let them wander into Usenet.

   Giving folks access to Usenet without pointing them at
   news.announce.newusers is the real root cause of the
   nastiness seen here.


   But nobody gets mad at their ISP for not warning them. 

   Instead they get mad at the members of the society for complaining 
   when someone takes cuts in line!


   
---------------------------------------
In article <1995Nov9.193745.13694@netlabs.com>, lwall@netlabs.com (Larry
Wall) wrote: ...

<Larry>  [snip]  I view a programming language as a place to be
<Larry>  explored, like Disneyland. You don't need to have a lot of preparation
<Larry>  to explore a theme park.  You do have to go along with the crowd
<Larry>  control measures, though.  In a sense, each ride has its own
<Larry>  prerequisites--if you cut in line, you risk getting tossed out of the
<Larry>  park.
<Larry> 
<Larry>  What we have here in this newsgroup is a failure in crowd control.
<Larry>  Reading the FAQ is like staying in line--it's something you should
<Larry>  learn in kindergarten.  Usenet needs a better kindergarten.
---------------------------------------


   Usenet _has_ an acceptable kindergarten, but most "school systems"
   start with First Grade...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 30 Oct 1999 15:56:12 GMT
From: lt lindley <ltl@rgsun40.viasystems.com>
Subject: Re: It is always like this here?
Message-Id: <7vf4es$997$1@rguxd.viasystems.com>

Abigail <abigail@delanet.com> wrote:
:>I think the accusation of nastiness against newbies is totally
:>unjustified. It's simply not true. There is some flaming against people
:>posting off-topic questions, FAQs, badly formatted or structured questions
:>and a blantant lack of doing research.

:>While it's true that this behaviour happens more with newbies than
:>people longer in this group - people are not flamed for being newbies.

:>People are flamed for how they behave - not for what they are.

It serves no constructive purpose.  They respond better if the
sarcasm and putdowns are removed.  Don't think of it as treating them
nice because they *deserve* to be treated nice.  I won't make that
moral argument for you (although I can make it for myself).  Think
optimization.  Think picking the best approach to get the affect you
want just like you pick the best Perl tool for a given task.  (Had to
fit that in or I would be off topic. :-)

Humiliation as a force to change a person's behavior is a very poor
tool.  It has an affect but not a very precise one.  The side affects
are undesireable (for my definition of desirable, but YMMV).

I appreciate wit.  There is a place for it.  In a debate with an
equal it can be very entertaining.  Applied to a stranger who is not
expecting it and who may not have the *guns* to fight back, it is
distasteful.  And it does not produce a desirable affect.

-- 
// Lee.Lindley   /// I used to think that being right was everything.
// @bigfoot.com  ///  Then I matured into the realization that getting
////////////////////   along was more important.  Except on usenet.


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

Date: 30 Oct 1999 13:50:18 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: It is always like this here?
Message-Id: <7vet2q$59e$1@gellyfish.btinternet.com>

On 30 Oct 1999 04:01:10 GMT Martien Verbruggen wrote:
> On 30 Oct 1999 03:36:39 GMT,
> 	lt lindley <ltl@rgsun40.viasystems.com> wrote:
> 
>> It is a human failing.  I know better (an especially difficult lesson
>> learned over many years) and yet still occasionaly say something that
>> makes someone else feel bad when I know I shouldn't.  I can come up
>> with all kinds of excuses why it is in that persons best interest or
>> it is in my best interest, but it is just a rationalization.  There
>> is always a better way.  (Not that I always take the better way; hey,
>> I'm only human too.)
> 
> 
> Which was partly, although not explicitly stated, my point. I,
> personally, try to be nice to new posters. However, I don't always
> succeed. Most people here probrbaly try to be nice to new posters.
> However, they don't always succeed. And for some people the 'not always'
> is more often than for others.

And one must bear in mind that there are many occasions when someone has
politely and patiently pointed an off-topic poster to the correct resources
the original poster coming back spitting vitriol and obscenity - 'I will
have my answer and I will have it here' - the poster recently who had
just learned the word 'tangentially' springs to mind.  Then there is the
poster who is given an example demonstrating a principle rather than a
nice cut 'n' paste snippet for their script and will come back with 'but that
doesnt work' - they want us to write their program for them as a bunch
of snippets.  

And there are the trolls ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 30 Oct 1999 13:55:26 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: It is always like this here?
Message-Id: <7vetce$59h$1@gellyfish.btinternet.com>

On 29 Oct 1999 16:54:20 -0500 Abigail wrote:
> Mark Bluemel (mark.bluemelNOmaSPAM@siemens.co.uk.invalid) wrote on MMCCL
> September MCMXCIII in <URL:news:000b8d9b.40a12527@usw-ex0101-001.remarq.com>:
> ## 
> ## Are there techniques we could use to improve things, like frequently
> ## posted pointers to FAQs etc... (No, not the whole flaming things - if
> ## people can read news, surely they can find a web page given a hint)? Or
> ## is it simply that Perl attracts a vast number of <insert your
> ## uncomplementary epithet here>?
> 
> Putting FAQs on webpages would be wrong - usenet doesn't mean access to
> "the web". Luckely, Perl *comes* with the FAQ. It's right there, on your
> hard drive.
> 

Whats 'UseNet' ? I just came upon this board at www.deja.com, thats on the
web isnt it ?

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 30 Oct 1999 14:00:26 -0400
From: dfoster@panix.com (David Foster)
Subject: Re: It is always like this here?
Message-Id: <7vfbnq$cs3$1@panix.com>

In <7vcvr8$3e7$1@gellyfish.btinternet.com> Jonathan Stowe <gellyfish@gellyfish.com> writes:

>On 29 Oct 1999 17:50:44 GMT William wrote:
>> Seems to be the worst in purely language-related newsgroups.
>> I've found that, while the cluelessness is just as high,
>> the newbie-toasting is less pronounced in newsgroups
>> devoted to creating applications. Don't know why,

>Lets swing this pointless thread around a little.

use Delurk qw(:soapbox);

I've been periodically stopping into clp.m (and clp) for years, usually
reading for a few months then dropping off again.  It's pretty obvious
that things have gotten much much worse in the last couple of years.
There's some real reasons for that, and I don't think the situation is
likely to change.

>So you dont think that people make applications in Perl ?

That's not the point.  An app-creation group, say c.s-s.powerbuilder,
tends not to have the problem of off-topic posts.  That's a whole
category of flamebait they get to skip.  

The language groups have the natural problem of people confusing
various APIs for the language itself.  For example, comp.lang.c++ used
to get lots of MFC questions.  Until the widespread propagation of the
ms.* groups, it was hard to know where to ask those questions for new
users.

>You've missed the point - there is no *newbie* toasting here:
>the feckless, the idiotic, the illiterate they get flamed ,,, but no-one
>gets flamed simply for being new to the newsgroup

No, you've missed the point.  Newbie toasting doesn't mean new to the
newsgroup, it means new to perl.  And those people definitely *do* get
toasted in here.  If you've been using perl for less than a year, it's
unlikely that you are going to have a perl question that isn't covered
*someplace* in the docs.  Of course, part of using the language is
learning how to use that documentation effectively.

Now it's reasonable to suggest that although newbies *do* need a place
to discuss perl, perhaps clp.misc isn't that place.  But insisting on
this just brings you to the point where clp.misc is now.  There's a few
reasons, I'd suggest, why clp has this problem more than most.

a) The .cgi group got buried.  I mean, c'mon, comp.infosystems???  And
the leading use of perl among new users is almost definitely cgi.
Trying to keep .cgi questions out of here may be fighting the good
fight, but it's a losing battle.  If I were looking over Usenet for the
first time, I'd probably assume this is the place to ask cgi questions
(although, admittedly, I wouldn't ask them without reading the group
first).

b) .misc pretty much implies 'anything goes'.  It's real tough to keep
a .misc group on topic.  comp.lang.perl.regex or clp.ipc probably
wouldn't have this problem.

c) perl has, well, a *different* way of doing things.  When first
learning it, I remember reading the same paragraph in the docs over and
over, just knowing that it was answering my question but not being able
to grok it.

Now all this doesn't mean the flamers are wrong. Far from it, the group
has a charter and tradition and that should be respected.  But there's
an inexhaustible supply of new users out there, and a certain
percentage of them are going to blindly post to the first place they
find; flaming doesn't help one bit, because if they read the group
first they wouldn't post anyway.

So you're in the situation where new perl users need a place to discuss
perl, and the most obvious place to do it is trying to keep them out. 
Most new users will respect this, but there's always going to be a 
percentage that won't.  There's really no good answer to this one.  

Last point.  I'm not really sure if the ratio of off-topic and FAQ
threads has grown that much over the past 5 years.  ISTR an awful lot
of unix-only questions in the early clp that were technically
off-topic.  The big changes are that a) nobody really cared about unix
questions, so the thread didn't turn into flame; usually the question
was simply answered and everyone moved on; b) the FAQ and docs has grown
tremendously, so that most of the questions new users ask are in the
docs someplace; and most importantly, c) traffic has increased
tremendously.  It isn't annoying when 3 out of 20  threads  is an FAQ, 
but 30 of out 200 is hard to filter, especially when those 30 posts
turn into long flame-fests that overwhelm the content-filled threads.


-- 
-- 
 David Foster            |  I am a camera with its shutter open
 dfoster@panix.com       |  quite passive, recording not thinking
 finger for PGP key      |              -- Christopher Isherwood


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

Date: Sat, 30 Oct 1999 11:28:13 -0700
From: Jon Shemitz <jon@midnightbeach.com>
Subject: Re: It is always like this here?
Message-Id: <381B38BD.E0292816@midnightbeach.com>

David Cassell wrote:
> 
> Jon Shemitz wrote:
> 
> > I think it might be a good idea to break each section down into
> > subsections. Each section would retain the five or so most common
> > questions, and the remainder would be be parceled out into new
> > subsections, none of them bigger than five or so questions.
> 
> In TomC's words, "patches are welcome".

Well, my post was an implicit offer to bell the cat, but (a) I don't
know how to submit any changes for inclusion in the official
distribution and (b) I figured I'd put the notion out for discussion,
first.
 
> I think that there needs to be either:
> [1] more features to perldoc [TomC will clobber me for this];

This might be as good a place as any to ask: Why does perldoc behave so
badly under Win32? I mean, you can't redirect the output to more or to a
file. This is a real pain when you have a lot of output, and are foolish
enough to be using Win9x, where the console window doesn't scroll back.
I looked at the source, and it *looks* like it should be directing
outout to a paging fn, but under Win98 it doesn't seem to work.

> [2] more keywords to search on for each question with -q ; or

Yes, that would be great. I've done several searches that don't turn up
the info I later find looking through the questions. And I think looking
through a long list of questions is a lousy way of finding info.

-- 

http://www.midnightbeach.com    - Me, my work, my writing, and
http://www.midnightbeach.com/hs - my homeschool resource pages


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

Date: Sat, 30 Oct 1999 12:39:43 -0400
From: "Dutch McElvy" <dutch@mindspring.com>
Subject: Re: Need help fixing this multi-file ftp script
Message-Id: <7vf6co$o4d$1@nntp6.atl.mindspring.net>

Thanks for you help James. 

----------
In article <381AFD8A.C91098F5@bellatlantic.net>, James Tolley
<jtolley@bellatlantic.net> wrote:


> sub rename {
>  $dir = "/somedir";
>  opendir(DIR, $dir ) || die "can't opendir $dir: $!";
>
>  (@filenames, $newname, $newdir) =  readdir(DIR);
>  closedir DIR;
>
>  foreach  ( @filenames ) {
>
>  $_ =~ s/(...)(.......)(.....)(....)(...........)/$1$2$3$4$5/;
>
>  $newname .= "$2$3";
>  $newdir = "$1"; #Coult be different for each file
>  }
>
> $ftp->put("$newdir/$newname") or die "Could not ftp";
>
>  }
>
> I just want to mention that rename() is an odd sub. It renames, but also ftp's
> the file, which wouldn't be clear from just knowing the name of the routine.
It
> makes it hard to read code after not looking at it for a while. Just an idea.
>
> Anyway, the real problem seems to be that you only give put() one argument:
>
> #!/usr/bin/perl -w
>
> #Main program
>
> use Net::FTP;
> $ftp = Net::FTP->new("somemachine.com.somewhere");
> $ftp->login("usr",'passwd');
> $ftp->binary;
> $ftp->cwd("/somedir");
> $dir = "/somedir";
> opendir(DIR,$dir) or die "no opendir: $!";
> while(my $file = readdir(DIR)) {
>     next if(-d $file);
>     #NOTE: put() takes the old and new filenames.
>     $ftp->put("$dir/$file",&rename($file)) or warn "could not ftp:
$dir/$file";
>
> }
> $ftp->quit;
>
> sub rename {
>     # no need to substitute here, just match
>     $_[0] =~ /(...)(.......)(.....)(....)(...........)/; .
>      return "$1/$2$3";
> }
>
> That should be very close...
>
> hth,
>
> James
> 


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

Date: Sat, 30 Oct 1999 17:04:26 GMT
From: "jim and lois flaherty" <kf4dmb@tds.net>
Subject: newbie to perl ( looking to read the date on a file)
Message-Id: <uyFS3.14$2t5.6595@ratbert.tds.net>

Hello i am looking for a script that would compair the date on a file to a
file installed on the c drive on a users PC .  I am looking to do this
because of
virus updates.

thanks




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

Date: Sat, 30 Oct 1999 10:40:53 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: pass file handle
Message-Id: <MPG.1284cd79bdaf266898a169@nntp.hpl.hp.com>

[Posted and a copy sent to perlfaq-suggestions@perl.com.]

In article <MPG.128493efa3268231989829@nntp1.ba.best.com> on Sat, 30 Oct 
1999 06:35:17 -0700, Bill Moseley <moseley@best.com> says...
> Larry Rosler (lr@hpl.hp.com) seems to say...

[quoting perlfaq7: "How can I pass/return a {Function, FileHandle, 
Array, Hash, Method, Regexp}?"]

> > If you're passing around filehandles, you could usually just use the 
> > bare typeglob, like *STDOUT, but typeglobs references would be better 
> > because they'll still work properly under use strict 'refs'. For 
> > example: 
> 
> >     splutter(\*STDOUT);
> >     sub splutter {
> >         my $fh = shift;
> >         print $fh "her um well a hmmm\n";
> >     }
> 
> This didn't generate any errors under strict.  Or do you mean something 
> else?
> 
> #! perl -w
> use strict;
> 
>     splutter(*STDOUT);
>     sub splutter {
>         my $fh = shift;
>         print $fh "her um well a hmmm\n";
>     }

her um well a hmmm

Have all the backslashes I've used over the years, in accordance with 
the FAQ, been superfluous?  What a waste of good keystrokes.

Maybe the author of the FAQ can tell us what he meant.

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


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

Date: 30 Oct 1999 14:28:58 -0400
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Perl disallowed at ACM programming contests?
Message-Id: <7vfdda$mca@junior.apk.net>

In article <m2c2v7.gf8.ln@magna.metronet.com>,
Tad McClellan <tadmc@metronet.com> wrote:
>These days, Keith is a sysadmin at Yahoo! Inc., and is
>wondering what to do with the copy of Visual C++ that was his
>prize.

This is just killing me.  ACM is now handing out Visual C++ as a
"prize"?

This is as bad as finding out that my alma mater is pushing MS-Win
on students because it's "relevant."



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

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


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