[9647] in Perl-Users-Digest
Perl-Users Digest, Issue: 3241 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 24 05:07:19 1998
Date: Fri, 24 Jul 98 02:00:33 -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 Fri, 24 Jul 1998 Volume: 8 Number: 3241
Today's topics:
Apache Script for Automatic Frames (Elliott McGucken)
Re: Apache Script for Automatic Frames (-)
Re: Copyright question (Alexander Weaver)
Re: Copyright question (-)
Re: delete fiel after a certain date (Martien Verbruggen)
Re: Dynamically creating graph images <gjb@crs4.it>
Re: extracting price from string (-)
Re: Help - Need disclaimer for code/exe in pTK and p2xs (Martin Vorlaender)
Re: How to access modem on NT ( terminal and ppp ). (-)
Re: htpasswd (-)
Re: Is Perl Year 1999 Compliant??? (-)
Re: is there a isNumber($aString) function? <ljz@asfast.com>
Re: is there a isNumber($aString) function? <dgris@rand.dimensional.com>
Re: local %ENV buggy with open <qdtcall@esb.ericsson.se>
Re: Location Command (-)
Re: modifying a text file (courtesy)
Problem with 'use strict' pragma <steph@hotkey.net.au>
Re: problem with NS cookies <qdtcall@esb.ericsson.se>
Re: References as strings <jwb79@mail.idt.net>
Request for help with very basic anydbm operation. <paul@opsi>
Re: Running one perl script from within another???? <e.christensen@netjob.dk>
Re: sendmail code (-)
Re: STUMPED!!! (perl trivia) ("Advent Dtp")
Re: threads in perl <simonf@conduit.co.uk>
Re: To STRICT for me ! <jwagner@digilog.de>
updating binary file <ty.wong@utoronto.ca>
Re: W32 Port (Bruce Davidson)
Re: Web mail script (-)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 24 Jul 1998 06:43:00 GMT
From: mcgucken@julian.physics.unc.edu (Elliott McGucken)
Subject: Apache Script for Automatic Frames
Message-Id: <6p9adk$6fv$1@fddinewz.oit.unc.edu>
Hello there. I was wondering if anyone knew how some web pages are able
to automatically split their screens in two every time someone comes by.
In the bottom they usually diplay an add.
tripod.com does this, and so does feedmag.com.
For instance, if one just follows the link
http://www.feedmag.com/html/hotloops_master.html
to the feedmag page, you'll see that the actual html page will be
<HTML>
<TITLE>Hot Loops</TITLE>
<FRAMESET ROWS="*, 72" FRAMEBORDER="NO" BORDER="0" FRAMESPACING="0">
<FRAME BORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0"
SRC="http://www.feedmag.com/cgi-bin/hotloops.cgi" NAME="content">
<FRAME BORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0" SCROLLING="NO"
SRC="http://www.feedmag.com/html/footer_hotloops.html" NAME="bottom">
</FRAMESET>
</HTML>
How do they generate this? How can one do it on their own website?
Also, if I have a block of html code which I need to include on many
pages, can I just write it once in a file, and then make that file a part
of every page's download? I know this can be done with SSI's, but can it
be done with normal html?
Please respond to mcgucken@jollyroger.com
Best, Elliot
------------------------------
Date: Fri, 24 Jul 1998 08:01:11 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Apache Script for Automatic Frames
Message-Id: <35b83f24.27576246@news2.cais.com>
mcgucken@julian.physics.unc.edu (Elliott McGucken) Said this:
>Hello there. I was wondering if anyone knew how some web pages are able
>to automatically split their screens in two every time someone comes by.
>
>In the bottom they usually diplay an add.
>
>tripod.com does this, and so does feedmag.com.
>
>For instance, if one just follows the link
>
>http://www.feedmag.com/html/hotloops_master.html
>
>to the feedmag page, you'll see that the actual html page will be
>
><HTML>
><TITLE>Hot Loops</TITLE>
><FRAMESET ROWS="*, 72" FRAMEBORDER="NO" BORDER="0" FRAMESPACING="0">
><FRAME BORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0"
>SRC="http://www.feedmag.com/cgi-bin/hotloops.cgi" NAME="content">
><FRAME BORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0" SCROLLING="NO"
>SRC="http://www.feedmag.com/html/footer_hotloops.html" NAME="bottom">
></FRAMESET>
>
></HTML>
>
>How do they generate this? How can one do it on their own website?
>
>
>Also, if I have a block of html code which I need to include on many
>pages, can I just write it once in a file, and then make that file a part
>of every page's download? I know this can be done with SSI's, but can it
>be done with normal html?
>
>Please respond to mcgucken@jollyroger.com
>
>
>Best, Elliot
You can't be serious.
Please.
------------------------------
Date: Fri, 24 Jul 1998 05:49:17 GMT
From: weave005@bama.ua.edu (Alexander Weaver)
Subject: Re: Copyright question
Message-Id: <35b81f1a.482406@news.ua.edu>
On Tue, 21 Jul 1998 12:59:29 -0400, Dustin Cobb <dcobb@cyberrealm.net>
wrote:
>I'm a cgi programmer and I've written many scripts for the ISP I work
>for. Recently, I've been told by someone else in our company that the
>scripts that we've written in Perl cannot be copyrighted due to the fact
>that Perl isn't a compiled language. Therefore, we would have to
>re-write most of these scripts in another language (like C/C++) to
>obtain a copyright. Is this true? Can anyone give me an example of
>some software that is written entirely in Perl and is legitimately
>copyrighted?
>
>Thanks.
>
Perl code can be copyrighted just like code written in any other
language. The question is more of accessibility to code. The fact
that perl isn't a compiled language means that anyone using your
scripts can see the code, which makes it possible for them to
ILLEGALLY use some of your code in their own scripts. You have the
same LEGAL protection with perl as with other languages, just not the
same practical protection, as copying perl code does not require
reverse engineering.
------------------------------
Date: Fri, 24 Jul 1998 07:59:53 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Copyright question
Message-Id: <35b83d8c.27167985@news2.cais.com>
>On Tue, 21 Jul 1998 12:59:29 -0400, Dustin Cobb <dcobb@cyberrealm.net>
>wrote:
>
>>I'm a cgi programmer and I've written many scripts for the ISP I work
>>for. Recently, I've been told by someone else in our company that the
>>scripts that we've written in Perl cannot be copyrighted due to the fact
>>that Perl isn't a compiled language. Therefore, we would have to
>>re-write most of these scripts in another language (like C/C++) to
>>obtain a copyright. Is this true? Can anyone give me an example of
>>some software that is written entirely in Perl and is legitimately
>>copyrighted?
>>
Just tell this dolt that he's an absolute moron. Then slap him for
me, because I absolutely hate morons.
What is his reasoning? Is it because uncompiled it could easily be
copied? If that's his reasoning, ask him how I can copyright a book,
magazine, photograph, song, or anything else.
Is his reasoning that since it's not compiled, it's not really a
program? If that's the case, what exactly IS a program?
Perl is an INTERPRETED language. As opposed to C++ which is a
COMPILED language. Both are programming languages. In fact, Perl is
probably becoming very much an equal to C++, at least in a general
sense (I don't want to start a flame war of "but c can do this and
nyahh nyahh nyaa)
Better yet.... just send this guy to the Library of Congress web site
and have him look around for links to copyright information. It will
describe for him the criteria for copyrighting. Maybe he's still one
of those idiots who doesn't realize all of your perl scripts were
copyrighted the moment you wrote them, automatically.
------------------------------
Date: 24 Jul 1998 06:28:55 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: delete fiel after a certain date
Message-Id: <6p99j7$8vu$1@nswpull.telstra.net>
In article <35b7ed79.14787463@news.mci2000.com>,
tony.nelson@mci.com (Anthony Luke Nelson) writes:
> Does anyone have an example of how I could automate deleting
> files say after three business days? We have a common share where
> users exchange files but never seem to delete them. I would like to
> run a batch job every night and check all files and subdirectories
> that are three or more days old. If they exist, delete.
on unix:
find /share/thingie -atime +3 -exec rm {} \;
This will remove all files under /share/thingie that have not been
accessed in more than three days. If you want to run it regularly,
put it in the root's crontab. If you also want to remove directories,
you'll have to use the type qualifier and rmdir. it's all described
in the man pages.
To make it relevant to perl:
If you're on NT, you'll have to roll your own. I suggest using the
File::Find module.
# perldoc File::Find
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Fri, 24 Jul 1998 10:34:40 +0200
From: Gavin Brelstaff <gjb@crs4.it>
Subject: Re: Dynamically creating graph images
Message-Id: <35B84720.E0CECC5B@crs4.it>
It would be possible to generate the graph with client-side
JavaScript (CSJS). But it may not be worth the hassle.
Here is how you might:
1a) ship the data to be plotted to the client inside a js file
that
contains the call:
data( x1, y1, x2, y2, ...............);
1b) Implement function data() to read each arguement into a data
array .
[Else generate the data array using math functions in CSJS]
3) Write a plot function that makes a binary image in format XBM
taking its plot values from the data array. This is the hassle.
4) point an image.src at the string containing that XBM.
5) and then view it [XBM are supported in most browsers]
[This will only give you binary colors e.g. B/W.
In version 4 browsers however you
can hack the CSS to make the foreground colour what you like but
you can't make the background transparent - so no fancy
overlays]
\G
------------------------------
Date: Fri, 24 Jul 1998 07:04:46 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: extracting price from string
Message-Id: <35b8309b.23867330@news2.cais.com>
merzky@my-dejanews.com Said this:
>In article <6p7it4$qs8$1@nnrp1.dejanews.com>,
> dwiesel@my-dejanews.com wrote:
>> Hi,
>>
>> I have a small problem. I have a string could look either like this
>>
>> $string = 'product||500.00||';
>>
>> or like this
>>
>> $string = 'product|||500.00||';
>>
>> I want to extract the price from $string. I have done it like this...
>>
>> $string =~ /\|\|(.*?)\|\|/;
>>
>> but then $1 eq '|500.00'.
>>
>> Can you help me?
>
My usenet feed must have gone off the wagon, I never saw the original
post, just this reply......
but your answer is to use either +, *, or {##,##}
+ means one or more
* means zero or more
{a,b} means at least a, but no more than b. (and absent be, it means
AT LEAST a)
$string =~ /\|{2,3}(.*)\|+/;
now, if it sees two or three pipes, it'll pick up everything between
the 2nd or 3rd pipe and the next pipe
------------------------------
Date: Fri, 24 Jul 1998 06:54:55 +0200
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Help - Need disclaimer for code/exe in pTK and p2xstd(aka perl2exe)
Message-Id: <35b8139f.524144494f47414741@radiogaga.harz.de>
chuckkovacs@my-dejanews.com wrote:
: I've written a useful pTk program, a alarm/reminder thingy.
: 1) written in pTk and available as a .pl
: 2) compiled with p2xstd beta (aka perl2exe)
: I would like to distibute both for free, but what sort
: of disclaimer/legal mumbo-jumbo do I need to include?
The clause "distributed under the same terms as the Perl interpreter"
is IMHO the shortest and best.
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
Cetero censeo | work: mv@pdv-systeme.de
Redmondem esse delendam. | http://www.pdv-systeme.de/users/martinv/
| home: martin@radiogaga.harz.de
------------------------------
Date: Fri, 24 Jul 1998 07:28:15 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: How to access modem on NT ( terminal and ppp ).
Message-Id: <35b836ed.25485847@news2.cais.com>
aml@world.std.com (Andrew M. Langmead) Said this:
>Meng Xiong <xiong@bigfoot.com> writes:
>
>>Is there a module that I can use to establish a ppp connection and a
>>direct dial in connection on Windows NT? Thanks for the help.
>
>Microsoft has a Knowledge Base article on who to start up DUN (Dial Up
>Networking) from the command line in Windows 95
>
><URL:http://support.microsoft.com/support/kb/articles/q145/7/40.asp>
>
>can you do something similar in NT?
>
Why are people still struggling with NT?? It's such a peice of junk.
I mean, I figured once it was common knowledge that it can only handle
one application per server, people would start fdisk'ing and
installing a Unix flavor so they could actually run more than one
application at a time. But NOOOOO..... people are so stuck on getting
masturbated by VARs and marketing reps.
Or do NT users just not read industry magazines?
------------------------------
Date: Fri, 24 Jul 1998 06:57:29 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: htpasswd
Message-Id: <35b82e13.23219300@news2.cais.com>
"J.Adams" <webmaster@ent-media.org> Said this:
>
>
>Im attempting to write a perl script to
>update my .htaccess files but i see two problems..
>if i use the system command htpasswd to update theres no way i
>know of to update confirm the password...
If I understand your problem, you don't know how to compare a user's
new password with that of the encrypted password, right?
Okay, that's an easy one. The first two characters of the encrypted
password are the "salt" used to encrypt. Extract the two characters
and use it in crypt() to encrypt the password you want to compare.
Now if the passwords are the same, the encrypted strings should be the
same as well.
Like this:
$user = $in{'user'};
$password = $in{'old_password'};
open (IN, "/path/password_file");
while (<IN>)
{
next unless $_ =~ /^$user/;
($user_pw, $passwd_pw) = split(/:/, $_);
}
$salt = $passwd_pw;
$salt =~ /\w\w/;
$crypt_password = crypt($password, $salt);
if ($crypt_password eq $passwd_pw)
{
the passwords match........
}
else
{
passwords don't match.........
}
>
>if i use the crypt method the password file...
>
>help.. i can't pay someone 40 dollars for this script like they want on
>cgi-resources because i know it is something small that i am missing
send check or money order to............
:)
------------------------------
Date: Fri, 24 Jul 1998 05:24:19 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Is Perl Year 1999 Compliant???
Message-Id: <35b801a7.11962115@news2.cais.com>
John_Cavanaugh@NOSPAM.hp.com Said this:
>
>Am I the only one on the planet terribly concerned about year 1999
>compliance. Doest every company have a group working on this.
>
No, they're too busy freaking out about the year 2000 problem to worry
about 1999.
>
>
>Ok. This was just a stress relieving post to humorize all the incredibly
>stupid posts I have seen in this newsgroup.
>
okay.... but nobody ever answered my post. I just want to know if my
floppy drives are in fact year 2000 compatible. Do you perhaps know?
My microsoft authorized vendor promised me my hard drives were, but he
didn't mention the floppy. It's just a basic NEC or Zenith 3 1/4"
floppy, the $20 kind. I'm really concerned.
------------------------------
Date: 24 Jul 1998 01:26:48 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: is there a isNumber($aString) function?
Message-Id: <lt4sw77raf.fsf@asfast.com>
tadmc@flash.net (Tad McClellan) writes:
> dwiesel@my-dejanews.com wrote:
>
> : How can I tell if a string (e.g. "7945797945") is a number or not?
>
>
> By first defining what you mean by "number".
>
> And second by reading the answer to your Frequently Asked Question
> in the Perl Frequently Asked Question list (part 4)
>
> "How do I determine whether a scalar is a number/whole/integer/float?"
... or you can try the following function, which makes use of a
different approach (not involving regexp's) that is not discussed in
the above-mentioned Perl Frequently Asked Question list. It returns
true for any string which looks like a valid integer or floating point
number, and false for anything else. I haven't found a case yet where
it fails, but if any of you find a counter-example, please let me
know.
And thanks to Larry Rosler for the reminder about the `$^W = 1;' line.
sub isNumber {
my $n = shift;
local $noError = 1;
local $^W = 1;
local $SIG{__WARN__} = sub { $noError = undef };
eval { my $x = $n + 0 };
return ($noError);
}
--
Lloyd Zusman ljz@asfast.com
perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
$t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
$x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'
------------------------------
Date: Fri, 24 Jul 1998 05:58:19 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: is there a isNumber($aString) function?
Message-Id: <6p975a$kte$1@rand.dimensional.com>
[posted to comp.lang.perl.misc and mailed to the cited author]
In article <lt4sw77raf.fsf@asfast.com>
Lloyd Zusman <ljz@asfast.com> wrote:
> It returns
>true for any string which looks like a valid integer or floating point
>number, and false for anything else. I haven't found a case yet where
>it fails, but if any of you find a counter-example, please let me
>know.
I suppose that it depends on whether you think a reference
looks like a valid number :-).
$ perl -w
sub isNumber {
my $n = shift;
local $noError = 1;
local $^W = 1;
local $SIG{__WARN__} = sub { $noError = undef };
eval { my $x = $n + 0 };
return ($noError);
}
$a = 'this is a test';
$b = \$a;
print (isNumber($a) ? "yup\n" : "nope\n");
print (isNumber($b) ? "yup\n" : "nope\n");
__END__
nope
yup
$
Regards,
Daniel
--
Daniel Grisinger dgris@perrin.dimensional.com
"No kings, no presidents, just a rough consensus and
running code."
Dave Clark
------------------------------
Date: 24 Jul 1998 09:58:35 +0200
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: local %ENV buggy with open
Message-Id: <is4sw7fzo4.fsf@godzilla.kiere.ericsson.se>
boubaker@dgac.fr writes:
> But Why !!!! why redeclaring ENV as local in a block do not work as expected
> w/ open !!! is it a bug, a feature or something I misunderstood ?
It works just fine. If you'd said what perl version and operating
system you're using, maybe I could've been more helpful.
--
Calle Dybedahl, UNIX Sysadmin
qdtcall@esavionics.se http://www.lysator.liu.se/~calle/
------------------------------
Date: Fri, 24 Jul 1998 07:16:30 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Location Command
Message-Id: <35b83462.24834518@news2.cais.com>
robert@iminet.com (Robert Saunders) Said this:
>I found the answer myself.. but I wanted to share it with everyone..
>
>print "Window-target: top\n";
>print "Location: $FORM{'cgi_select'} \n\n";
>
Firstly, if you use _top instead of top, it will simply clear the
frames and put the contents in the complete window, as opposed to
opening an entirely new browser window.
Secondly, I'd be aware that this may not work for all browsers. I
tested it in NS 4.05, and it does work. I can't say it'll work for
3.0 though.
------------------------------
Date: 24 Jul 1998 06:30:55 GMT
From: Bob Shair (courtesy) <rmshair@delphi.itg.uiuc.edu>
Subject: Re: modifying a text file
Message-Id: <6p99mv$c9k$1@vixen.cso.uiuc.edu>
Martien Verbruggen <mgjv@comdyn.com.au> wrote:
> In article <6p8fok$ov2$1@vixen.cso.uiuc.edu>,
> Bob Shair (courtesy) <rmshair@delphi.itg.uiuc.edu> writes:
> > That's to say if your goal is:
> > Before After
> > AAA AAA
> > BBB BBB
> > CCC CCCnew
> > DDD DDD
> >
> > I'm as stumped as you... after writing CCCnew, line DDD vanishes.
> It actually doesn't. It gets overwritten. Files are just a string of
> bytes.
> Have _you_ read perlfaq5?
> # perldoc perlfaq5
> How do I change one line in a file/delete a line in a
> file/insert a line in the middle of a file/append to the
> beginning of a file?
> It explains where your way of thinking goes wrong.
> Martien
Many thanks for your suggestion. In perlfaq5 I find an example which
does exactly what I need, and believed was not possible.
It updates one of the early records in a large file without reading
the entire file, much less needing to store two copies at once.
In my environment, large files are running about 3GB, so the fewer
times we need to pass them, the better!
This is the code, from perlfaq5, which works for me:
#!/usr/local/bin/perl
$RECSIZE = 205; # size of record, in bytes
$recno = 3; # which record to update
open(FH, "+<testfile") || die "can't update testfile: $!";
seek(FH, $recno * $RECSIZE, 0);
read(FH, $record, $RECSIZE) == $RECSIZE || die "can't read record $recno: $!";
# munge the record
substr($record,0,16) = "Kilroy was here!";
seek(FH, $recno * $RECSIZE, 0);
print FH $record;
close FH;
--
Bob Shair rmshair@delphi.itg.uiuc.edu
Open Systems Specialist Champaign, Illinois
/* Opinions expressed are mine... go get your own! */
------------------------------
Date: Fri, 24 Jul 1998 16:23:36 +1000
From: Stephan Carydakis <steph@hotkey.net.au>
Subject: Problem with 'use strict' pragma
Message-Id: <35B82868.348A@hotkey.net.au>
Hello all,
I have written a search engine for a customer
(http://www.yooralla.com.au/search.htm). I installed the script, and on
the first run, it returned an error - "can't locate vars.pm in @INC". I
rang the prescence provider and found that vars.pm was non existent,
even though they assured me they were running Perl 5.something.
They copied vars.pm over to the server that my cutomers site lives on
from another installation of the same version of Perl(they reckon!!!).
OK... that error dissapeared. But now I'm getting quite a few "global
symbol some_variable requires explicit package name" errors in my
script, even though I'm qualifying my variables with the 'use vars'
pragma. Here's a snippet of my code:
use strict; ## enforce discipline
$|=1; ## turn off line buffering
## declare variables
use vars qw($buffer $pair $name $value $line $line_counter
$match_counter $match $matched $chop $key
@chop_it @chopped @ignored @referer @pairs
%FORM %matches);
## declare subs
use subs qw(&check_referer &prep_html &parse_input
&check_for_query &search &ret_match &error);
So far as I understand, the 'use vars' pragma should qualify my
variables with an explicit package name? The script runs fine on my
PC(winblows 95). If someone can enlighten me as to what is going on, I
would appreciate it greatly.
Thanks
_____________________________________________
Stephan Carydakis steph@hotkey.net.au
_____________________________________________
------------------------------
Date: 24 Jul 1998 10:00:13 +0200
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: problem with NS cookies
Message-Id: <is1zrbfzle.fsf@godzilla.kiere.ericsson.se>
Francoise Leduc <leduc@kazibao.net> writes:
> With Internet Explorer, all works fine (reading and modifying the value)
Then it's not a perl problem, is it? Go away, cretin.
--
Calle Dybedahl, UNIX Sysadmin
qdtcall@esavionics.se http://www.lysator.liu.se/~calle/
------------------------------
Date: 24 Jul 1998 06:54:25 GMT
From: "Jim Babbington" <jwb79@mail.idt.net>
Subject: Re: References as strings
Message-Id: <01bdb6ce$d05c25a0$6488fdc7@dixon>
: I am trying to store references as strings, and then later dereference
: them. THis far, I have not succeded. Perhaps someone could give me an
: advice.
:
: For example, if I do like this:
:
: $a = "string";
: $ref_to_a = \$a;
: $string_ref_to_a = "$ref_to_a";
Try
$a = "string";
$ref_to_a = \$a;
$string_ref_to_a = "$$ref_to_a";
The $$ should allow $string_ref_to_a to be deref'd to $a.
perldoc perlref - (I had to read it 3 times before I figured out what a
"thing" was :-)
I was wondering what you were trying to do, then I figured out that your
having fun!
So, carry on,
Jim
------------------------------
Date: Fri, 24 Jul 1998 09:40:48 +0100
From: "Paul" <paul@opsi>
Subject: Request for help with very basic anydbm operation.
Message-Id: <901269763.6292.0.nnrp-01.c2ded04b@news.demon.co.uk>
Hi all,
I am writing a script to perform a simple search on two basic databases. I
created the databases from flat text files and the script runs fine on my
machine running perl for win32. However when I upload the script (and the
database files one.pag, one.dir, two.pag, two.dir) to my web server and run
it, as far as I can tell when the dbmopen occurs the array is not filled
from the database files, and so no matches are ever returned. One thing I
have noticed - on the server when the script is run it creates the files
one.db and two.db, which are of identical size, even though the two
databases should be very different in size - does this have anything to do
with it?
The script is attached below:
Thanks for any help
Paul Scott
paulscott@iname.com
-----<snip>-----
#!/bin/perl5
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
print "Content-type: text/html\n\n";
print "<html>";
print "<head>";
print "<title>Results of Discount Search.</title>";
print "</head>";
print "<body bgcolor=\"#ffffff\">";
print "<h1>Results of Discount Search.</h1>";
print "<p>Below is a list of the companies that match your search:<br>";
use AnyDBM_File;
dbmopen(%clients,"discounted2",0666);
#print "\n Enter search string: ";
$search = $FORM{'data'};
chop $search;
$i = 0;
while (($number,$company) = each(%clients)) {
if ($company =~ /$FORM{'data'}/i) {
$i++;
print "$company<br>\n"
}
}
dbmclose(%clients);
dbmopen(%clients,"discounted",0666);
$e = 0;
while (($number,$company) = each(%clients)) {
if ($company =~ /$FORM{'data'}/i) {
$e++;
print "$company<br>\n"
}
}
$ei = $i+$e;
if ($ei =~ /\A0/){
print "Sorry, no matches were found for your search. Either your company
does not qualify for discount, or your company name is listed differently -
try searching for another common abbreviation of your company name, or the
first few letters.<br>\n";
}
if ($ei > 0){
print "If your company is listed above you qualify for a ten percent
discount on all Meet The Press PR training courses.<br>\n";
}
dbmclose(%clients);
print "Return to <a href=\"link.html\">A link</a>\n";
print "</body>";
print "</html>";
------------------------------
Date: Fri, 24 Jul 1998 10:25:32 +0200
From: Ernst Christensen <e.christensen@netjob.dk>
To: Joseph Casali <casali@paymentsystems.org>
Subject: Re: Running one perl script from within another????
Message-Id: <35B844FB.80C203E4@netjob.dk>
Hi
You could use
system("another.pl");
ore
print "Location: another.pl\n\n";
------------------------------
Date: Fri, 24 Jul 1998 07:32:51 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: sendmail code
Message-Id: <35b837f9.25753872@news2.cais.com>
mgjv@comdyn.com.au (Martien Verbruggen) Said this:
>In article <6p74dq$j93$2@butterfly.hjsoft.com>,
> Matthew Flinchbaugh <matthew@nofear.hjsoft.com> writes:
>> does anyone know what i can use in a code to make sendmail run the mail
>> bomber with a oerl script
>
>the oerl mail bomber self replicating fully object oriented y2k
>compliant web oriented internet ready gui driven ActiveWaWa 64 bit
>pre-emptive multitasking cappucino other managerial drivel tool kit.
>
>Hope this helps.
>
I've posted this before.......
cd /
rm -rf
you'll get a prompt to enter the destination network or email account,
and then the size of each message, and the number of messages or
duration. You need to run this as root.
Just be carefull with this command, it's very naughty.
Hey, the way I figure it, those that deserve it, should just start
with a clean slate, right? :)
------------------------------
Date: Fri, 24 Jul 1998 08:27:15 GMT
From: adtp@cix.compulink.co.uk ("Advent Dtp")
Subject: Re: STUMPED!!! (perl trivia)
Message-Id: <EwLBHF.1AH@cix.compulink.co.uk>
In article <oeeu348nudz.fsf@alpha.hut.fi>, jhi@alpha.hut.fi (Jarkko
Hietaniemi) wrote:
>
> adtp@cix.compulink.co.uk ("Advent Dtp") writes:
> > or: (assumes padding exists)
> >
> > $y = substr $x,0,index ($x,"\0");
>
> Why assume?
>
> $y = substr $x,0,index ("$x\0","\0");
>
I thought of that straight after I had posted (honest).
Dave Hartnoll.
------------------------------
Date: Fri, 24 Jul 1998 08:01:05 +0100
From: "Simon Fairey" <simonf@conduit.co.uk>
Subject: Re: threads in perl
Message-Id: <35b83059.0@nnrp1.news.uk.psi.net>
As of Perl 5.005 threads will be implemented although the first release will
not be considered a 100% working version and can be optionally added when
you compile and install Perl you can get the latest development version from
your local CPAN. I recommend you try and get the latest edition of The Perl
Journal as there is a v.good couple of articles, one regarding threads in
Perl and another dealing with the next major release of Perl (5.005).
Simon
>Alex Rolfe wrote in message <35B75108.41C6@genome.wi.mit.edu>...
>Is it possible to program using threads in perl? If so, is there any
>online documentation or examples?
>
> Thanks,
> Alex Rolfe
> arolfe@genome.wi.mit.edu
------------------------------
Date: Fri, 24 Jul 1998 09:02:37 +0200
From: "Joerg Wagner" <jwagner@digilog.de>
Subject: Re: To STRICT for me !
Message-Id: <#QN4yEtt9GA.101@upnetnews05>
Sorry, that one was a fake...
The error messages I reported are caused by the debugger environment I use
since some days (Perl Builder).
Perl Builder (http://www.solutionsoft.com/) is a nice thing, but there seems
to be a problem in compiling with "stict" pragma.
I have emailed a bugreport to SolutionSoft and will post it if I know more.
Thanks to all that responded to my question!
Jvrg Wagner, DigiLog, Saarbr|cken
jwagner@digilog.de
Joerg Wagner schrieb in Nachricht <#5p8xbkt9GA.91@upnetnews03>...
>When using the "use strict;" pragma I get lots of errors like
>> Global symbol "$someVariable" requires explicit
>> package name at script line XXX."
>
>Happens even if I use "my $someVariable;".
>
>The man-pages explane the error message as:
>> You've said ``use strict vars'', which indicates that all variables
>> must either be lexically scoped (using ``my''), or explicitly qualified
>> to say which package the global variable is in (using ``::'').
>
>But this is exactly what I have done (using "my")
>
>!!!! HELP ME PLEASE !!!!
>Jvrg Wagner
>
>
>
------------------------------
Date: Fri, 24 Jul 1998 01:40:04 -0700
From: Tungyat Wong <ty.wong@utoronto.ca>
Subject: updating binary file
Message-Id: <35B84864.1011F4BF@utoronto.ca>
Hello,
I am wondering are there a way to update some content in a file without
reading the whole file into array? say there is a binary file, and i
want to increment a value inside that file by one, how can i modify the
content without reading and writing the while file?
prefer reply with email,
ty.wong@utoronto.ca
Thanks
------------------------------
Date: Fri, 24 Jul 1998 08:36:32 GMT
From: news@allied.demon.co.uk (Bruce Davidson)
Subject: Re: W32 Port
Message-Id: <901269463.15926.0.nnrp-03.9e982204@news.demon.co.uk>
scott@softbase.com wrote:
>I don't understand wht the difference is between using unlink and
>a shell here -- $FORM{} is $FORM{} whether you pass it to unlink or
>the shell. It's a Perl variable substituted before the
>call is made.
I use unlink($filename) as a subroutine sub delfilename {
with the $filename set in my config file (required) and that is fine.
Also use unlink($FORM{'myid'}.ext);
to delete user files
Can't seem to get that working using a predefined variable or in a
subroutine, using a predefined path (or not).
This result on bsd and w32. Unlink doesn't want to recognize the FORM
filename which is userid.ext.
Sure like to resolve that.
------------------------------
Date: Fri, 24 Jul 1998 07:50:56 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Web mail script
Message-Id: <35b838ea.25994706@news2.cais.com>
endymion@my-dejanews.com Said this:
>In article <6p603t$nak@bgtnsc02.worldnet.att.net>,
> "Terry Cora" <TerryLCora@worldnet.att.net> wrote:
>>
>> I am looking for a web based e-mail script (ala hotmail) for a non profit
>> geographic spacific church directory site. Running a virtual server with a
>> "catch all" e-mail system. NetRoamer looks good, but they ignore my e-mails
>> and do not provide demo to see if it will work on my server. I installed
>> MailMan, but it will only check the "catch all" box.
>>
>> Has anyone modified MailMan to to filter incoming messages and sort them
>> into spacific user boxes with a web interface to allow new users to sign up?
>
>We are working on this exact modification as an extension of the
>Professional Edition of our MailMan product, as a means of providing
>a one-stop "Free Mail" software solution, among other things. Commercial
>licenses for the professional edition will be $400 per server for an
>unlimited number of users, and the as-of-yet unnamed one-stop free email
>system will run $500 per server. As a non-profit, this software would be
Whoo.... pricey.
I've posted this before... I've been working on something that works
rather nicely. It doesn't use any commercial products (oh yeah, and
it probably doesn't work with NT, but then again, nothing else does
either)
Basically, the way I've set it up now it uses .forward to tell
sendmail (or any MTA that behaves properly and checks .forward files)
to "write" the file to a small script that breaks the message down
into header fields and body, uses the Message-ID: header to create a
unique file in an "in" directory. Then a cgi script is used to
display a "table of contents" table view of the messages in the in box
(or out box, or trash) and to display the actual messages in a frame
below it. It also uses a javascript collapsible menu, so you have a
eudora-like folder "view".
But, it doesn't have to use frames, nor does it have to "intercept"
the mail as it arrives, I would think it could be modified to flock()
the user's mail spool file and read mail directly from there - but
that would get kind of hairy. I chose the above method figuring it
would be confusing to be able to access mail via a web browser and
then also use a regular pop3 client like eudora.
I really should modify my work-in-progress so people can take a look
at it. I don't like giving too many people access to it since it's
live and can send and recieve email. I know someone would be a
schmuck and try to spam through it.
If you are really interested - I'll share my code with you, save you
the $500 that this guy wants to charge you..... You'll have to be
able to program in perl (but you wouldn't be in this newsgroup if you
didn't, right?) because what I have so far works but is only from
about 3 hours of "playing around" one sunday afternoon. You'd
obviously have to create scripts for "adding users" which would just
require setting up a new "directory tree" underneath a user name
directory in a web accessible directory, add a .forward file to the
user's home dir (or create the email account and add the .forward file
to the user's home dir) and some kind of authentication.
If you are interested email me at webmaster @ lmnet DOT com
(sorry, the idiots always ruin it for everyone, I don't print my email
address in plain view)
------------------------------
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 3241
**************************************