[11813] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5413 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 18 21:07:30 1999

Date: Sun, 18 Apr 99 18:00:21 -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           Sun, 18 Apr 1999     Volume: 8 Number: 5413

Today's topics:
    Re: +g;r3#,OENGLISH? <cassell@mail.cor.epa.gov>
    Re: %hashName and CGI Question <bseib@purdue.edu>
    Re: %hashName and CGI Question (Tad McClellan)
        A slight teaser....? <stevenabell@hotmail.com>
    Re: Any software convert html code into perl code?? <cassell@mail.cor.epa.gov>
    Re: Any software convert html code into perl code?? (Abigail)
    Re: array names same as file names <aqumsieh@matrox.com>
    Re: attach a subroutine to a filehandle <bseib@jade.cc.purdue.edu>
    Re: attach a subroutine to a filehandle <bseib@jade.cc.purdue.edu>
    Re: Books <uri@home.sysarch.com>
        Changing Names In Database <webdude@mcminn.net>
    Re: FAQ 3.9: Is there an IDE or Windows Perl Editor? <cassell@mail.cor.epa.gov>
        How to execute script on server startup kellykross@my-dejanews.com
        How to execute script on server startup kellykross@my-dejanews.com
    Re: how to make a directory publicly writable? (Tad McClellan)
    Re: how to print random words from array on one line <aqumsieh@matrox.com>
    Re: matching more than one line (Tad McClellan)
    Re: Need example (Tad McClellan)
        need help bad <rusty7@cchono.com>
    Re: need help bad <ffchopin@worldnet.att.net>
    Re: New FAQ: How can I read in an entire file all at on (Sam Holden)
    Re: Numeric String (Abigail)
        Perl and the Windows API <swolfington@home.com>
    Re: perl cgi - want to run on local system (Abigail)
    Re: Probs traversing a directory tree <ffchopin@worldnet.att.net>
    Re: Q: Removing file extentions <aqumsieh@matrox.com>
    Re: Random Integer creation <cassell@mail.cor.epa.gov>
    Re: Random Integer creation (Abigail)
    Re: Standard in from email --> HTML (Abigail)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sun, 18 Apr 1999 15:11:49 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: +g;r3#,OENGLISH?
Message-Id: <371A58A5.93EE49B1@mail.cor.epa.gov>

perl wrote:
> 
> &3(S&3$$$e0Q=W*:&a$h'r?

Pardon me, but the entries to the next Obfuscated Perl contest go to
TPJ, not here.

HTH,
David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: 19 Apr 1999 00:21:31 GMT
From: Broc Seib <bseib@purdue.edu>
Subject: Re: %hashName and CGI Question
Message-Id: <7fdsub$qbe$1@mozo.cc.purdue.edu>

Sushant Gargya <sushant@hindustan.vnet.net> wrote:

> I have some an array, @anArray
> I have a hash called %someHash
> Typical values of anArray are: 12345, XY1234...
> Typical values of someHash are:
>             $someHash{'12345'} = "James",
>             $someHash{'XY1234'}= "Sue", ....

> Using CGI, I have:
> $users = $query->popup_menu(-name=>'merchantID',
>                 -values=>\@anArray,
>                 -labels=>\%someHash);

> I want to be able to SORT the hash with respect to the "Values" of the hash
> as oppose to the keys.

You don't need to "change" your hash. You need to change the order
of your @anArray element according to your sort.

  @anArray = sort { $someHash{$a} cmp $someHash{$b} } keys %someHash;

or...

  @anArray = sort my_sort keys %someHash;

  sub my_sort {
      ## do your own sorting algorithm
  }

Then call your $query->popup_menu() routine as you have written above.

-b


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

Date: Sun, 18 Apr 1999 15:37:34 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: %hashName and CGI Question
Message-Id: <u9cdf7.1l1.ln@magna.metronet.com>

Sushant Gargya (sushant@hindustan.vnet.net) wrote:

: I want to be able to SORT the hash with respect to the "Values" of the hash
: as oppose to
: the keys. 


   Perl FAQ, part 4:

      "How do I sort a hash (optionally by value instead of key)?"


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


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

Date: Sun, 18 Apr 1999 21:37:35 GMT
From: "stevenabell" <stevenabell@hotmail.com>
Subject: A slight teaser....?
Message-Id: <zgsS2.1356$C76.597@c01read02.service.talkway.com>

Dear All,

I'm having a few problems trying to get a small program to work.
The program is split up into small parts, each performing a specific
function. Here is what I am trying to do:

1. Treat a file, named  file01  such that a variable can be assigned
depending on the number of "/"s in its physical location. For example,
if  file01  had the location

/usr/local/cgi-pub/depth1/file01

then the variable would have a value of 5.

2. Treat thefile so that each word which occurs within
it appears on a separate line, and write the results of this to a
file named  file01.sline

I presume that I must use the  sort  command in some way?

3. Once each words appears on a separate line, compare  file01.sline
with another file, named  stoplist  , so that each term which appears
in  stoplist  is taken out from  file01.sline  , and write the results
of this to  file01.stop

For example, if the words  "and", "of" and "the" were in  stoplist
and  file01.sline  contained:

The 
cat 
and 
the 
dog 
sat 
on 
the 
mat

Then  file01.stop  would be:

The
cat
dog
sat
on
mat

4. Compare  file01.stop  so that if any of the words match with the
words in another file, named  check  then  file01.stop  is copied and
placed into a unique directory.

Hope that someone will be able to help me out here. Absolutely any
suggestions or pointers would be sincerely appreciated.

Kindest regards,

Steve Bell

--
Posted via Talkway - http://www.talkway.com
Exchange ideas on practically anything (tm).



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

Date: Sun, 18 Apr 1999 15:10:35 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Any software convert html code into perl code??
Message-Id: <371A585B.4FE03FCA@mail.cor.epa.gov>

Tim Herzog wrote:
> 
> In article <7fc6t0$5pv11@news1.cityu.edu.hk>, "Kevin
> !;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;" <austin95002887@yahoo.com>
> wrote:
> 
> >Any software convert html code into perl code??
> 
> That's like trying to convert gasoline into paint.  HTML is a language
> used to describe page content to a web browser.  Perl is a language used
> to create programs that make a computer do something (hopefully) useful.
> Except that perl is often used to create programs that themselves create
> HTML code (that gets sent to a web browser), the two have nothing to do
> with each other.

Or perhaps it's more like trying to convert gasoline into a car with
a full tank.

Or trying to convert paint into a painted house.  You can use the house
for a million things other than protecting walls.

Well, at least he didn't ask for a perl-to-java converter.  :-)

David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: 18 Apr 1999 23:57:41 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Any software convert html code into perl code??
Message-Id: <7fdrhl$2c3$2@client2.news.psi.net>

Kevin !;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;!;
(austin95002887@yahoo.com) wrote on MMLVI September MCMXCIII in <URL:news:7fc6t0$5pv11@news1.cityu.edu.hk>:
$$ 
$$ Any software convert html code into perl code??

It can't. They are in different domains. Perl is a computer programming
language, that is, it can solve a subset of the computable problems and
on top of that, has some computer related side-effects (like I/O).

HTML "code" is text _markup_. It doesn't compute, it defines.


Abigail
-- 
perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-


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

Date: Sun, 18 Apr 1999 15:18:45 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
To: "W. Thompson" <wthompso@bbn.com>
Subject: Re: array names same as file names
Message-Id: <x3yvhethh4b.fsf@tigre.matrox.com>


"W. Thompson" <wthompso@bbn.com> writes:

> I have a directory of files:  dog, armadillo, horse.  It is a dynamic
> directory, so that files may quietly appear or disappear at any time. 
> Perhaps 'moose' gets added.
> 
> I am trying to create arrays in perl that use the names of the files: 
> @dog, @cat, @horse, @moose (when it shows up), whose elements are the
> lines from each file.
> 
> @dog = contents of file dog
> @armadillo = contents of file armadillo, etc.
> 
> I want to be able to accomodate the dynamic nature of the files'
> directory.
> 
> Creating a list (array) of the file names is not a problem, but how do I
> create the arrays based on the filenames? Then how do I read those files
> into their appropriate arrays, such that @dog's elements are the lines
> from the file 'dog'? 

Well, if I were you I wouldn't be strictly using arrays. Life would be
a lot easier if you used a hash of arrays instead. Read perldsc if you
are not familiar with complex data-structures in Perl. Here's what I
would do (untested code):

	my %hash;	# hash to store arrays

	opendir DIR, '/my/dir' or die "opendir failed: $!\n";
	my @files = grep { !/^\./ } readdir DIR;
	# this gets rid of any dot files.
	close DIR or warn "Error closing dirhandle: $!\n";

	for my $file (@files) {
		open F, "/my/dir/$file" or 
			die "Couldn't open $file: $!\n";
		@{$hash{$file}} = <F>;
		close F or warn "Problem closing $file: $!\n";
	}

Now, to access the array for "dog", you would do:
	@{$hash{'dog'}}

Notice how the use of a hash nicely fits your problem.

HTH,
Ala



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

Date: 19 Apr 1999 00:31:07 GMT
From: Broc Seib <bseib@jade.cc.purdue.edu>
Subject: Re: attach a subroutine to a filehandle
Message-Id: <7fdtgb$qbe$2@mozo.cc.purdue.edu>

Corey Saltiel <corey@americanrecruitment.com> wrote:

> Is it possible to open a filehandle as a pipe ( or alias/reference ...
> thingy ) to a subroutine within the same script?  

> Am I even making any sense?   (c;

You might look at 'perldoc perltie' which talks about how to write
code to implement a "tied" perl variable. Specifically, look at TIEHANDLE
in the docs. This lets you do "something" when activity takes place
on a filehandle.

-b


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

Date: 19 Apr 1999 00:34:10 GMT
From: Broc Seib <bseib@jade.cc.purdue.edu>
Subject: Re: attach a subroutine to a filehandle
Message-Id: <7fdtm2$qbe$3@mozo.cc.purdue.edu>

Corey Saltiel <corey@americanrecruitment.com> wrote:

> Is it possible to open a filehandle as a pipe ( or alias/reference ...
> thingy ) to a subroutine within the same script?  

> Am I even making any sense?   (c;

You might checkout 'perldoc perltie' which talks about how to
implement a "tied" perl variable. Specifically, look at TIEHANDLE
in the docs. This lets you do "something" whenever there is activity
on a filehandle. You would "tie" your filehandle to code that you
write which behaves accordingly when there is I/O.

-b


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

Date: 18 Apr 1999 18:33:21 -0400
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: Books
Message-Id: <x7n205lfta.fsf@home.sysarch.com>

>>>>> "SM" == Sean McAfee <mcafee@waits.facilities.med.umich.edu> writes:

  >> What are some other bookstores that are cheap. I know of
  >> barnesandnoble.com as well as borders.com, but any others?

  SM> There's bookpool.com.  Technical books only.  I've only ordered a
  SM> couple of books from them, but their discounts seem to regularly
  SM> be at least twice those of amazon.com.

bookpool doesn't give those associate kickbacks like most of the others
do. that %15 goes to your savings. their weboste is mediocre, so what i
do is use amazon or B&N for searching and reviews, etc. and then buy
from bookpool.  someone else said they can be out of stock sometimes but
at least they don't list a book until they have it. amazon and the other
biggies will list a book weeks in advance which can be very annoying.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Mon, 19 Apr 1999 00:51:21 GMT
From: "JJ" <webdude@mcminn.net>
Subject: Changing Names In Database
Message-Id: <d6vS2.2108$94.807382@news1.usit.net>

I have a script that grabs info from a database. What I want to do is rename
the first field with a defined name depending on what the first field reads.
Example: the database has ^DJI in the first field of the first line in the
database and I want it to convert ^DJI to Dr. Jerry Isabell then the first
field of the next line in the database might read ^DRW and I want to convert
it to Dr. Robert Williams. I hope this is enough info :}




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

Date: Sun, 18 Apr 1999 15:20:57 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: FAQ 3.9: Is there an IDE or Windows Perl Editor?
Message-Id: <371A5AC9.A22CC98E@mail.cor.epa.gov>

Tom Christiansen wrote:
> 
>  [snip of well-written, evangelical text]
>
>     PerlBuilder (XXX URL to follow) is an integrated development
>     environment for Windows that supports Perl development. Perl
>     programs are just plain text, though, so you could download emacs
>     for Windows (???) or a vi close (vim) which runs on for win32
                                ^^^^^ 
s/close/clone/

Probably Freudian, since you're so `close' to the editor.  :-)

>     (http://www.cs.vu.nl/~tmgil/vi.html). If you're transferring
>     Windows files to Unix, be sure to transfer in ASCII mode so the
>     ends of lines are appropriately mangled.

David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Sun, 18 Apr 1999 23:40:23 GMT
From: kellykross@my-dejanews.com
Subject: How to execute script on server startup
Message-Id: <7fdqh6$vdm$1@nnrp1.dejanews.com>

I have a site that runs on a Apache/1.3.1 Cobalt (Unix) server. I would like
to know if it is possible to have a CGI script execute on startup and remain
present. I share space on this server. The site Admin isnt the helpful type
if possible I would like to enable this myself. Ive tried to execute the
program from browser and telnet command line but it appears to terminate when
exiting or logging off. P.S The script is designed to continuously monitor
files in a directory.

Thanks in advance for any help.
Kelly Kross

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sun, 18 Apr 1999 23:41:46 GMT
From: kellykross@my-dejanews.com
Subject: How to execute script on server startup
Message-Id: <7fdqjp$veq$1@nnrp1.dejanews.com>

I have a site that runs on a Apache/1.3.1 Cobalt (Unix) server. I would like
to know if it is possible to have a CGI script execute on startup and remain
present. I share space on this server. The site Admin isnt the helpful type
if possible I would like to enable this myself. Ive tried to execute the
program from browser and telnet command line but it appears to terminate when
exiting or logging off. P.S The script is designed to continuously monitor
files in a directory.

Thanks in advance for any help.
Kelly Kross

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sun, 18 Apr 1999 15:35:09 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: how to make a directory publicly writable?
Message-Id: <d5cdf7.1l1.ln@magna.metronet.com>

Nick Lee (leenick@interchange.ubc.ca) wrote:

: I've tried the following:

: umask 0;
: mkdir dir, 777;
             ^^^
             ^^^ decimal number, I think you want 0777, an octal number


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


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

Date: Sun, 18 Apr 1999 16:17:17 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: how to print random words from array on one line
Message-Id: <x3yr9phheeq.fsf@tigre.matrox.com>


tzoko1000@my-dejanews.com writes:

> open(INF,"urls.txt") or &dienice("Can't open survey.out");
> @ary = <INF>;
> close(INF);

You need to chomp() off the extra '\n' character at the end of each
line you read.

chomp @ary;



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

Date: Sun, 18 Apr 1999 15:32:58 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: matching more than one line
Message-Id: <a1cdf7.1l1.ln@magna.metronet.com>

paul winston (winstonrp@worldnet.att.net) wrote:

: I am new at perl and I am trying to match text on a log file.  The logs all
: have a time date stamp followed by the fault which is one or more lines
: long.  I am able to match more than one line in the description area, and
: this is because the line never ends.  But I have not been able to match the
: time date stamp and the following line.  I have tried the \n,\r,\f. and
: none seem to help.  Here are a couple of things I have tried.  If anyone
: has any suggestion please let me know.

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

   -w. That is Very Good.

   You are missing "use strict;" there though...


: > ($file) = @ARGV;
    ^     ^

   What are those parenthesis for?


: > open(HANDLE, $file);


   You should check the return value.

   Just because you _ask_ to open a file does not mean that
   you _will_ open a file:

    open(HANDLE, $file) || die "could not open '$file'  $!";


: > while (<HANDLE>) {


   That reads _one_ line.


: > print  if /((99)\n|(Event)|dependency)/msix; #99 for date stamp,  Event
: is 					    #first line of text and 					    #dependency is for 3rd line
: > }
: > 


   If you need to match more than one line, then you need to
   arrange to _have_ more that one line in the string you
   are trying to match against.

   Since you haven't shared the data format with us, I cannot
   suggest how you might go about getting more than one
   line into a string to search.


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


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

Date: Sun, 18 Apr 1999 15:40:02 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Need example
Message-Id: <iecdf7.1l1.ln@magna.metronet.com>

Jim (jim@newglobal.net) wrote:

: I've been searching for an example of how to pass  the contents of one
: form to another.
: What I want to achieve is a form that when a user chooses option(1) then
: the user will be served another script, and another form. Same for
: option(2), etc....

: If there's a howto someone could direct me  to I'd be very grateful,


   What is your Perl question?

   This is the Perl newsgroup.

   The answer to your question is likely "hidden" is a newsgroup
   that is connected in some way to WWW stuff. 

   This is not such a newsgroup.


   This is:

      comp.infosystems.www.authoring.cgi


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


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

Date: Sun, 18 Apr 1999 12:24:21 -1000
From: "Nathan Nakao" <rusty7@cchono.com>
Subject: need help bad
Message-Id: <7fdlvh$g16$1@eskinews.eskimo.com>

I don't know.  I guess I'm just not gettting it. I have a quick question.

I'm trying to run a formmail.pl script but everytime I execute it from a
html form I get a "Method not implemented" error.  what' am I doing wrong?

Please help.

Nate




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

Date: Sun, 18 Apr 1999 20:15:00 -0400
From: "Jason Simms" <ffchopin@worldnet.att.net>
Subject: Re: need help bad
Message-Id: <7fdte5$lpk$1@bgtnsc02.worldnet.att.net>

Nathan Nakao <rusty7@cchono.com> wrote in message
news:7fdlvh$g16$1@eskinews.eskimo.com...
> I don't know.  I guess I'm just not gettting it. I have a quick question.
>
> I'm trying to run a formmail.pl script but everytime I execute it from a
> html form I get a "Method not implemented" error.  what' am I doing wrong?

This post is *extremely* unhelpful.  Post the code (all of it, if it's not
too long), the exact error messages produced, what you think should happen,
etc.  And actually, you will find better assistance on this in
comp.infosystems.www.authoring.cgi.  We can't tell you what you're doing
wrong without seeing what you're doing in the first place.

Jason Simms





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

Date: 19 Apr 1999 00:40:19 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: New FAQ: How can I read in an entire file all at once?
Message-Id: <slrn7hkurj.e48.sholden@pgrad.cs.usyd.edu.au>

Dmitry Epstein <mitiaNOSPAM@nwu.edu.invalid> wrote:
>Well, a common program often looks like this:
>
>	read line from file A
>	do something
>	write line to file B
>
>Unless you set large enough IO buffers, this will amount to going back
>and forth between different sections of the hard drive, which, of
>course, will slow you down a lot.  And is there even a command to set
>the size of IO bufers in Perl?

The OS can handle that well enough. Strangely enough when multiple
processes are running disk accesses tend to be very random. The fact that
your program makes requests that two programs make shouldn't hurt the
OS - it copes with the two programs individually after all...

-- 
Sam

I don't want Perl to be beautiful--I want you to write beautiful
programs in Perl.
	--Larry Wall


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

Date: 18 Apr 1999 23:49:54 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Numeric String
Message-Id: <7fdr32$2c3$1@client2.news.psi.net>

Tom Christiansen (tchrist@mox.perl.com) wrote on MMLVI September MCMXCIII
in <URL:news:371a2719@cs.colorado.edu>:
##  [courtesy cc of this posting sent to cited author via email]
## 
## In comp.lang.perl.misc, 
##     Frank de Bot <debot@xs4all.nl> writes:
## :How can I detect whether a string is numeric or not. I know it's some
## :where in the faq's but I couldn't find it anymore.
## 
## YOU CAN'T FIND THE FAQS?

That's not what he said.


Abigail
-- 
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT


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

Date: Mon, 19 Apr 1999 00:32:21 GMT
From: "Scott W" <swolfington@home.com>
Subject: Perl and the Windows API
Message-Id: <pQuS2.17752$PI4.1860@news.rdc2.occa.home.com>

Hi!  I was wondering if there is a way to call Windows API functions
from within Perl?  Is this possible?  Thanks in advance!

Scott





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

Date: 19 Apr 1999 00:18:45 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: perl cgi - want to run on local system
Message-Id: <7fdsp5$2jd$1@client2.news.psi.net>

Forest Johns (fdjohns@home.com) wrote on MMLVI September MCMXCIII in
<URL:news:aGdS2.3895$1q5.3604@news.rdc1.bc.wave.home.com>:
__ I am a web developer and am starting to dable in the programming side of
__ websites. I don't have an ISP that supports cgi on their server, is there
__ any way that I can run cgi scripts on my computer so that I can test cgi
__ scripts without uploading them to a cgi enabled server?

You call yourself a "web developer" and you don't even have access to a
server that has CGI enabled, nor are you able to figure it out yourself?

What's next? "Hi, I am a horseback-rider, but I don't have a
horse."? Consider calling yourself a "web-wannabee".

__                                                          I have download and
__ installed perl,

That's nice. But what has that to do with your problem? And what has your
problem to do with this group?

__                 but I am guessing that I need some way for my computer to
__ take a local http request and run the perl engine. Any help would be greatly
__ appreciated.

You are _guessing_? A _web developer_? Guessing about the basics of HTTP?
And what has the "perl engine" to do with your problem? Or are you even
less clueless than you appear to be in the first two sentences?

Please go away.


Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


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

Date: Sun, 18 Apr 1999 20:22:19 -0400
From: "Jason Simms" <ffchopin@worldnet.att.net>
Subject: Re: Probs traversing a directory tree
Message-Id: <7fdtru$ngh$1@bgtnsc02.worldnet.att.net>

[courtesy CC sent to author]

Dorthe Luebbert <dorthe.luebbert@XREMOVEMEX.ruhr-uni-bochum.de> wrote in
message news:371a3d4a.5550530@news.rz.ruhr-uni-bochum.de...
> Hi experts,
>
> I want to traverse a (local) directory. The script should create an
> index.htm-file in each directory and write the names of all files that
> are stored into the current into this index.htm. And it should also
> write the sub-directory names into the index.htm...
>
> I found the following perl script, changed it a bit, but somehow there
> is an logical error:  The problem is the root directory. No index-file
> is created for the root-directory.  Files that are stored in the root
> directory are written into the last traversed directory.
>
> Any idea, how to change the script?

<SNIP>

You REALLY should probably be using the File::Find module for this.  Not
only does it come free with the standard Perl distribution, but it is easy
to use as well.  Basically, you give it the name of a directory and the name
of a subroutine to execture for each file it finds.  Then, it "spiders", or
traverses, the entire tree of the directory, executing the aformentioned
subroutine.  Variables for the current filename, full path, and others are
automatically created by File::Find, so using them to test for when you
leave a current directory is easy.  Look in the standard Perl documentation
for instructions on how to use this module.  If you need more examples,
e-mail me and I can send you some sample scripts where I have used
techniques similar to what you need.  Perhaps someone else may choose to fix
your existing script, but using File::Find is a much cleaner way to work, in
my opinion.

Jason Simms




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

Date: Sun, 18 Apr 1999 15:21:46 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Q: Removing file extentions
Message-Id: <x3yso9xhgz9.fsf@tigre.matrox.com>


me@here.com writes:

> 	Does anyone have a sly method (must be CPU friendly, some of
> these directories hold 2,000 files) which will remove only the last
> instance of a period and any characters following?

$file =~ s/\.[^.]*$//;



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

Date: Sun, 18 Apr 1999 15:53:50 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Random Integer creation
Message-Id: <371A627E.232C6D3C@mail.cor.epa.gov>

Tim Connolly wrote:
> 
>     I'm trying to create a random integer value using perl. I am
> currently using /dev/random but I'm not having much lunch getting only
> the integers from the output, any suggestions ?

Why don't you try rand() and int() ?  Then you won't need to shell out
to get your output?  Of course, rand() is at the mercy of your C
library.

David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: 19 Apr 1999 00:23:23 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Random Integer creation
Message-Id: <7fdt1r$2jd$2@client2.news.psi.net>

Tim Connolly (kb8eht@access.mountain.net) wrote on MMLVI September
MCMXCIII in <URL:news:371A29C2.74E253F9@access.mountain.net>:
**     I'm trying to create a random integer value using perl. I am
** currently using /dev/random but I'm not having much lunch getting only
** the integers from the output, any suggestions ?

/dev/random has nothing to do with Perl, but is an OS specific
device. Consult the documentation of your OS for /dev/random.

As for Perl, an appropriate combination of int() and rand() will
do. Look up both functions in the documentation, and ask again if
you cannot figure it out.



Abigail
-- 
perl -wle '$, = " "; print grep {(1 x $_) !~ /^(11+)\1+$/} 2 .. shift'


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

Date: 19 Apr 1999 00:31:28 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Standard in from email --> HTML
Message-Id: <7fdth0$2jd$3@client2.news.psi.net>

jnoviell@my-dejanews.com (jnoviell@my-dejanews.com) wrote on MMLVI
September MCMXCIII in <URL:news:7fbg2l$56o$1@nnrp1.dejanews.com>:
\\ Greetings,
\\ 
\\ I have a simple perl script (on a UNIX box)that reads in the emails messages
\\ (using standard in, not a POP login) and displays them on web pages(actually
\\ inserts them into a database first). But, I'm having problems converting
\\ French characters.
\\ 
\\ eg: An email message has h as a character
\\ 
\\ but displaying it in HTML gives =E9

I doubt so. It's very likely the email contains '=E9' and your mail
reader translates that to h. Now, when you blindly copy your mail
to HTML, =E9 remains =E9, as HTML has no idea about the encoding
(quoted printable) being used between the two mailers. (Sender's email
program encodes it, receiver decodes it).

\\ Is there a way to convert it into its real character (or HTML character)to
\\ display it on the web (like Hotmail.com can do).

h is a valid HTML character.

\\ With a search and replace pattern matching, I risk converting real equations
\\ eg: 40+50=90 (with would replace =90 with the ASCII equivalent)

No you won't, as the quoted printable encoding encodes = as =3D.

\\ Any suggestions to solve the above would be appreciated.

You would have to decode all the possible decodings. quoted-printable,
base64, uuencode, split multipart MIME-documents into different documents,
etc.


Of course, non of this is Perl specific, you would have to do the same
if you would do it in smalltalk. In fact, there isn't a Perl question in
your entire posting.



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


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

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

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