[12575] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6175 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 30 08:07:15 1999

Date: Wed, 30 Jun 99 05:00:22 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 30 Jun 1999     Volume: 8 Number: 6175

Today's topics:
    Re: 2 simple (not to me tho) questions (Tad McClellan)
    Re: alphabetical sorting <nospam.newton@gmx.net>
    Re: Apples and Oranges <aqumsieh@matrox.com>
    Re: Can not write my file to the server <aqumsieh@matrox.com>
    Re: Help with an array test (Marcel Grunauer)
    Re: How to convert a text file to 0-byte lenght? zenin@bawdycaste.org
        Indexing <michael.burrows@lineone.net>
    Re: is there any perlscript for client-side scripting? <matt.sergeant@ericsson.com>
    Re: Large Volume sites using perl? <matt.sergeant@ericsson.com>
    Re: module for WWW servers (Bart Lateur)
    Re: Newbie?: Is FreeBSD OK with Perl & Apache? <gellyfish@gellyfish.com>
    Re: parsing for loop (Bart Lateur)
        passing hash to subroutine <m.grimshaw@music.salford.ac.uk>
    Re: passing hash to subroutine (I.J. Garlick)
    Re: POP3 and FTP by email in Perl <marc@farm.rug.nl>
    Re: preventing echo during user input <aqumsieh@matrox.com>
    Re: Problem Installing Tk 8.000.14 - make => line too l (Andreas Fehr)
    Re: Problem with CGI in IE but not Netscape <gellyfish@gellyfish.com>
        Regular Pattern Matching <eng80386@nus.edu.sg>
    Re: Regular Pattern Matching <gellyfish@gellyfish.com>
    Re: Regular Pattern Matching <tchrist@mox.perl.com>
    Re: Robot email/poster for this group (Marcel Grunauer)
    Re: suid problem with perl (elephant)
        Unlinking a list of files <t.klinger@mobilkom.at>
    Re: Unlinking a list of files <hvermeulen@correctnl.com>
    Re: What is First line in Perl5 in Sun Micro... (Bart Lateur)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 29 Jun 1999 19:14:46 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <61kbl7.232.ln@magna.metronet.com>

Steve Lamb (morpheus@despair.rpglink.com) wrote:


:     Let's try this once more.  It is my code.
: print("$foo");
:     Looks better to me than
: print $foo;

:     It is ASTHETICS, nothing more.


   It is NOT asthetics, it is *semantics*, nothing more.

   They mean different things.

   They are not interchangable.


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


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

Date: Wed, 30 Jun 1999 13:44:35 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: alphabetical sorting
Message-Id: <377A0322.DE287360@gmx.net>

Matthew Zimmerman wrote:
> 
> sub alphabetically
> {
>   $tempa = $a;
>   $tempb = $b;
>   $tempa =~ tr/A-Z/a-z/;
>   $tempb =~ tr/A-Z/a-z/;
>   ($tempa cmp $tempb);
> }

How about something that respects locales and works under 'use strict'?
Such as sort { lc $a cmp lc $b } @array? (Saves a few bytes and some
temporary variables into the bargain.)

Cheers,
Philip


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

Date: Tue, 29 Jun 1999 13:25:41 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Apples and Oranges
Message-Id: <x3y1zeudilm.fsf@tigre.matrox.com>


edmundsMUNGED@pacifierMUNGED.com (doug edmunds) writes:

> In what way is a string that starts with a digit (other than 0) 
> different than any other string, or is this a bug?

No .. it's not a bug .. but you are using symbolic references, which
are very confusing sometimes. In Perl's regexps, $1, $2, etc, are
special READONLY vars that are set to whatever is matched by their
respective parentheses (see perlre for more info).

When you use a string that starts with a number as a symbolic ref,
Perl thinks that you are trying to set one of those read-only vars,
and complains.

Moral of the story:

Avoid symbolic refs. Use hashes instead.

HTH,
Ala



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

Date: Tue, 29 Jun 1999 16:33:26 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Can not write my file to the server
Message-Id: <x3yzp1ibvc9.fsf@tigre.matrox.com>


"Jim Ray" <jim.ray@west.boeing.com> writes:

> I am converting my UNIX perl scripts over to NT and I am having some
> problems.
> 
> Right now the following code will create a file on the server.  Under UNIX,
> no problem, under NT big problem.
> 
> Here's the code...
> 
>    open(DATA, ">>$dataname");

I am surprised no one has told you to check the value of your
open(). So I'll do it. Check the value of your open().

    open(DATA, ">>$dataname") || die "Can't append to $dataname: $!\n";

This might or might not solve your problem, but it's a Good Thing (tm)
to do .. always.

HTH,
Ala



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

Date: Wed, 30 Jun 1999 10:57:39 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: Help with an array test
Message-Id: <3779f7d9.681039@enews.newsguy.com>

On 29 Jun 1999 21:37:02 GMT, ada@fc.hp.com (Andrew Allen) wrote:

>Marcel Grunauer (marcel.grunauer@lovely.net) wrote:
>: On Tue, 29 Jun 1999 12:38:15 -0600, Jeff Beard
>: <jeffbREMOVETHIS@mcguckin.com> wrote:
>
>: Not exactly sure whether this is what you mean, but I took it to mean
>: "all elements should be 0", not "undef". Anyway, here it goes:
>
>: @test = (0, 0, 0, 0);
>
>: if (join('',@test) eq '0'x@test) {
>: 	# all elements are 0
>: }
>
>Umm, what if @test=("00","",0,0) ? Why wouldn't you do something
>straightforward like:

Repeat:

Not exactly sure whether this is what you mean, but I took it to mean
"all elements should be 0"

"0", not empty, undef, or /00+/.

Poor spec, then. Agreed.

Marcel

Marcel
-- 
perl -e 'print unpack(q$u$,q$82G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R$)'


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

Date: 30 Jun 1999 07:25:17 GMT
From: zenin@bawdycaste.org
Subject: Re: How to convert a text file to 0-byte lenght?
Message-Id: <930727730.840085@thrush.omix.com>

Abigail <abigail@delanet.com> wrote:
: Faisal Nasim (swiftkid@bigfoot.com) wrote on MMCXXVIII September MCMXCIII
: in <URL:news:7lc2s4$5if2@news.cyber.net.pk>:
	>snip<
: ## But look, I shortened my sig, removed that separator, and I
: ## try to quote the message as less as possible! And also put
: ## reply after the quoted message.
: 
: See! Even with Outlook you can do that.

	Speeking of quoting issues, '## ' is not a normal quoting string and
	thus newsreaders that have color coding features such as tin can't
	detect such quoting correctly.  I'd rather not add '#' to the
	quoting charactor list for the same reasons I wouldn't want to add
	'//' (it would catch code examples by mistake).

	Please consider '> ' or ': ' as your quoting string, thanks. :-)

-- 
-Zenin (zenin@archive.rhps.org)     "Hey, are you one of those Linux coders?"
                                    "Nyet.  Linux coder in next office."
                                    "Good man.  Ignore the screams."
                                          --www.userfriendly.org


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

Date: Wed, 30 Jun 1999 08:35:28 GMT
From: "Michael Burrows" <michael.burrows@lineone.net>
Subject: Indexing
Message-Id: <01bec2d4$02a9f2a0$a5cbac3e@default>

Hi
Do search engines index the web by traversing links? Would it be faster to
delegate the indexing to web servers, and then merge indexes received back?
Mike


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

Date: Wed, 30 Jun 1999 09:49:56 +0100
From: Matt Sergeant <matt.sergeant@ericsson.com>
Subject: Re: is there any perlscript for client-side scripting?
Message-Id: <3779DA34.2ED0BD58@ericsson.com>

smnayeem@my-deja.com wrote:
> 
> But thats very microsoftish, I am more into the any-platform any-browser
> standard, is there really no way? I mean does it always have to be Java?
> why does perl have to be so handicapped? I am sure the perl community
> can persuade Netscape and Microsoft to accept a certain Perlscript
> standard like Javascript or something?

The Mozilla project is looking into doing just that. But then it's not
cross-browser compatible, is it?

Matt.


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

Date: Wed, 30 Jun 1999 10:11:07 +0100
From: Matt Sergeant <matt.sergeant@ericsson.com>
Subject: Re: Large Volume sites using perl?
Message-Id: <3779DF2B.60E5F06B@ericsson.com>

Jack Gardner wrote:
> 
> I'm interested to know which LARGE volume web sites people have heard
> of/know of using perl.

How about the internet movie database (entirely implemented in
mod_perl). Also, the BBC (europe's largest non-portal web site), and the
RAC here in the UK. There are lots of others.

> I am certainly not implying that perl is not being used on high volume
> sites.  I am just interested to know of specific sites if any knows of
> any.  I should also point out that I am not 'advocating' a particular
> language over perl.

Then why are you asking, out of curiosity?

Matt.


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

Date: Wed, 30 Jun 1999 08:57:44 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: module for WWW servers
Message-Id: <3779db44.2660237@news.skynet.be>

Abigail wrote:

>lhollman@my-deja.com (lhollman@my-deja.com) wrote on MMCXXVIII September
>MCMXCIII in <URL:news:7l9q48$7tp$1@nnrp1.deja.com>:
>;; Hi all:^M^MI'm trying to build a light-weight WWW server using Perl.  I've
>;; poked^Maround CPAN, but wasn't able to find a module of methods to help^Mwrit
>;; WWW servers (like the LWP modules for writing clients).  Has^Msuch a module
>;; already been written?  Has someone already written such^Ma server?^M^M

Ah, "the joy of a real newsreader"...    ;-)

Note this part:

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

It's a Deja.com bug. Another one.

It looks like this guy posted through Deja.com from a Mac. And Deja.com
didn't expect that. Nor did it fix it.

	Bart.


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

Date: 30 Jun 1999 10:05:56 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Newbie?: Is FreeBSD OK with Perl & Apache?
Message-Id: <3779ddf4@newsread3.dircon.co.uk>

will <wganz~ZZZZ~@texoma.net> wrote:
> 
> This is not flame war troll but I want to find out which OS would be
> best for PERL & apache. 

If you want to know about Apache you will probably want to ask in the
group comp.infosystems.www.servers.unix.

Of course this group is not in the business of advocating any particular OS
generally but at <http://www.perl.com/pace/pub/perldocs/latest.html> is a
list of the Unix and Unix-like OS that Perl has built in supports for.

/J\
-- 
"Michael Ancram, you haven't got a hope in hell of winning the next
election" - Huw Edwards, BBC News


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

Date: Wed, 30 Jun 1999 07:34:50 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: parsing for loop
Message-Id: <377bc886.2979241@news.skynet.be>

Abigail wrote:

>Ah, the wonders of a real newsreader:

Now find a way to post this only once, you're set.

	Bart.


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

Date: Wed, 30 Jun 1999 10:22:32 +0100
From: Mark Grimshaw <m.grimshaw@music.salford.ac.uk>
Subject: passing hash to subroutine
Message-Id: <3779E1D8.9D6EDF91@music.salford.ac.uk>

Dear all,

I have a set of scripts that make use of a .pm library that I've built
up.  I need to read and write to Berkely DBs within those scripts.
Currently I have lots of subroutines scattered throughout the scripts
for opening the DBs.  I want to tidy this up by having one subroutine in
my .pm library that ties the DB hash and makes it accessible to the
scripts for reading and writing depending on the mode parameters that I
pass to it.  I set up a simple test script to see whether I could do
this with two subroutines in the one script but get  a variety of errors
depending on whether I try passing by reference or typeglob.  Here's my
latest attempt (I think it's clear what I want to do):


>>>>>>>>>>>>>>>

#!/usr/local/bin/perl -w

use DB_File;
use POSIX;

&getdata;

sub getdata
{
        $db = '/music/studio/jobs/jobsdb';
        if(!tiedb(\%DB, $db, O_RDONLY, 0444))
        {
                print "unable to open db\n\n";
                exit;
        }
        print "$DB{2}\n\n";
}

sub tiedb
{
my(%D, $dbb, $modea, $modeb) = @_;

        if(!tie(%D, DB_File, $dbb, $modea, $modeb))
        {
                return 0;
        }
        return 1;
}

exit;

<<<<<<<<<<<<<<


Any help would be appreciated.





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

Date: Wed, 30 Jun 1999 10:46:33 GMT
From: ijg@connect.org.uk (I.J. Garlick)
Subject: Re: passing hash to subroutine
Message-Id: <FE4z9L.H04@csc.liv.ac.uk>

In article <3779E1D8.9D6EDF91@music.salford.ac.uk>,
Mark Grimshaw <m.grimshaw@music.salford.ac.uk> writes:
> Dear all,
> 
> sub getdata
> {
>         $db = '/music/studio/jobs/jobsdb';
>         if(!tiedb(\%DB, $db, O_RDONLY, 0444))
                    ^^^^
[snipped]
> sub tiedb
> {
> my(%D, $dbb, $modea, $modeb) = @_;
     ^^
Shouldn't that be a scalar since your passing a reference?

my($D, $dbb, $modea, $modeb) = @_;

> 
>         if(!tie(%D, DB_File, $dbb, $modea, $modeb))
                  ^^
which would make this 
          
          if(!tie(%{$D}, DB_File, $dbb, $modea, $modeb))

I think. (I haven't tried this but according to everything I have read
that should be how to dereference a ref to a hash).

>         {
>                 return 0;
>         }
>         return 1;
> }
> 
> exit;

Also you might want to try writing the sub like this

sub tiedb
{
	my($D, $dbb, $modea, $modeb) = @_;

	(tie(%{$D}, DB_File, $dbb, $modea, $modeb)) || return;
	return 1;
}

Most find it more readable. (agian untried, probably get told off for this
:-) )

-- 
Ian J. Garlick
ijg@csc.liv.ac.uk

The seven deadly sins ... Food, clothing, firing, rent, taxes,
respectability and children.  Nothing can lift those seven milestones
from man's neck but money; and the spirit cannot soar until the
milestones are lifted.
                -- George Bernard Shaw



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

Date: 30 Jun 1999 11:21:30 +0200
From: Marc Weeber <marc@farm.rug.nl>
Subject: Re: POP3 and FTP by email in Perl
Message-Id: <86vhc62gdh.fsf@pc216.farm.rug.nl>

"Faisal Nasim" <swiftkid@bigfoot.com> writes:

> Jordan Hiller <hiller@email.com> wrote in message
> news:37794AEE.F3FFC7A7@email.com...
> > I am writing a "Web by email" program in Perl. I was wondering if there is
> a
> > FTP-by-email program written in Perl for me to take a look at.
> >
> > Also, I'm not sure how to read email from a POP3 server in perl. Any
> pointers or
> > sample code?
> 
> 
> Mail::POP3Client
> 

I use the following code to check for an email message containing the
word $job_pattern. If found, I look for specific web address
$dload_address. Look also at the Perl Cookbook, recipe 18.5

  use Net::POP3;


  # monitoring the DAD mailbox for MM results.
 SLEEP: while ( 1 ) {
    #create pop and login
    my $pop = Net::POP3->new( $config->{server_POP} ) or die
      "Error $config->{server_POP} server\n";
    defined( $pop->login( $config->{user_POP}, $config->{passwd_POP} ) ) or
      die "Error authenticate POP3\n";

    my $messages = $pop->list;
    #loop through messages
    foreach my $message_key ( keys %$messages ) {
      my $message = $pop->get( $message_key );

      # grep for (unique) file pattern 
      if ( grep { /$job_pattern/ } @$message ) {
	#check for unsuccessful job
	if (  grep { /UnSuccessful/ } @$message ) {
	  $pop->delete( $message_key );
	  $pop->quit;
	  die @$message;
	}
	#get download address
	my @list =  grep { /Result Location: / } @$message;
	$list[ 0 ] =~ /Result Location: (.+)/;
	chomp( $dload_address = $1 );
	$pop->delete( $message_key );
	$pop->quit;
	last SLEEP;
      }
      else {
	#mark as unread
	$pop->reset();
      }
    }
    #check pop3 server every 30 secs
    $pop->quit;
#    sleep 30;
    sleep 10;
  }


-- 
----------------------------------------------------------
Marc Weeber                   http://www.farm.rug.nl/marc/
                    _______   phone: +31 50 363 7571 
marc@farm.rug.nl       |      fax:   +31 50 363 3311 
-----------------------0----------------------------------


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

Date: Tue, 29 Jun 1999 16:49:18 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: preventing echo during user input
Message-Id: <x3yyah2bult.fsf@tigre.matrox.com>


resark@my-deja.com writes:

> I need to prevent what is being input by the user from being echoed (a
> password in a login prompt)

perldoc perlfaq8:

     How do I ask the user for a password?

> I know is it possible with a system call (stty -echo), but I know there is a
> better way that does not involve system calls.	I was pointed to the
> Term::ReadLine module, but have been unable to find information on how to
> make it work in this way.

The answer to the above question contains:

     You can also do this for most systems using the
     Term::ReadKey module from CPAN, which is easier to use and
     in theory more portable.

So you should be looking for Term::ReadKey ... not Term::ReadLine (not
that I am familiar with any of them). Download it from CPAN, and
checkout its docs.

> Any help would be greatley appreciated.

HTH,
Ala



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

Date: Wed, 30 Jun 1999 11:19:45 GMT
From: andreas@mrs.ch (Andreas Fehr)
Subject: Re: Problem Installing Tk 8.000.14 - make => line too long
Message-Id: <1103_930741585@chstaw0439>

On 29 Jun 1999 17:15:26 -0000, anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
> Simon griffiths  <s.grififths@virgin.net> wrote in comp.lang.perl.misc:
> >The line in question is - I think -
> >
> ># --- MakeMaker pm_to_blib section:
> >
> >pm_to_blib: $(TO_INST_PM)
> >        @$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \
> >        "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \
> >        -e "pm_to_blib({qw{$(PM_TO_BLIB)}},'$(INST_LIB)/auto')"
> >
> >- in other words its only the expansion that's the problem !
> >Thus splitting into separate lines is not an option !
> 
> Oh, okay.  $(PM_TO_BLIB) is indeed a biggie, it could be something
> like 10 or 20 K.  Gnu make swallows it with no hickup though.
> What kind of make have you got?
> 
> I dunno, could there be a way to make a make-variable *expand*
> to continuation lines?  That might be another cop-out.
> 
> Anno

I had the same problem with VC++ under Windows.
But if you use ActivePerl, I'd suggest to load the binaries from
http://www.activestate.com/packages/zips/
This worked for me.

Andreas


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

Date: 30 Jun 1999 09:28:33 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Problem with CGI in IE but not Netscape
Message-Id: <3779d531@newsread3.dircon.co.uk>

Matthew Norris <mnorris@nospam.compuvisions.com> wrote:
> If the FAQ post was meant for me, I had already checked the FAQ's but they
> did not help (at least as far as I saw)  I get output for both, only
> Netscape displays the if statement and IE diplays the accompaning else
> statement.  It is not in the actual HTML as far as I can tell, it does
> display the HTML correctly, it seems to be in the if-else statement which is
> what has me confused.
> 

Sit down, switch off your computer and think.  How do you think that the
browser that someone might be using to view the results of some CGI
program written in *any language* might affect those results ?  Unless you
want to suggest that this is a new consequence of quantum computing that
nobody had thought of before.


/J\
-- 
"Virtual reality wouldn't be this wet" - Lucas, Seaquest DSV


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

Date: Wed, 30 Jun 1999 17:41:50 +0800
From: "cwt" <eng80386@nus.edu.sg>
Subject: Regular Pattern Matching
Message-Id: <7lcpai$cig$1@nobel2.pacific.net.sg>

Hallo ,
meine Damen und Herren,

I have this expression $value="chdir_to_CWT";
Can anyone suggest a good pattern matching expression to get $value="CWT";
???
Of course it can be done with $value=~ s/chdir_to_// ; but it is not very
clever to use $value=~ s/chdir_to_// ;
An expression that test for the word after the last _ and then discarding
the rest before the last _  would be considered good .

Thanks !!
vielen Dank!
cwt





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

Date: 30 Jun 1999 11:20:26 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Regular Pattern Matching
Message-Id: <3779ef6a@newsread3.dircon.co.uk>

cwt <eng80386@nus.edu.sg> wrote:
> Hallo ,
> meine Damen und Herren,
> 
> I have this expression $value="chdir_to_CWT";
> Can anyone suggest a good pattern matching expression to get $value="CWT";
> ???
> Of course it can be done with $value=~ s/chdir_to_// ; but it is not very
> clever to use $value=~ s/chdir_to_// ;
> An expression that test for the word after the last _ and then discarding
> the rest before the last _  would be considered good .
> 

See my post <http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=475805293&fmt=text>
for some of the ways tou might go about this ...

/J\
-- 
"If homo sapiens really were 'homo' sapiens is that why they're
extinct?" - Joey, Friends


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

Date: 30 Jun 1999 04:29:45 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Regular Pattern Matching
Message-Id: <3779f199@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, "cwt" <eng80386@nus.edu.sg> writes:
:I have this expression $value="chdir_to_CWT"; Can anyone suggest a good
:pattern matching expression to get $value="CWT"; ???  Of course it can
:be done with $value=~ s/chdir_to_// ; but it is not very clever to use
:$value=~ s/chdir_to_// ; An expression that test for the word after
:the last _ and then discarding the rest before the last _  would be
:considered good .

What's wrong with just using the straight-forward

    $value =~ s/.*_//;

--tom
-- 
Unix is defined by whatever is running on Dennis Ritchie's machine.


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

Date: Wed, 30 Jun 1999 11:10:32 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: Robot email/poster for this group
Message-Id: <377af885.853997@enews.newsguy.com>

On 29 Jun 1999 21:27:32 -0500, abigail@delanet.com (Abigail) wrote:

>Marcel Grunauer (marcel.grunauer@lovely.net) wrote on MMCXXVIII September
>MCMXCIII in <URL:news:377b27a4.6551971@enews.newsguy.com>:
>!! On 29 Jun 1999 19:21:41 GMT, stanley@skyking.OCE.ORST.EDU (John
>!! Stanley) wrote:
>!! 
>!! >I lost count of the number of people who complained that this newsgroup
>!! >was becoming a "help desk", and who voted for a moderated group so they
>!! >could get away from the problem. Now they want to turn this group into a
>!! >help desk ("Miscy -- help me...") after they have created a different
>!! >group for themselves. They wanted to leave, and now they want to program
>!! >the solution for us after they are gone.
>!! 
>!! Why didn't you post this to the relevant thread on
>!! comp.lang.perl.moderated? Afraid you might have to join in the
>!! discussion?

As I followed in another post about 30 seconds after the first one, I
missed John's posting in moderated, and have already apologised for
being too hasty.

>Because the thread belongs here?  Or, gasp, maybe some people don't
>*want* to post there? Or perhaps the posting might be rejected as
>off-topic?

John since wrote that it has been declared off-topic, if so, it's
probably a good thing, since the outcome would affect this group, so
it should be discussed here.

I don't believe in ivory towers either.

>!! Please.
>
>Doesn't talking behind someone's back make people paranoid?

Fair enough, but then it could have been suggested in .moderated to
transfer the discussion to .misc. As it was done, I believe the John's
post didn't exactly paint the right picture.

>
>!! The moderated group doesn't really get much traffic, and by far the
>!! bulk of the discussion takes place here.
>
>Odd. I haven't read any discussion about it till today.

I didn't mean discussion about this particular topic, I meant to say
that most of the postings to perl groups come to .misc.

>!!                                          But a lot of the questions
>!! that get posted here (note the wording, does it sound a bit like a
>!! helpdesk?) *are* FAQs, and I can understand that people are getting
>!! tired of posting the same answers again and again. And again.
>
>And that's a problem for some *other* group, because of?

Did I say that it was a problem for some other group?

>!! Some frequent posters must begin to feel like an organic version of
>!! Miscy already, so think of Miscy as a patient frequent poster who will
>!! never get tired of answering questions like "How can I use a variable
>!! name as a variable" or "Linux better than Perl?" or "Testing, please
>!! ignore".
>
>The only patient frequent answerer of frequently asked question is Tom P.
>Are you suggesting he's botlike?

It was meant to be ironic. Sorry about the incompatible humor.

Anyway, the intent is not to increase noise in the group, but to
answer obvious FAQs and give helpful directions before someone else
has to post the usual replies.

There are already some people who give helpful answers, and usually
pretty standard-like answers, to such posts. So the bot could do that.

If someone wanted to do something malicious, I'm sure they could have
made Eliza into an autoresponder by now. That is not the intent.

But of course, if too many people in this group are against it, the
idea should probably be reconsidered.

No offense

Marcel

Marcel
-- 
perl -e 'print unpack(q$u$,q$82G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R$)'


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

Date: Wed, 30 Jun 1999 15:51:17 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: suid problem with perl
Message-Id: <MPG.11e45b64161b1c56989ab8@news-server>

Mike writes ..
>opendir (CURRENT, "$cur");
>
>while ($file = (readdir CURRENT))
>{
>        print "$file\n" if (-d $file);
>}
>
>Why can I not see the other folders?  It looks as though the "-d" option
>only recognizes folders when it is used in the current directory. It
>sees the folders of subdirectories just as files or I don't know what.

RTFM !! .. man perlfunc has this (fairly applicable) advice: "If you're 
planning to filetest the return values out of a readdir(), you'd better 
prepend the directory in question. Otherwise, because we didn't chdir() 
there, it would have been testing the wrong file."

readdir only returns the basename .. so your '-d' test is only on the 
basename .. you need to tell it to use the $cur value as well .. and 
you'll want to optionally append a '/' separator if one isn't there 
already

#--begin
opendir (CURRENT, "$cur");

while ($file = (readdir CURRENT))
{
  print "$file\n"
    if (-d ( $cur =~ m+(\\|/)$+ ? : $cur : "$cur/") . $file);
}
#--end

-- 
 jason - remove all hyphens for email reply -


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

Date: Wed, 30 Jun 1999 09:58:12 +0200
From: "Thomas Klinger" <t.klinger@mobilkom.at>
Subject: Unlinking a list of files
Message-Id: <7lcimk$l38$1@fleetstreet.Austria.EU.net>

A small problem, I think the syntax is right, but won't work:
#!/usr/bin/perl -w
$viewdir = "/tmp";
opendir (DIR, $viewdir) || die "Cannot open $viewdir: $!";
while (defined($file = readdir (DIR))) {
 if ($file !~
/^BSC_|^BSS_|^G|^K|^N|^B|^ADJ_|^s[0-9]|^BL_|^OMC|^Default|^A1|^\.\.?|^M/) {
  print "$file ... deleted\n";
  unlink '$viewdir/$file' || die "Cannot unlink $viewdir/$file: $!";
 }
}
close (DIR);

This short one should delete all files not matching to the regex. But after
running the files are still here. Why?
Using this with perl5.003.
--
Best regards,
                  Thomas Klinger
========================================
 ......E-Mail: t.klinger@mobilkom.at.....
 .........WWW: http://www.mobilkom.at....
========================================




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

Date: Wed, 30 Jun 1999 11:25:40 +0200
From: Henry Vermeulen <hvermeulen@correctnl.com>
Subject: Re: Unlinking a list of files
Message-Id: <3779E294.57F3C080@correctnl.com>

Thomas Klinger wrote:

>
>   unlink '$viewdir/$file' || die "Cannot unlink $viewdir/$file: $!";
>
> ========================================

Hi
You must use double quotes . Like unlink "$view/$dir" .
With single qoutes it has the same effect as escaping.

Regards
Henry Vermeulen




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

Date: Wed, 30 Jun 1999 07:34:05 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: What is First line in Perl5 in Sun Micro...
Message-Id: <3779bd98.181087@news.skynet.be>

Justin Wills wrote:

>don't know if it'l work, byt try
>
>#!$ENV{'YOURVARNAME'}/perl

How COULD this possibly work? You want to help your shell to find perl,
but you need perl in order to help your shell... It'll never work, not
until perl already runs, and then you don't need it any more...

	Bart.


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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

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

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 6175
**************************************

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