[16714] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4126 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 25 00:05:32 2000

Date: Thu, 24 Aug 2000 21:05:10 -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: <967176310-v9-i4126@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 24 Aug 2000     Volume: 9 Number: 4126

Today's topics:
    Re: Blat and Perl ?! <amonotod@netscape.net>
    Re: Blat and Perl ?! <amonotod@netscape.net>
    Re: cookies. <jeff@vpservices.com>
    Re: cookies. <amonotod@netscape.net>
    Re: Just another silly post. <reljr_2@yahoo.com>
    Re: Just another silly post. <reljr_2@yahoo.com>
    Re: Just another silly post. <reljr_2@yahoo.com>
    Re: Just another silly post. (Martien Verbruggen)
    Re: Just another silly post. (Martien Verbruggen)
    Re: Just another silly post. <reljr_2@yahoo.com>
    Re: Just another silly post. <reljr_2@yahoo.com>
    Re: Just another silly post. <elijah@workspot.net>
    Re: Just another silly post. (Martien Verbruggen)
    Re: Just another silly post. (Martien Verbruggen)
    Re: Just another silly post. (brian d foy)
    Re: LDAP and authentication erik@noway.com
    Re: Listing files in Subdirectories (David Efflandt)
    Re: Listing files in Subdirectories <amonotod@netscape.net>
    Re: Perl vs. other scripting languages (Keith Calvert Ivey)
    Re: Sorting by a subfield (WAS: Re: This is my last que <abe@ztreet.demon.nl>
    Re: Stumped by Reg Exp Problem - help?? <elijah@workspot.net>
    Re: trying to pull each string from file to evaluate... <amonotod@netscape.net>
    Re: trying to pull each string from file to evaluate... <amonotod@netscape.net>
    Re: use CGI to remove files <amonotod@netscape.net>
    Re: use CGI to remove files (doco)
    Re: WORKIN WITH C in PERL <anmcguire@ce.mediaone.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 25 Aug 2000 01:45:30 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Blat and Perl ?!
Message-Id: <8o4j3m$3v9$1@nnrp1.deja.com>

In article <8o2a6m$fa7$1@nnrp1.deja.com>,
  reevehot@hotmail.com wrote:
>    if ($SERVER_OS eq "WIN") {

This may not test out.  Try a:

#!perl
print "\nMy OS: $^O \n";

If you are indeed on NT, it should print

My OS: Win32


Also, there was a discussion on the Win32-Perl-Admin group about
Net::SMTP today.  Check out this:
http://listserv.activestate.com/pipermail/perl-win32-admin/
and specifically this post:
http://listserv.activestate.com/pipermail/perl-win32-admin/2000-August/0
00442.html

HTH,
amonotod

--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


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


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

Date: Fri, 25 Aug 2000 02:13:32 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Blat and Perl ?!
Message-Id: <8o4knu$5sr$1@nnrp1.deja.com>

In article <8o4j3m$3v9$1@nnrp1.deja.com>,
  amonotod <amonotod@netscape.net> wrote:
> In article <8o2a6m$fa7$1@nnrp1.deja.com>,
>   reevehot@hotmail.com wrote:
> >    if ($SERVER_OS eq "WIN") {
>
> This may not test out.  Try a:
>
> #!perl
> print "\nMy OS: $^O \n";
>
> If you are indeed on NT, it should print
>
> My OS: Win32

Ehhh... That should be MSWin32.
>
> Also, there was a discussion on the Win32-Perl-Admin group about
> Net::SMTP today.  Check out this:
> http://listserv.activestate.com/pipermail/perl-win32-admin/
> and specifically this post:
>
http://listserv.activestate.com/pipermail/perl-win32-admin/2000-August/0
> 00442.html

amonotod
--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


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


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

Date: Thu, 24 Aug 2000 18:29:23 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: cookies.
Message-Id: <39A5CBF3.252C4FDE@vpservices.com>

"Tony L. Svanstrom" wrote:
> 
> Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> wrote:
> 
> > shalu892 (j_bandi@yahoo.com) wrote:
> > : Hi,
> > : I want to know where the cookies are stored on a client's
> > : browser. I know that in netscape it is stored in
> > : .netscape/cookies file but what about other browsers? I would
> > : appreciate if you answer my question.
> >
> > I usually keep mine near the keyboard on a paper napkin.
> 
> Personally I've found that it doesn't matter that much, but that you
> always should keep track of the matching glas of milk... ;-)

Always use -T with the milk, tainted keyboards are a real pain to clean
up.

-- 
Jeff


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

Date: Fri, 25 Aug 2000 03:04:06 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: cookies.
Message-Id: <8o4nms$94f$1@nnrp1.deja.com>

In article <39a5bbec@news.victoria.tc.ca>,
  yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) wrote:
> shalu892 (j_bandi@yahoo.com) wrote:
> : Hi,
> : I want to know where the cookies are stored on a client's
> : browser. I know that in netscape it is stored in
> : .netscape/cookies file but what about other browsers? I would
> : appreciate if you answer my question.
>
> I usually keep mine near the keyboard on a paper napkin.

Same here, but the glass of milk is on the table, away from the
computer.

amonotod

--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


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


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

Date: Thu, 24 Aug 2000 20:05:04 -0500
From: Policy Man <reljr_2@yahoo.com>
Subject: Re: Just another silly post.
Message-Id: <39A5C640.2B2B2767@yahoo.com>

Craig Berry wrote:

> Policy Man (reljr_2@yahoo.com) wrote:
> : Please feel very free to ignore this silly post. If you find yourself
> : irritated or angered by this post please review the previous sentence.
>
> I'm not sure if this meets the named sub restriction or not, because of
> its recursion:
>
> #!/usr/bin/perl -w
> # dirx - satisfy an insane dir-listing challenge
> # Craig Berry (20000824)
>
> use strict;
>
> my @given = @ARGV;
>
> print join "\n", dirx(@given);
>
> sub dirx { map { -l $_ ? () : -d $_ ? (dirx(glob("$_/*")), $_) : $_ } @_ }

You are close. Eliminate the named sub dirx and you are golden.

Your code actually worked the first time I fired it up which is
more than I can say for anything else I've seen so far.

Hurray, working code!



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

Date: Thu, 24 Aug 2000 20:09:28 -0500
From: Policy Man <reljr_2@yahoo.com>
Subject: Re: Just another silly post.
Message-Id: <39A5C748.93A81854@yahoo.com>

Tramm Hudson wrote:

> Martien Verbruggen wrote a reasonable answer to a silly problem:
> > $ perl -Mstrict -wle 'sub f(){opendir(D,$/=$_)&&map{-d&&!-l&&&f,print} \
> >     map"$//$_",grep!/^\.\.?$/,readdir D}map{f,print}@ARGV'
>
> To which Policy Man  <reljr_2@yahoo.com> contested:
> >You violated the rule concerning using named subroutines other than those
> >available in the base perl install. 'f' is a named subroutine. Can you
> >make it work with that rule in place?
>
> Ok, so assign it as a code reference.  If you don't like using a named
> function, then use one of those "special" variables that you allow,
> such as $1:
>
> perl -Mstrict -wle '*1=sub{opendir(D,$/=$_)&&map{-d&&!-l&&&{*1},print} \
>         map"$//$_",grep!/^\.\.?$/,readdir D}and map{&{*1},print} @ARGV'
>
> >> > -- named variables other than specials like: '$_ @_ $1 $2 $#' etc. and
> >> > the array @given.
>
> You forgot to point out that he used the glob D.  How can you claim
> to be pedantic?
>
> --
>   o   hudson@swcp.com                  hudson@turbolabs.com   O___|
>  /|\  http://www.swcp.com/~hudson/          H 505.323.38.81   /\  \_
>  <<   KC5RNF @ N5YYF.NM.AMPR.ORG            W 505.986.60.75   \ \/\_\
>   0                                                            U \_  |

Touche!



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

Date: Thu, 24 Aug 2000 20:12:27 -0500
From: Policy Man <reljr_2@yahoo.com>
Subject: Re: Just another silly post.
Message-Id: <39A5C7FB.78CBE36D@yahoo.com>

Martien Verbruggen wrote:

> On Thu, 24 Aug 2000 05:57:38 GMT,
>         Joe C. Hecht <joehecht@code4sale.com> wrote:
> > > I have a challenge for you.
> >
> > Is this a homework assignment you need help with?
>
> Anyone coming up with homework assignments like that shouldn't be
> teaching Perl. Half of those restrictions are arbitrary, silly, and
> contrary to good programming practice.
>
> Martien
> --
> Martien Verbruggen              |
> Interactive Media Division      | Hi, John here, what's the root
> Commercial Dynamics Pty. Ltd.   | password?
> NSW, Australia                  |

Precisely. It was a challenge and nothing more. Obviously only a
minor brain teaser to some.



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

Date: Fri, 25 Aug 2000 01:55:17 GMT
From: mgjv@verbruggen.comdyn.com.au (Martien Verbruggen)
Subject: Re: Just another silly post.
Message-Id: <slrn8qbkfe.ma.mgjv@verbruggen.comdyn.com.au>

On Fri, 25 Aug 2000 00:39:07 GMT,
	Craig Berry <cberry@cinenet.net> wrote:
> Policy Man (reljr_2@yahoo.com) wrote:
> : Please feel very free to ignore this silly post. If you find yourself
> : irritated or angered by this post please review the previous sentence.
> 
> I'm not sure if this meets the named sub restriction or not, because of
> its recursion:
> 
> #!/usr/bin/perl -w
> # dirx - satisfy an insane dir-listing challenge
> # Craig Berry (20000824)
> 
> use strict;
> 
> my @given = @ARGV;
> 
> print join "\n", dirx(@given);
> 
> sub dirx { map { -l $_ ? () : -d $_ ? (dirx(glob("$_/*")), $_) : $_ } @_ }

The named sub can be fixed the same way I did it for my solution.

I assumed that glob was not allowed, because of the restriction that
you are not allowed to use external programs, and it has to run under
5.004. glob uses an external program there.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | 
Commercial Dynamics Pty. Ltd.   | "Mr Kaplan. Paging Mr Kaplan..."
NSW, Australia                  | 


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

Date: Fri, 25 Aug 2000 01:56:34 GMT
From: mgjv@verbruggen.comdyn.com.au (Martien Verbruggen)
Subject: Re: Just another silly post.
Message-Id: <slrn8qbkhr.ma.mgjv@verbruggen.comdyn.com.au>

On Thu, 24 Aug 2000 20:05:04 -0500,
	Policy Man <reljr_2@yahoo.com> wrote:
> 
> Your code actually worked the first time I fired it up which is
> more than I can say for anything else I've seen so far.

Are you saying that mine didn't work without editing? What was the
problem?

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | That's not a lie, it's a
Commercial Dynamics Pty. Ltd.   | terminological inexactitude.
NSW, Australia                  | 


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

Date: Thu, 24 Aug 2000 21:12:46 -0500
From: Policy Man <reljr_2@yahoo.com>
Subject: Re: Just another silly post.
Message-Id: <39A5D61E.F2517076@yahoo.com>

Martien Verbruggen wrote:

> On Thu, 24 Aug 2000 20:05:04 -0500,
>         Policy Man <reljr_2@yahoo.com> wrote:
> >
> > Your code actually worked the first time I fired it up which is
> > more than I can say for anything else I've seen so far.
>
> Are you saying that mine didn't work without editing? What was the
> problem?
>
> Martien
> --
> Martien Verbruggen              |
> Interactive Media Division      | That's not a lie, it's a
> Commercial Dynamics Pty. Ltd.   | terminological inexactitude.
> NSW, Australia                  |

Sorry, I sent this one off before I read you earlier post.
Danmit, time got in my way again. Argggggg.



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

Date: Thu, 24 Aug 2000 21:25:34 -0500
From: Policy Man <reljr_2@yahoo.com>
Subject: Re: Just another silly post.
Message-Id: <39A5D91E.BDD8DF7E@yahoo.com>

Martien Verbruggen wrote:

> On Fri, 25 Aug 2000 00:39:07 GMT,
>         Craig Berry <cberry@cinenet.net> wrote:
> > Policy Man (reljr_2@yahoo.com) wrote:
> > : Please feel very free to ignore this silly post. If you find yourself
> > : irritated or angered by this post please review the previous sentence.
> >
> > I'm not sure if this meets the named sub restriction or not, because of
> > its recursion:
> >
> > #!/usr/bin/perl -w
> > # dirx - satisfy an insane dir-listing challenge
> > # Craig Berry (20000824)
> >
> > use strict;
> >
> > my @given = @ARGV;
> >
> > print join "\n", dirx(@given);
> >
> > sub dirx { map { -l $_ ? () : -d $_ ? (dirx(glob("$_/*")), $_) : $_ } @_ }
>
> The named sub can be fixed the same way I did it for my solution.
>
> I assumed that glob was not allowed, because of the restriction that
> you are not allowed to use external programs, and it has to run under
> 5.004. glob uses an external program there.
>
> Martien
> --
> Martien Verbruggen              |
> Interactive Media Division      |
> Commercial Dynamics Pty. Ltd.   | "Mr Kaplan. Paging Mr Kaplan..."
> NSW, Australia                  |

Oooops. Sorry. I should not have been quite that strict. I think however
in the spirit of things the fact that perl has opted to use that in the background
is not going to be well known and must be allowed. I didn't intend to restrict
the use of code based on whether perl itself might be secretly employing
another program.

Great catch however. How on God's green earth did you know that anyway?




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

Date: 25 Aug 2000 02:36:37 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: Just another silly post.
Message-Id: <eli$0008242126@qz.little-neck.ny.us>

In comp.lang.perl.misc, Policy Man  <reljr_2@yahoo.com> wrote:
> Sorry for the whacking. The challenge is a bit brutal, but hey,
> it wouldn't be a challenge w/o some silly restrictions.

Then come up with a less silly problem and ask to optimize for
size or speed.

> Do you really want it now? I'm more than willing to do so, but
> I'm afraid that someone may be diligently working on this in
> the background, and if they had the same code I had it might
> prove very disappointing to them.

Unlikely. There is more than one way to do it.

> I really hope Brian D Foy can come up with a working version
> using eval, as mine does not. I left eval in the list of acceptable
> keywords because I had a sneaking suspicion it had the potential
> to work.

brian's 'eval(<>)' will work properly, if given the right input.
I suspect you don't understand how his works. 

Elijah
------
and perhaps brian should post a link to his name style guide for you


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

Date: Fri, 25 Aug 2000 02:41:49 GMT
From: mgjv@verbruggen.comdyn.com.au (Martien Verbruggen)
Subject: Re: Just another silly post.
Message-Id: <slrn8qbn6n.ma.mgjv@verbruggen.comdyn.com.au>

On Fri, 25 Aug 2000 00:39:07 GMT,
	Craig Berry <cberry@cinenet.net> wrote:
> 
> sub dirx { map { -l $_ ? () : -d $_ ? (dirx(glob("$_/*")), $_) : $_ } @_ }


You'll be missing out on the directories and files that start with a
'.'. Inlcuding those, and then excluding . and .. is going to be a bit
more work..

Something like

dirx(grep !m!/\.\.?$!, glob("$_/* $_/.*"))

would do that.

Possibly something like

dirx(glob("$_/* $_/.[!.]*"))

would work as well, but that depends heavily on the shell that's
invoked, or whether the internal glob is used. Bourne sh equivalents,
and the internal glob will do this correctly, but csh equivalents
won't. I suppose that would disqualify this solution.

And all of this depends on whether glob() is invoking an external
program according to the rules. Or whether using the builtin glob (in
perl 5.6.0) is qualified as using a module (which is what happens
behind the screens).

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | 
Commercial Dynamics Pty. Ltd.   | "Mr Kaplan. Paging Mr Kaplan..."
NSW, Australia                  | 


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

Date: Fri, 25 Aug 2000 02:45:52 GMT
From: mgjv@verbruggen.comdyn.com.au (Martien Verbruggen)
Subject: Re: Just another silly post.
Message-Id: <slrn8qbnea.ma.mgjv@verbruggen.comdyn.com.au>

On Thu, 24 Aug 2000 21:25:34 -0500,
	Policy Man <reljr_2@yahoo.com> wrote:
> Martien Verbruggen wrote:
> 
> > On Fri, 25 Aug 2000 00:39:07 GMT,
> >         Craig Berry <cberry@cinenet.net> wrote:
> > >
> > > sub dirx { map { -l $_ ? () : -d $_ ? (dirx(glob("$_/*")), $_) : $_ } @_ }
> >
> > The named sub can be fixed the same way I did it for my solution.
> >
> > I assumed that glob was not allowed, because of the restriction that
> > you are not allowed to use external programs, and it has to run under
> > 5.004. glob uses an external program there.
> 
> Oooops. Sorry. I should not have been quite that strict. I think
> however in the spirit of things the fact that perl has opted to use
> that in the background is not going to be well known and must be
> allowed. I didn't intend to restrict the use of code based on
> whether perl itself might be secretly employing another program.
> 
> Great catch however. How on God's green earth did you know that
> anyway?

Euhmmm. I dunno. I've been around Perl for while. I might have picked
it up from this group, or maybe it's in the documentation somewhere.

In another followup in this branch of the thread I also mention that
glob, no matter what version of Perl, always invokes either an
external shell, or a module (File::Glob). I realise now that it wasn't
your intention to exclude _implicit_ invokation of externals or
modules, but that's why I stayed away from glob :). As I also note in
the other article, glob is slightly unportable, even between perl
versions, and even between various flavours of Unix-like platforms.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | This matter is best disposed of from
Commercial Dynamics Pty. Ltd.   | a great height, over water.
NSW, Australia                  | 


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

Date: Fri, 25 Aug 2000 00:04:05 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Just another silly post.
Message-Id: <brian-ya02408000R2508000004050001@news.panix.com>

In article <slrn8qbnea.ma.mgjv@verbruggen.comdyn.com.au>, mgjv@comdyn.com.au posted:

> On Thu, 24 Aug 2000 21:25:34 -0500,
>         Policy Man <reljr_2@yahoo.com> wrote:
> > Martien Verbruggen wrote:

> > > I assumed that glob was not allowed, because of the restriction that
> > > you are not allowed to use external programs, and it has to run under
> > > 5.004. glob uses an external program there.
> > 
> > Oooops. Sorry. I should not have been quite that strict. I think
> > however in the spirit of things the fact that perl has opted to use
> > that in the background is not going to be well known and must be
> > allowed.

ignorance is no excuse.

> > Great catch however. How on God's green earth did you know that
> > anyway?

> Euhmmm. I dunno. I've been around Perl for while. I might have picked
> it up from this group, or maybe it's in the documentation somewhere.

it's certainly in the Camel, 2nd edition.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Fri, 25 Aug 2000 01:14:31 GMT
From: erik@noway.com
Subject: Re: LDAP and authentication
Message-Id: <39a5c765.4347487@news.swbell.net>

If you can get ahold of the code for that, please post it. I have been
unsuccessful at authenticating using Net::LDAP on linux/apache (will
be moving it to a Netscape server).
Still haven't found a workable developers kit required for
Net::LDAPapi or the Mozilla::LDAP series

Those modules authenticate (so says the documentation), if your
inclined to use them. If you find the developers kit, post that too. I
will post my solution to this group. (Rush job, so it will be by Mon.)

Eric

On Wed, 23 Aug 2000 15:17:52 GMT, Andre-John Mas <ajmas@bigfoot.com>
wrote:

>Could someone tell me which is the recommended LDAP module to use,
>the one located at: http://miso.wwa.com/~donley/ or the mozilla
>solution at http://www.mozilla.org/directory/perldap.html.
>
>Next, does anyone have any code that would show me how to use
>the LDAP module for authentication purposes?
>
>Andre
>
>--
>http://www.bigfoot.com/~ajmas/
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.



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

Date: Fri, 25 Aug 2000 02:45:13 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Listing files in Subdirectories
Message-Id: <slrn8qbndf.ip3.efflandt@efflandt.xnet.com>

On Fri, 25 Aug 2000, satyapal_deja@my-deja.com <satyapal_deja@my-deja.com>
wrote:
>I can get list of all files in the current directory by using:
>
>@files = <*.html>
>
>How do I get list of all the files in all the subdirectories. Any file
>thus listed should be having the directory name in front of it.
>
>e.g. If I have a file myHtml.html in the sub directory 'mySubDirectory'
>it should be listed as mySubDirectory/myHtml.html.
>
>Basically I need to replace a piece of text in all the html files.
>
>Appreciate any help...

I haven't looked to see if there is a module for that, but you could do it
the long way (I may not have optimized this, but it works):

# Assuming you have specified a starting $path
chdir $path;
$pathnow = '.';
&getdir;
while (@dirs) {
    $pathnow = shift(@dirs);
    &getdir;
}
# List of relative paths to files are now in @files
foreach (@files) {
    next unless /\.html$/;
    print "$_\n";	# or do something else with all .html files
}


sub getdir {
    my @tmpdirs;
    opendir DIR, $pathnow;
    my @all = sort grep !/^\./, readdir DIR;
    closedir DIR;
    $pathnow = '' if $pathnow eq '.';
    $pathnow .= '/' if $pathnow;
    while (@all) {
        $_ = shift @all;
        chomp;
        if (-d "$pathnow$_") {
            push @tmpdirs, "$pathnow$_";
        } else {
            push @files, "$pathnow$_";
        }
    }
    unshift @dirs, @tmpdirs;
}

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/  http://cgi-help.virtualave.net/



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

Date: Fri, 25 Aug 2000 02:35:15 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Listing files in Subdirectories
Message-Id: <8o4m12$788$1@nnrp1.deja.com>

In article <8o4fuc$ld$1@nnrp1.deja.com>,
  satyapal_deja@my-deja.com wrote:
> How do I get list of all the files in all the subdirectories. Any file
> thus listed should be having the directory name in front of it.

File::Find

#### <not tested, but should work as posted> ####

#!perl -w
use strict;
use File::Find;
my (@dirstruct);
my $search_dir = '/usr/web/pub'; #for Win32, put in a drive letter
find (\&wanted, $search_dir);
print "Finding files in $search_dir now...\n";
foreach my $afile (@dirstruct) {
  print "$afile\n";
}
exit;

sub wanted {
  my $entry = "$File::Find::name" if -e;
  push @dirstruct, $entry if (($entry ne '') && (( m/html/) and (substr
$entry, 0, -4))); #This will only work with *.html
 }

#### </not tested> ####

HTH,
amonotod

--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


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


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

Date: Fri, 25 Aug 2000 03:13:51 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Perl vs. other scripting languages
Message-Id: <39a5e35d.1827180@news.newsguy.com>

Steven Merritt <smerr612@mailandnews.com> wrote:
>  "Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
>
>> You will not silence this intellectual, El Duce.
>>
>> Godzilla!
>
>ROFLMAO!!  Gojira claiming to be an intellectual. That's like CmdrTaco
>claiming to be a Perl hacker!

Especially since the "intellectual" seems to think, from the
incorrect article, that Mussolini was Spanish.

Besides, "Il Duce" isn't something you'd use as a form of
address.  When dining with John Wayne, would you say "Pass the
potatoes, The Duke"?

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Fri, 25 Aug 2000 03:17:18 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Sorting by a subfield (WAS: Re: This is my last question, I swear!!!!!!!!!!)
Message-Id: <jmgbqscjmgocn8j0b7f5cc326povg3chr7@4ax.com>

On Thu, 24 Aug 2000 12:54:47 -0700, Larry Rosler <lr@hpl.hp.com> wrote:

> [You still haven't learned not to quote the entire article you are 
> replying to, out of sequence at the end.  Even if your newsreader X-
> Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
> does this by default, you must edit it manually, or be prepared to lose 
> tolerance around here.]

Thank you for pointing this out in such a nice way :-)

 ...

> One can't help you further without a small sample of the unsorted data, 
> so one can verify your assertion about the incorrect numerical sort.

I'm sorry, but I think we have a sample of the unsorted data, but we
don't know _how_ it should be sorted:

<> On Mon, 21 Aug 2000 19:13:22 GMT, pape_98@my-deja.com wrote:

<> NIH,10B-410,01 36,13 5 26,15 43,1 5 2 5 2 4
<> NIH,6B-4,01 36,13 5 26,15 43,1 5 2 5 2 4
<> Suburban,6C-258,52 51,5256,15 13,152
<> Suburban,ACardiology,52 51,5256,15 13,152
<> NIH,9B-4,01 36,13 5 26,15 43,1 5 2 5 2 4
<> NIH,15-410,01 36,13 5 26,15 43,1 5 2 5 2 4
<> NIH,60B-410,01 36,13 5 26,15 43,1 5 2 5 2 4
<> NIH,B1D-416,52,135 6,1513,52 hi,
<> NIH,B1D-43,01 36,13 5 26,15 43,1 5 2 5 2 4
<> Suburban,10C-58,52 51,5256,15 13,152
<> Suburban,1B-29,52 51,5256,15 13,152
<> NIH,B1D-403,01 36,13 5 26,15 43,1 5 2 5 2 4
<> NIH,B1D-410,52 51 36,135 256,15413,1512
<> Suburban,6B-281,52 51,5256,15 13,152
<> Suburban,Office,52 51,5256,15 13,152


To OP: Please specify your sort criteria in a clear and _unambiguous_
way, otherwise no one knows how to help you.

-- 
Good luck,
Abe


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

Date: 25 Aug 2000 01:25:26 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: Stumped by Reg Exp Problem - help??
Message-Id: <eli$0008242009@qz.little-neck.ny.us>

In comp.lang.perl.misc, Scott <shamilton@plateausystems.holdthespam.com> wrote:
> In short, I want to be able to quickly scan through a file and convert all
> web http addresses into HTML links.  So far, this is fairly easy (after much
> experimentation I came up with $data =~
> s/(http:\/\/[\w\/\-~]*(\.[\w\/\-~]+)+)/<a href="$1">$1<\/a>/ig).

http://www.example.com:8080/	valid URL broken by that

http://___~-./			invalid URL accepted by that

Maybe you want something more like

    s!(https?:// 					# scheme
	(?: [^:]+ (?: : [^@]+ )? @ ) ?			# username/password
	(?: [a-z0-9] (?: [a-z0-9]+ | -[a-z0-9] )* \. )+ # hostname fragment
	(?: [a-z0-9] (?: [a-z0-9]+ | -[a-z0-9] )*    )  # top level domain
        (?: : \d+ )?					# port number
	(?: / \S* ) ? 					# local part
	(?= [.>'"\s] | $ )				# probable boundary
      ) !<a href="$1">$1</a>!xig;

I specifically avoid things like "http://www/file.html" but do allow
"http://www.internal/file.html" for subdomains that may just work
for you.

> Here's what I can't figure out, though: if the link in question is ALREADY
> formatted as an HTML link, then I don't want to perform the conversion,
> otherwise things get REAL messy.

Surround the above with:

     if (!/<a \s+ [^>]* \b href=/i) {
	# s!!!xig here
     }

> So, is there a way to format the reg exp such that it is only executed if
> the target string is NOT found within certain other strings?  For instance,
> I'd like to say, replace all instances of XYZ so long as it is not residing
> BETWEEN <a\s* and <\/a>.
> 
> Is it even possible?

Of course, to varying degrees of of coping with unpredictable formats.
My code above does not handle RFC1738 <URL:...> urls that are wrapped
(have line breaks added). Nor is username:password legal for the HTTP
scheme according to RFC1738, but it does work in several browsers.

Elijah
------
doesn't bother with the nightmare of checking for legit local parts


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

Date: Fri, 25 Aug 2000 03:18:22 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: trying to pull each string from file to evaluate...
Message-Id: <8o4ohg$a2g$1@nnrp1.deja.com>

In article <39A5A1F7.C3AE8A40@itron.com>,
  TEC <travis.cox@itron.com> wrote:
> HTH (Just another Abigail Fan)

Be that true, read this:
http://www.geocities.com/amonotod/non_jep_reply.html.

It is an HTML-ified post by Tom Christiansen about Jeopardy style
posting.  If you are the Abagail fan you say you are, then surely you
know that Abagail expresses disdain for said posting style.

Later,
amonotod

--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


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


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

Date: Fri, 25 Aug 2000 03:21:09 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: trying to pull each string from file to evaluate...
Message-Id: <8o4omm$abq$1@nnrp1.deja.com>


>    select(undef, undef, undef, 0.25);
>    # Sleep for a quarter second so we don't use too many CPU's

Wouldn't sleep() work just as well?

> HTH (Just another Abigail Fan)

Be that true, read this:
http://www.geocities.com/amonotod/non_jep_reply.html.

It is an HTML-ified post by Tom Christiansen about Jeopardy style
posting.  If you are the Abagail fan you say you are, then surely you
know that Abagail expresses disdain for said posting style.

Later,
amonotod

--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


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


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

Date: Fri, 25 Aug 2000 02:55:59 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: use CGI to remove files
Message-Id: <8o4n7o$8hp$1@nnrp1.deja.com>

In article <8o2qno$55g$1@news.cis.nctu.edu.tw>,
  is83024@cis.nctu.edu.tw (doco) wrote:
> other words, at the System, I can use "$perl kill.pl delete_file" to
> delete the files.  But by using Browser, I can not use
> http://localhost/cgi/kill.pl?delete_file to delete the files.  The

Do you have a webserver on your local machine?  If not, see
comp.infosystems.www.servers.ms-windows or
comp.infosystems.www.servers.unix, whichever is more applicable.

If so, perhaps you have not configured it correctly for cgi.  Refer to
the above newsgroups.

HTH,
amonotod

--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


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


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

Date: 25 Aug 2000 03:58:21 GMT
From: is83024@cis.nctu.edu.tw (doco)
Subject: Re: use CGI to remove files
Message-Id: <8o4qst$krl$1@news.cis.nctu.edu.tw>

amonotod (amonotod@netscape.net) ´£¨ì:
: In article <8o2qno$55g$1@news.cis.nctu.edu.tw>,
:   is83024@cis.nctu.edu.tw (doco) wrote:
: Do you have a webserver on your local machine?  If not, see
: comp.infosystems.www.servers.ms-windows or
: comp.infosystems.www.servers.unix, whichever is more applicable.
: If so, perhaps you have not configured it correctly for cgi.  Refer to
: the above newsgroups.
I have configured the NES webserver correctly before this problem orrured.


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

Date: Thu, 24 Aug 2000 20:47:39 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: WORKIN WITH C in PERL
Message-Id: <Pine.LNX.4.21.0008242041470.6033-100000@hawk.ce.mediaone.net>

On Thu, 24 Aug 2000, Nail =DCnl=FC quoth:

~~ Date: Thu, 24 Aug 2000 23:16:35 +0200
~~ From: Nail =DCnl=FC <nail.uenlue@freesurf.ch>
~~ Newsgroups: comp.lang.perl.misc
~~ Subject: WORKIN WITH C in PERL
~~=20
~~ hi everybody,
~~=20
~~ is there a way of executin a c programm under unix with perl and to read=
 the
~~ output with stdin ???
~~=20

No, that is not allowed in the current version of Perl, you will
have to wait for Perl 6, which support capturing the output of
C programs.  Currently you must capture the output of the truss
program, but only if it was written in Pascal, make sense?  Then
you must parse the output of truss to look for the write() calls,
then you must output that to a file and translate it to Pascal,
recompile it, and the execute it and capture the output as Perl
can only capture Pascal program output.

see 'perldoc -f capture' for more details. :-)

Enjoy,

anm
--=20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Andrew N. McGuire                                                      ~
~ anmcguire@ce.mediaone.net                                              ~
~ "Plan to throw one away; you will, anyhow." - Frederick P. Brooks, Jr. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



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

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


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