[10615] in Perl-Users-Digest
Perl-Users Digest, Issue: 4207 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 12 17:07:15 1998
Date: Thu, 12 Nov 98 14:00:19 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 12 Nov 1998 Volume: 8 Number: 4207
Today's topics:
Re: & for subroutines Was:Re: Perl "Newbie" Needs Help tcpeter@iname.com
Re: Backtick blocking problem <rootbeer@teleport.com>
Re: Backtick blocking problem <campb@think.ucdavis.edu>
Re: Breathtakingly concise Perl code (M.)
Re: Comparing Arrays -- infinite loop? (Tad McClellan)
Comparison routine problem. <chrknudsen@hotmail.com>
Re: Comparison routine problem. (Sam Holden)
Re: Compiling XS's using GCC 2.8.2 (MingWin32) for Acti (Nathan V. Patwardhan)
DB-File on SCO Unix <luxup@ix.netcom.com>
Re: External call to sh with a Pipe <fmikus@americasm01.nt.com>
First Meeting of Humboldt.pm <gbc1@axe.humboldt.edu>
Re: First Meeting of Humboldt.pm (brian d foy)
Re: HELP! Concat'ing multiple variables into one (brian d foy)
Re: Hiding source code from priving eyes (M.)
Re: how to define global variables across files with th <rootbeer@teleport.com>
Re: mod_perl question (Randy Kobes)
Re: New to perl - How do I run a script and view result <rootbeer@teleport.com>
Re: Obtaining CD identification <cavanagh@uvic.ca>
Re: perl/cgi script problem in html (Tad McClellan)
Regular Expressions in Java chris@subtlety.com
Search for a script! <mrobold@ccwn.org>
Re: Type glob in a CGI script <rootbeer@teleport.com>
Re: Where to get Perl source?? <rootbeer@teleport.com>
Win32, Samba and file tailing (Matt Knecht)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 12 Nov 1998 20:35:02 GMT
From: tcpeter@iname.com
Subject: Re: & for subroutines Was:Re: Perl "Newbie" Needs Help Debugging Code
Message-Id: <72fgpn$h0q$1@nnrp1.dejanews.com>
In article <m390hh5rxm.fsf@rand.dimensional.com>,
Daniel Grisinger <dgris@rand.dimensional.com> wrote:
> I can't find many references as to whether upper or lower case is
> quantifiably easier to read, although I suspect that lower case is
> easier for most people.
>From the Yale Center for Advanced Instructional Media Style Guide:
"Avoid all-uppercase headlines - they are much harder to read, because words
formed with capital letters are monotonous rectangles that offer few
distinctive shapes to catch the reader's eye."
Basically, we read by seeing the shape of the word; uppercase is more
shapeless, and is harder to read. Fascinating reading, if off-topic.
http://info.med.yale.edu/caim/manual/pages/typography.html
I tend to use names like this:
sub This_Is_My_Sub{}
Makes the code easy enough to read.
HTH,
Tim
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 12 Nov 1998 20:43:36 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Backtick blocking problem
Message-Id: <Pine.GSO.4.02A.9811121231430.791-100000@user2.teleport.com>
On 11 Nov 1998, Blaise Camp wrote:
> The script exits almost immediately when run on the command line, but
> when I run it in backticks, it stalls indefinitely.
You seem to have given insufficient information to show where the problem
is. Cut your program down to the smallest example which shows the
difficulty, then post that here. Ideally, the shell script can be reduced
to one line (echo "vital data", say) and the Perl should be no more than a
couple of lines. When others are able to replicate your situation, you'll
be more likely to get a response. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 12 Nov 1998 21:10:43 GMT
From: Blaise Camp <campb@think.ucdavis.edu>
Subject: Re: Backtick blocking problem
Message-Id: <72fisj$1hl$1@mark.ucdavis.edu>
Tom Phoenix <rootbeer@teleport.com> wrote:
> On 11 Nov 1998, Blaise Camp wrote:
>> The script exits almost immediately when run on the command line, but
>> when I run it in backticks, it stalls indefinitely.
> You seem to have given insufficient information to show where the problem
Heh, sorry. After cutting down and mangling the scripts to a minimum, here's
something that exhibits the same behavior:
The perl script:
#!/opt/pkg/contrib/bin/perl -w
@resp = `/home/lo/lizardo/start_cron.sh`;
print @resp;
And the shell script:
#!/bin/sh
eval /usr/sbin/cron 1>>/tmp/cronlog.test 2>&1 &
I found that removing the "1>>/tmp/cronlog.test" makes everything work right.
I'm just going to add an option to the startup script which should make this
work right.
Thanks for your time.
-Blaise
------------------------------
Date: Thu, 12 Nov 1998 20:05:16 GMT
From: pub @ alma . ch (M.)
Subject: Re: Breathtakingly concise Perl code
Message-Id: <364b3f0d.174722592@news.urbanet.ch>
>@spell{ /"(.+?)"/ } = [ /[A-Z]\d?(?=[,}])/g ] while <DATA>;
Training for next year's obfuscated Perl contest?
:-)
------------------------------
Date: Thu, 12 Nov 1998 16:14:25 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Comparing Arrays -- infinite loop?
Message-Id: <1kmf27.hiq.ln@flash.net>
Steven May (stevenjm@olywa.net) wrote:
: while(@list){} should ALWAYS be approached with a bit of caution.
: Ask yourself "when will @list no longer return true?". In the loop you
: have below, it's always 'true'
Bzzzt!
: and so the loop will spin endlessly....
: The while(@list) block needs to do something to reduce list to 0 in
: order for the while to terminate automatically.
Like 'shift(@list)' for example?
: Oliver Moffat wrote:
: >
: > I'm trying to write a Perl script to automate the updating of a flat text
: > file database. I'm trying to compare the new database of titles to the old
: > databse of titles and get a list of "Brand New Titles."
: >
: > Everything goes fine up untill the following chunk of code where the
: > actual comparison is supposed to happen. When the script gets to this
: > point it gets stuck and just spins its wheels. Is there an infinite loop
: > here? Is there a more efficient way to do this?
: >
: > while (@new_titles)
: > {
: > $i = shift (@new_titles); # grab the title on the top
[snip]
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 12 Nov 1998 21:06:06 GMT
From: "Christian H. Knudsen" <chrknudsen@hotmail.com>
Subject: Comparison routine problem.
Message-Id: <364B4E7D.CDC38B7F@hotmail.com>
I'm trying to build an on-line shop and I've run into a problem. I've
created a subroutine to check if an item is currently in the user's
shopping cart. But... it doesn't work (surprise!).
Here's piece of the code:
### BEGIN CODE ###
### sub to get the cards (the products) from the product list
sub GetCards {
open (CARDLIST, "<$cardlist");
@cardlistline = <CARDLIST>;
close (CARDLIST);
}
### sub to get the cards (the products) from the user's shopping
### cart (works!)
sub GetCart {
open (CART, "<$cart");
@cartline = <CART>;
close (CART);
}
### sub to check if an item is in the user's shopping cart (doesn't
### work!). It always returns 0 (false).
sub incart {
$value = 0;
($testcard) = @_;
$allcartline = join('|',@cartline);
if ($testcard =~ $allcartline) { $value = 1; }
return $value;
}
### END CODE ###
I've checked if the card tested is correct an if the cards from the
shopping
cart are correct. They are! So, I can't figure out what's wrong. Can
you?
Any help is appreciated.
/Christian H. Knudsen
------------------------------
Date: 12 Nov 1998 21:18:48 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Comparison routine problem.
Message-Id: <slrn74mk5o.igg.sholden@pgrad.cs.usyd.edu.au>
On Thu, 12 Nov 1998 21:06:06 GMT, Christian H. Knudsen
<chrknudsen@hotmail.com> wrote:
>I'm trying to build an on-line shop and I've run into a problem. I've
>created a subroutine to check if an item is currently in the user's
>shopping cart. But... it doesn't work (surprise!).
<snip some code>
>### sub to check if an item is in the user's shopping cart (doesn't
>### work!). It always returns 0 (false).
>sub incart {
> $value = 0;
> ($testcard) = @_;
> $allcartline = join('|',@cartline);
> if ($testcard =~ $allcartline) { $value = 1; }
^^^^^^^^^^^^^^^^^^^^^^^^^
What do you think this does? I bet it's different than what perl thinks it
does.
The best solution isn't to fix this code but to go and read the documentation
that came with perl. perlfaq4 contains the following question. The nice
thing is it also has the answer (which I'll leave out since you can look
it up just as easily as I did).
"How can I tell whether a list or array contains a certain element?"
Another comment is that all those variables are global. use strict is good,
you should try using it.
--
Sam
People get annoyed when you try to debug them.
--Larry Wall
------------------------------
Date: Thu, 12 Nov 1998 21:56:14 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Compiling XS's using GCC 2.8.2 (MingWin32) for ActivePerl 506 -
Message-Id: <2QI22.103$fs.12573@news.shore.net>
: Innovative Air Systems wrote:
: > ActivePerl 506 seems to be made using MSVC, but I'd like to use GCC 2.8.2
: > (Mingwin32 release) to make XS's into DLLs.
Why not just build your own Perl with mingw32?
--
Nate Patwardhan|root@localhost
"Fortunately, I prefer to believe that we're all really just trapped in a
P.K. Dick book laced with Lovecraft, and this awful Terror Out of Cambridge
shall by the light of day evaporate, leaving nothing but good intentions in
its stead." Tom Christiansen in <6k02ha$hq6$3@csnews.cs.colorado.edu>
------------------------------
Date: Thu, 12 Nov 1998 15:07:11 -0500
From: "Fred" <luxup@ix.netcom.com>
Subject: DB-File on SCO Unix
Message-Id: <72ffa1$ae6@dfw-ixnews8.ix.netcom.com>
Re: Inability to build Perl with DB_File (flavors) on SCO Unix
All our attempts to build Perl (5.005.02) on SCO_SV (3.2v5.0.4)
with either DB_File (1.60) or BerkeleyDB (0.04)
using Berkeley DB (2.14.04) fail.
We do not have a version 1 of Berkeley DB installed.
<db.h> in /usr/local/include
libdb.a in /usr/local/lib
Perl configuration informs of inability to use db.h, then
removes -ldb from libs line.
If we restore -ldb in config.h (and define i_db), then
add DB_File as an extension, "make test"
fails upon undefined symbols:
db_open
db_version
If I install Perl without DB_File and attempt to build
DB_File (1.60), its "make test"
fails upon undefined symbols:
db_open
db_version
db_appexit
db_value_set
db_app_init
txn_begin
txn_checkpoint
txn_stat
txn_abort
txn_prepare
txn_commit
txn_id
If I install Perl without DB_File and attempt to build
BerkeleyDB (0.04), its "make test"
fails upon undefined symbols:
db_appexit
db_open
db_version
db_value_set
db_app_init
txn_begin
txn_checkpoint
txn_stat
txn_abort
txn_prepare
txn_commit
txn_id
For the record, my only Perl configuration non-default
is using "/usr/bin" as installation point.
If solution requires installation of Berkeley (1.85),
is there a SCO configuration for that out there?
------------------------------
Date: Thu, 12 Nov 1998 15:01:34 -0500
From: "Mikus, Francois" <fmikus@americasm01.nt.com>
Subject: Re: External call to sh with a Pipe
Message-Id: <364B3E9B.F0EE23B8@americasm01.nt.com>
> Thank you Sam and Sean.
And yes, I did find it in the manual. :-) That will teach me
to be more attentive to the books. substr is nicer than having to
pipe to cut. But, sometimes what gets the job done is not
always the nicest of the fastest.
Take care.
Francois
------------------------------
Date: Thu, 12 Nov 1998 13:16:10 -0800
From: Greg Coit <gbc1@axe.humboldt.edu>
Subject: First Meeting of Humboldt.pm
Message-Id: <364B501A.5499CE6C@axe.humboldt.edu>
The first meeting of the Humboldt.pm Perl Mongers group will be held at
Humboldt State University in Arcata, CA at 6pm on Wednesday Dec 2nd.
All interested students, staff, faculty, and community members are
invited. Please email gbc1@axe.humboldt.edu for more information and
meeting location.
Greg Coit
gbc1@axe.humboldt.edu
------------------------------
Date: Thu, 12 Nov 1998 16:50:07 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: First Meeting of Humboldt.pm
Message-Id: <comdog-ya02408000R1211981650070001@news.panix.com>
In article <364B501A.5499CE6C@axe.humboldt.edu>, Greg Coit <gbc1@axe.humboldt.edu> posted:
> The first meeting of the Humboldt.pm Perl Mongers group will be held at
> Humboldt State University in Arcata, CA at 6pm on Wednesday Dec 2nd.
Perl Mongers has assimilated my alma mater. the cirlce is complete.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Go Jacks!
------------------------------
Date: Thu, 12 Nov 1998 16:48:25 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: HELP! Concat'ing multiple variables into one
Message-Id: <comdog-ya02408000R1211981648250001@news.panix.com>
In article <364B3537.863834D4@ultrainteractive.com>, dlincoln@ultrainteractive.com posted:
> brian d foy wrote:
> > $search_terms = "$input{'level'},$input{'topic'},$input{'subject'}";
>
> Yup. Been there done that. No dice.
your problem lies elsewhere then. thanks for the stealth CC btw.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Thu, 12 Nov 1998 20:18:53 GMT
From: pub @ alma . ch (M.)
Subject: Re: Hiding source code from priving eyes
Message-Id: <364c40de.175188032@news.urbanet.ch>
>available in source code and one and can change it if one wants. When
>releasing a commercial product however this is a nightmare, the
>cron-jewels (algoririthms etc) are there for the taking. Are there
>methods to prevent this from happening, examples or urls are very much
>appreciated. Things I can come up with are:
>2) Just a brainstorm. Would self-decrypting encrypted programs do the
>trick. But come to think of it. They have to be decrypted before feeding
>them to the Perl interpreter ==> the source is furnerable. Unless I'm
>missing something this isn't gonna work or is it......
It is possible. There were examples of this in the last "Perl Journal"
(or the one before? get all the back issues, they are great reading)
>3) Something from the Basic past when memory was tide. A prog which
>strips of all comments, renames long sensible names fetch_next_key to x
>or X$1. While not execactly hiding the crown-jewels from the priving eys
>of the pirates, one can make life a bit more difficult.
How do you debug/change it later on? This is only good for the
obfuscated Perl contest, but then it's quite far from good enough.
4) Perl2exe (for Windows) from www.demobuilder.com is probably the
real solution you are looking for. It is not free, but then your code
won't be either, so it's fair.
------------------------------
Date: Thu, 12 Nov 1998 20:11:56 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: how to define global variables across files with the "use strict" on?
Message-Id: <Pine.GSO.4.02A.9811121209250.791-100000@user2.teleport.com>
On Tue, 10 Nov 1998, Huar En Ng wrote:
> Seems like the "use strict" would now let me use a variable
> declared in another file.
If you want true global (package) variables, use 'use vars'...
> package Global;
>
> use strict;
>
> BEGIN {
> use Exporter ();
> use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
...as you've done here. $Global::VERSION, e.g., is accessable to every
part of your program. But you don't need to put 'use vars' within a BEGIN
block, in general. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 12 Nov 1998 20:02:54 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: mod_perl question
Message-Id: <slrn74mg87.7dl.randy@theory.uwinnipeg.ca>
On Thu, 12 Nov 1998 12:45:42 -0600,
Tom Meyer <tsmeyer_remove_this_part@fnal.gov> wrote:
>Craig Sprout wrote:
>
>>
>> #!/usr/bin/perl
>> my $r = Apache->request;
>> $r->content_type("text/html");
>> $r->send_http_header();
>> ...
>>
>> Any thoughts or ideas? Thanks in advance for the help. Feel free to
>> email me if you need more information.
>
>Try removing the
>
>#!/usr/bin/perl
>
>line altogether. This does not appear to be needed, or wanted in
>mod_perl. At least it has worked for us.
>
>Craig Sprout wrote:
>
>> I hope that this isn't a newbie question, but I am new to perl, and am
>> having some problems with mod_perl and Apache.
[snip]
>> The problem occurs when I try to access one of the perl scripts in the
>> cgi-bin directory. I get this:
>>
>> "Can't locate object method "request" via package "Apache" at
>> /cgi-bin/myscript.pl line 2."
>>
>> In httpd.conf, I have:
>>
>> PerlModule Apache::Registry
>> <Location /home/httpd/cgi-bin/>
>> SetHandler perl-script
>> PerlHandler Apache::Registry::handler
>> PerlSendHeader On
>> Options ExecCGI
>> </Location>
>>
[snip]
>> The first part of the script follows:
>>
>> #!/usr/bin/perl
>> my $r = Apache->request;
>> $r->content_type("text/html");
>> $r->send_http_header();
>> ...
Hi,
Apache::Registry is used to handle the "usual" cgi-scripts - you
don't need to change anything special for these scripts outside of the
configuration directives you already have (except to ensure the
scripts run under 'use strict' and '-w'). What you have here is
the beginnings of your own module to handle scripts; if this
is really what you want to do, then it should start out as
package Apache::MyModule
use Apache;
use strict;
sub handler {
my ($r) = shift;
$r->content_type('text/html');
$r->send_http_header();
etc
}
Stick this module under the Apache/ directory in your perl lib
(where Registry.pm, etc. lives), and then use
PerlModule Apache::MyModule
<Location /home/httpd/cgi-bin/>
SetHandler perl-script
PerlHandler Apache::MyModule::handler
PerlSendHeader On
Options ExecCGI
</Location>
in your Apache configuration files.
--
Best regards,
Randy kobes
Physics Department Phone: (204) 786-9399
University of Winnipeg Fax: (204) 774-4134
Winnipeg, Manitoba R3B 2E9 e-mail: randy@theory.uwinnipeg.ca
Canada http://theory.uwinnipeg.ca/
------------------------------
Date: Thu, 12 Nov 1998 20:58:56 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: New to perl - How do I run a script and view results offline?
Message-Id: <Pine.GSO.4.02A.9811121258270.791-100000@user2.teleport.com>
On 11 Nov 1998, Lorick wrote:
> I am running win 95/dos on my desktop machine and I am wondering how I
> can run a PERL script at home locally to see how it works before
> uploading it to my provider, because they don't have open CGI access.
Use the CGI module. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 12 Nov 1998 20:12:19 +0000
From: Brad Cavanagh <cavanagh@uvic.ca>
Subject: Re: Obtaining CD identification
Message-Id: <364B4123.704CCE50@uvic.ca>
Brad Cavanagh wrote:
>
> How would I go about determining the CD id code for a CD that's in the
> drive? That's probably not clear, so here's an example. When I run
> xmcd it tells me a "Disc ID" for the CD. The one that's currently in
> there, Dire Straits' "Money For Nothing", had a Disc ID of "b50f8d0c".
> How do I find that ID? Oh, and this is running under Linux 2.0.35, so
> there should be any Win-related oddities.
I don't think I was too clear with that. I can find that Disc ID if I
have the Table of Contents (TOC) for a CD, and that I know how to do.
What I want to know is how to find the TOC with Perl, from which I can
determine the Disc ID. The TOC is basically a listing of track numbers,
followed by the length of each track. If there's an easy way (or not so
easy) to find this, I'd appreciate finding out.
Brad.
------------------------------
Date: Thu, 12 Nov 1998 16:20:32 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: perl/cgi script problem in html
Message-Id: <gvmf27.hiq.ln@flash.net>
Mark N. Salvador (markns@nsclub.net) wrote:
: im creating a counter for my website and when i attach the
: <!--#exec cgi="http://www....../cgi-bin/counter.cgi"--> to the html file, it
: cannot execute.... why?
: the script file is located in cgi-bin directory
: can anyone help me regarding this....
There is no Perl in the question above.
This is the Perl newsgroup. Things Perl are discussed here.
Things CGI and SSI are discussed in other newsgroups:
comp.infosystems.www.advocacy
comp.infosystems.www.announce
comp.infosystems.www.authoring.cgi
comp.infosystems.www.authoring.html
comp.infosystems.www.authoring.images
comp.infosystems.www.authoring.misc
comp.infosystems.www.browsers.mac
comp.infosystems.www.browsers.misc
comp.infosystems.www.browsers.ms-windows
comp.infosystems.www.browsers.x
comp.infosystems.www.misc
comp.infosystems.www.servers.mac
comp.infosystems.www.servers.misc
comp.infosystems.www.servers.ms-windows
comp.infosystems.www.servers.unix
comp.infosystems.www.providers
comp.infosystems.www
comp.infosystems.www.users
Try one of those.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 12 Nov 1998 19:47:36 GMT
From: chris@subtlety.com
Subject: Regular Expressions in Java
Message-Id: <72fe0p$ee9$1@nnrp1.dejanews.com>
I was wondering if anyone thought it was a good idea to build a generic
regular expressions package in Java. I was thinking about something
structured like the JDBC or security package, where different providers could
dynamically register their RegEx engines, and users could request services
either generically or specifically. This would require defining an
Expression interface (that would convert an expression string like "*.exe" or
"^([^\t]+) \t" into a standard format), a definition for the standard format
that all the RegEx engines would understand, the interface for the RegEx
Engine class, and all the classes that would hook these elements together.
What do people think? Good idea? Bad idea? Anyone interested in working on
it? I don't have enough experience in building RegEx parsers to do it
myself.
-- Chris
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 12 Nov 1998 22:51:31 +0100
From: Markus Robold <mrobold@ccwn.org>
Subject: Search for a script!
Message-Id: <364B5861.9BE80ABF@ccwn.org>
Hello all,
sorry for my bad english!
I search for a script which must the following do:
I needed for a radio-station. The script must show on the time which i
load the web-page the radio-show which is now to hear at the station.
That mean: a script which check the time and display a text which i have
listed in a text-file. Example:
Now it4s 7:05 A.M.
I load the web-page and will see:
NOW ON XY-RADIO:
The Morning Show with D.J. Tom
and at 8:00 pm the music-box
The script takes the text out of a file (example):
07.00-08.00 | The Morning Show with D.J. Tom
and at 8:00 pm the music-box
08.00-09.00 | Music-Box with Max
Can someone help me and say, who i can find a script which these things
do?
Greeting from Germany
Markus
Please answer direct to me: mrobold@ccwn.org
------------------------------
Date: Thu, 12 Nov 1998 21:17:36 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Type glob in a CGI script
Message-Id: <Pine.GSO.4.02A.9811121310430.791-100000@user2.teleport.com>
On Wed, 11 Nov 1998, Richard Kim wrote:
> Subject: Type glob in a CGI script
> I am currently trying to get a listing of certain files from a
> directory using glob.
That's a file glob, not a typeglob. But okay...
> I am able to get the list into an array if I just run the function
> from a command prompt, but when I try to run it from a CGI-BIN,the
> array does not populate.
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
> The only time the array will popoulte is when there are 20 or less
> files in the directory. When the directory holds too many files glob
> doesn't want to work through the CGI.
Sounds like the well-known csh bug; use opendir and friends instead.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 12 Nov 1998 21:29:49 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Where to get Perl source??
Message-Id: <Pine.GSO.4.02A.9811121325280.791-100000@user2.teleport.com>
On 11 Nov 1998, Rick Mallett wrote:
> I downloaded the latest stable version of perl, presumably 5.002_02
> from www.perl.com, using lynx with a suggested filename of stable.tar.gz
> and a file size of 3470355 bytes. I later discovered that 5.0005_02 also
> appears to be available on the gnu machine at mit (prep.ai.mit.edu) with
> the name perl-5.005.02.tar.gz and a file size of 3491732 bytes. Anyone
> know why the two are different and which should I use??
Can't say why they're different, except that maybe the second one was
(re-)compressed with different parameters? But according to my copy of
CPAN/authors/id/GSAR/CHECKSUMS:
'perl5.005_02.tar.gz' => {
'shortname' => 'perl5008.tgz',
'size' => 3470355,
'md5' => 'de99ae45441f3c8c7d0749f35bdf47d5',
'md5-ungz' => '422ac879c6c0fc1fb5d24a64f4537993'
},
So, I'd use the first one. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 12 Nov 1998 20:06:14 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Win32, Samba and file tailing
Message-Id: <WcH22.32514$%X2.3392754@news3.voicenet.com>
I have a Samba device mounted on an NT machine. I'm trying to tail the
file in an infinite loop. The code I have is roughly:
# Read in my saved byte offset from another file
open F, "< $fname", or die "open: $!";
seek F, $byte_offset, 0 or die "seek: $!";
for (;;) {
$line = <F>;
if (not defined $line) {
close F or die "close: $!";
open F, "< $fname" or die "open: $!";
seek F, $byte_offset, 0 or die "seek: $!";
print "POSITION: ", tell F, "\n";
print "OFFSET: $byte_offset\n";
print "SIZE: ", -s F, "\n";
print "AT EOF? ", (eof F ? 'TRUE' : 'FALSE'), "\n";
sleep 10;
} else {
# Do stuff with F;
$byte_offset = tell F;
# Save away $byte_offset to a hot file
}
}
When I start the program with an offset of 0, it reads the file to the
end without a problem.
When $line becomes undef, because we've hit the end of the file, I dump
my debugging info. Everything looks as it should: POSITION = OFFSET =
SIZE and eof = TRUE. After a while, new information get written to the
file. At that point, POSITION = OFFSET, but they don't match SIZE
(Which, of course, is larger). EOF still returns TRUE, even though
there is more data to read. I've tried closing the filehandle and
seeking on it.
At this point, the only workaround I can think of is to use sysread, and
split lines apart myself, saving partial lines. If it comes to that,
though, I may as well use C.
The only thing I can think of is that this is a problem with Samba.
Does anybody have any clues as to what else could be the problem?
--
Matt Knecht - <hex@voicenet.com>
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 4207
**************************************