[16734] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4146 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 27 18:10:26 2000

Date: Sun, 27 Aug 2000 15:10:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <967414214-v9-i4146@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 27 Aug 2000     Volume: 9 Number: 4146

Today's topics:
        Online Perl Study/Reference Guides <mc@backwoods.org>
    Re: Parsing a Excell table - or - a "Tab New_Line" text <jeff@vpservices.com>
    Re: Regexp Question (Alan Barclay)
    Re: robot (brian d foy)
    Re: selling perl to management (Ilya Zakharevich)
    Re: Stumped by Reg Exp Problem - help?? (brian d foy)
    Re: stupid question probably (brian d foy)
    Re: stupid question probably (brian d foy)
    Re: stupid question probably (brian d foy)
        Temporary Random Dir/File <brock_johnson@my-deja.com>
    Re: Temporary Random Dir/File <godzilla@stomp.stomp.tokyo>
    Re: URLs ending in / (brian d foy)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sun, 27 Aug 2000 17:23:30 -0400
From: MC <mc@backwoods.org>
Subject: Online Perl Study/Reference Guides
Message-Id: <39A986D2.E9BD41E@backwoods.org>

I know this has been asked many many times, but ...

Can someone post a few links to online basic perl lessons and references. Also a
few good study books suggestions.

This is for a friend who is interested in learning perl. He is not new to
programming, just wants to learn a new language.

MC
-- 
---------------------------------------------------------------------
My email address(s) are my private property.  They are NOT to be used
or recorded for ANY reason without my explicit permission.  Disregard
of this statement is in violation of federal privacy & copyright law.
---------------------------------------------------------------------
"The world wont end with a bang, or even a whimper, but with an error
message." -- format C:


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

Date: Sun, 27 Aug 2000 11:34:46 -0700
From: Jeff Zucker <jeff@vpservices.com>
To: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Parsing a Excell table - or - a "Tab New_Line" text file?
Message-Id: <39A95F46.ED59D25A@vpservices.com>

[posted and emailed to Bob]

Bob Walton wrote:
> 
> Jeff Zucker wrote:
> > ...
> > Excel *is* an ODBC accessible database.  You don't need to take the
> > information out of Excel into something else and then put it back into
> > some other ODBC source, you just access the Excel spreadsheet just like
> > any other DBI database:
> > ...
> 
> Jeff, thanks very much for your input -- I didn't know you could do that
> with Excel.  Where does one find docs on this?

The only mention of it I've ever found is on the ADO connection
information pointed to by Tom Lowery at:

	http://tlowery.hypermart.net/perl_dbi_dbd_faq.html

I just looked at that and started fooling around.  BTW, you can also
access Excel with Tom's DBD::ADO though that came as a surprise to him
when I pointed it out.

>  -- I looked through
> everything I've got on Excel, and it is not mentioned. 

Must be one of those well kept Redmond secrets :-).

> I think I'll use
> this method most of the time from now on, rather than OLE.

Sure seems like a more straightforward and portable route.

> I found, though, that some of the stuff in your example code isn't quite
> right

My example works fine for me and should work for a spreadsheet without
named ranges.  Your example is one way of dealing with named ranges,
I've also used other methods which I can't put my hands on right now but
could look up if you're interested.  It may also have to do with ODBC
versions.  I've found the DSN-less connection strings to be very useful
but also very picky.

-- 
Jeff


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

Date: 27 Aug 2000 18:12:39 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: Regexp Question
Message-Id: <967399950.845233@elaine.furryape.com>

In article <39A72A0C.237BC6DA@wsb.com>, Jeff Helman  <jlhelman@home.com> wrote:
>cghawthorne@yahoo.com wrote:
>If we can assume that you are running Apache on some flavor of /*+nix/,
>then the following should work (diddle as needed):
>
>my $Image = "/home/person/public_html/img.gif";
>$Image =~ s!^/home/!www.someserver.com/~!;

This assumes that the home directory is under /home, which is not
universally true. Some versions of unix have different defaults (/u
is also common), and any user can be placed in any directory.

A better solution would be to read in the password file, and check the
directory in the supplied path against each user's home directory. You
could find duplicates, you'll need to decide on rules to handle this.

Look at getpwent()


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

Date: Sun, 27 Aug 2000 17:25:36 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: robot
Message-Id: <brian-ya02408000R2708001725360001@news.panix.com>


[reformated for truculent poster inanity]

In article <39A612A0.1C72F310@shentel.net>, Albert Dewey <timewarp@shentel.net> posted:

> > hello
> > i'm new in this group
> > first, i wanna know how the web robot is made and moreover  the examples

> Hmmmmm, another newcomer who wants all our most top secret codes and he
> hasn't even taken off his coat yet!

what's this "we" stuff.  you're the one who wants to be an 
individual.

the original poster can see the various modules on CPAN (including
WWW::RobotRules) as a start.

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


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

Date: 27 Aug 2000 21:52:46 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: selling perl to management
Message-Id: <8oc2je$qda$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was NOT sent to Martien Verbruggen
<mgjv@tradingpost.com.au>],
who wrote in article <slrn8qhskl.3fr.mgjv@martien.heliotrope.home>:
> > Having discussions does not guarantie anything.  Since Perl has no
> > documentation on the "this is guarantied to work" level of strictness,
> > any discussion like this degenerates into "subjective" estimates like
> 
> Nope. It doesn't,

[Note that it is not clear what is "Nope"ated, and what is "It".
Relevant for your other argument. ;-]

[Aha, I think I've understood it now.  Your "Nope" is just "No".  ;-)
I somehow thought that it was "You are wrong", not "The thing you are
negating is wrong".]

> But I can turn the argument around again. No standard out there
> guarantees anything either.

Yes it does.  As a minimum, it guarantees a level ground for
discussions of backward compatibility.

> > Existence of a couple of examples where backward compatibility was
> > preserved does not preclude hundreds of examples when changes broke
> > (intentionally or not) previously working scripts.
> 
> Yes, obscure things broke. Abigail had one or two things break in her
> one-liners againts 5.6.0. Most things will keep working. Hardly any
> production code that has been written for maintainability breaks.

If in a 2000-line-long script/module only 0.1% of lines broke (and you
do not know which), your argument does not quiet the worries.  And
keep in mind that documentation does not say which features are
"obscure", which are basic.  There *should* be a subset defined which is
guarantied to stay put.

If we break this guarantee, we will be obliged to support the users by
providing tools to find the dangerous pieces of the code (say, a
special category of warnings).

> > > The problem is not as much with you stating that Perl changes, but with
> > > the implication that _only_ Perl changes, and that it is because of it
> > > not being a standardised language.
> > 
> > The problems with this is that you imply that Perl is a standardised
> > language.  It is not.  Very little [my estimates are 60%] of essential
> 
> I do not imply that, never have, and never will, until it _is_
> standardised. Please do not put words in my mouth. In fact, if you read
> that paragraph again, you will note that I _explicitly_ state that Perl
> is not standardised.

I tried again, and I still cannot see this.  I read what you wrote as
"'The statement suggesting that Perl is not standardised' is problematic".

In my experience the sentences which may be interpreted as having
a double negation *will* be misread - at least on Usenet.

> And again, as before in the past, we agree on this. Perl needs better
> and more formal documentation. But that is a point that is beside the
> discussion at hand. perl is in no more or less danger of breaking things
> between versions than other pieces of software are. Even standardised
> pieces of software.

[Again, I addressed this several times in the past. ;-]

Your experience with software looks severely limited.  Reading your
statement I think about toy systems like *nix and Win*.  As people
working on mainframes will tell you, given enough incentive, it *is*
possible to preserve backward compatibility even when doing quite
radical changes.  Even some toy systems like OS/2 show *hundreds*
times better backward compatibility than Perl.

It costs.  It requires dedication.  But it is possible.

Thanks for a thoughtful discussion,
Ilya


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

Date: Sun, 27 Aug 2000 17:05:45 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Stumped by Reg Exp Problem - help??
Message-Id: <brian-ya02408000R2708001705450001@news.panix.com>

In article <eli$0008252327@qz.little-neck.ny.us>, Eli the Bearded <elijah@workspot.net> posted:

> (Although accepting HTML in <TEXTAREA>s is a bad idea.)

it's not necessarily a bad idea, but you should know what you 
are doing.  it's when you decide to display it that the problems
come up :)

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


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

Date: Sun, 27 Aug 2000 17:28:26 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: stupid question probably
Message-Id: <brian-ya02408000R2708001728260001@news.panix.com>


[jeopardy posting fixed]

In article <39A676E2.545BD76E@shentel.net>, Albert Dewey <timewarp@shentel.net> posted:

> Thierry wrote:

> > My Perl script works alone, but
> > How the hell can I insert a small Perl script within my existing HTML page.
> > For exemple to write date....

> Does it drink alone as well?
> 
>  $Time = scalar localtime(time);

of course, that's more simply written as

   $time = localtime;


> And put $Time in your html where you want the date to appear using
> substitution. This will give you a full date string w/ time as well but I
> suggest you read the Perl faq on how to parse out the individual internal
> components to yield just the date pieces you want and in what order you want
> them. Or, maybe someone else here will make it easy for you and write the
> entire routine out for you. 

of course, there is CPAN which has plenty of re-useable code.


> This is a topic covered in most Perl books for
> beginners, 

i haven't seen a beginner Perl book that discusses templating
kits for HTML.  perhaps you haven't either.

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


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

Date: Sun, 27 Aug 2000 17:30:45 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: stupid question probably
Message-Id: <brian-ya02408000R2708001730450001@news.panix.com>

In article <39A688C7.1EEE5CB4@shentel.net>, Albert Dewey <timewarp@shentel.net> posted:

> Here is the html page that you would save as a template called date.txt  -
> -------------------------------------------------
> <html>
> <head>
> <title>Date Page</title>
> </head>
> <body>
> The current date and time is - $Time.
> </body>
> </html>

> Notice the $Time place marker.

that's a stupid way to make places.  there should be something
on either side of the token to set it off from the template.

but, rather than worry about that, use one of the templating
systems already on CPAN.

   <URL:http://search.cpan.org>

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


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

Date: Sun, 27 Aug 2000 17:32:42 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: stupid question probably
Message-Id: <brian-ya02408000R2708001732420001@news.panix.com>

In article <39A68168.A5BBEF2B@sdrc.com>, Joe Rocklin <Joe.Rocklin@sdrc.com> posted:

> If you want to put it into an existing HTML page (not a CGI) than just use
> javascript, it's a lot easier than converting to a CGI simply to put the date
> in.

however, with such a limited language, that is all you would
get to do.  as the original poster noted, he was only using
the date as a simple example.

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


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

Date: Sun, 27 Aug 2000 18:33:22 GMT
From: Brock <brock_johnson@my-deja.com>
Subject: Temporary Random Dir/File
Message-Id: <8obmti$rmd$1@nnrp1.deja.com>

I am trying to initiate a form that anyone visiting my website may use that
will allow them to unzip a zip file. I need help managing temporary unzipped
directories and files for those that need to unzip files, but may not have
access to a program like WinZip.

Since zip files can extract to one or more files or directories, I need my
script to automatically extract to the amount of folders(directories) and
files needed.

I want this all to be done inside of a directory named "tmp," and each time
it is used to make a unique name for the sub file(s)/directory(s)... or new
un-zipped file(s)/directory(s) under the "tmp" directory.

Additionally, I need the script, when done, to automatically display the
unzipped URL's to the user for their immediate uploading to their own server
(or downloading to their PC).

The unzipped file/directory needs to automatically remove itself after a
certain amount of time, say 30 minutes. (I'm doing it this way to prevent
including a file upload feature in the script.)

Further, I would like for my perl script to die if my "tmp" directory fills
to more than 5 megabtyes, to keep anyone from overrunning my disk space.

And lastly, I want to limit the program to not accept zip file sizes over
300K.

Complicated? Maybe I should've made this a challenge as another poster
attempted? LOL

Any suggestions or help is greatly appreciated. (I've already researched this
extensively in the perl documentation, but I need more help than is offered
there).

--
The Best to all!
Brock Johnson


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


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

Date: Sun, 27 Aug 2000 12:04:38 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Temporary Random Dir/File
Message-Id: <39A96646.E15DDC4B@stomp.stomp.tokyo>

Brock wrote:

(snippage)
 
> I am trying to initiate a form that anyone visiting my website may use that
> will allow them to unzip a zip file. 
 
> Since zip files can extract to one or more files or directories, I need my
> script to automatically extract to the amount of folders(directories) and
> files needed.
 
> I want this all to be done inside of a directory named "tmp," and each time
> it is used to make a unique name for the sub file(s)/directory(s)... or new
> un-zipped file(s)/directory(s) under the "tmp" directory.
 
> Additionally, I need the script, when done, to automatically display the
> unzipped URL's to the user for their immediate uploading to their own server
> (or downloading to their PC).
 
> The unzipped file/directory needs to automatically remove itself after a
> certain amount of time, say 30 minutes. (I'm doing it this way to prevent
> including a file upload feature in the script.)
 
> Further, I would like for my perl script to die if my "tmp" directory fills
> to more than 5 megabtyes, to keep anyone from overrunning my disk space.
 
> And lastly, I want to limit the program to not accept zip file sizes over
> 300K.



Would you like your expectations served on a well polished
silver platter and delivered to your front door?

How annoyingly arrogant of you to come here and demand 
so much for free. Suffering a Superiority Complex?

Superiority Complex: a feeling of superiority or exaggerated 
self-importance, often accompanied by excessive aggressiveness,
arrogance, and the such, which are compensation for feelings
of inferiority. More realistic, an Inferiority Complex.

Such a paradox in syndrome.

Post your script. I would like to view your efforts
at resolving your needs. If you have invested no effort
of your own, can't post your script, bugger off.

Godzilla!


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

Date: Sun, 27 Aug 2000 17:02:55 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: URLs ending in /
Message-Id: <brian-ya02408000R2708001702550001@news.panix.com>

In article <8o5bsc$vca$1@nnrp1.deja.com>, cbdeja@my-deja.com posted:

> What is the difference between the URLs (for example):
> 
>   http://www.acme.com/support
>   http://www.acme.com/support/
> 
> The only difference I could guess at is that the first could concievably
> be referencing a file, whereas the second implies that it MUST be a
> directory.

that's simply wrong.  URL paths do not necessarily lead to anything
in a filesystem.  it depends on how the server is configured.

indeed, the above URLs can return completely different content.  the
first might return HTML, while the second might be a redirection.

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


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

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


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