[10907] in Perl-Users-Digest
Perl-Users Digest, Issue: 4508 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 28 20:07:10 1998
Date: Mon, 28 Dec 98 17:00:21 -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 Mon, 28 Dec 1998 Volume: 8 Number: 4508
Today's topics:
Re: A big problem an Medium sized one and an Ickle one. (Tad McClellan)
About Perldoc (Groovy94)
Re: About Perldoc (Fluffy)
Re: Can not get perlcc to work in Win95 <burt.adsit@gte.net>
Re: Checking for existance of a file <gellyfish@btinternet.com>
DBI,MySQL,Apache ->DBI doesn't find database baillie@my-dejanews.com
Display Results of POST operation in Frame? <admin@oneseek.com>
Re: Display Results of POST operation in Frame? <gellyfish@btinternet.com>
Embedding perl with Microsoft VC++ <fisher@ltpmail.gsfc.nasa.gov>
full GUI development in perl (Eric Smith)
Re: Installing modules without PPM kate_stafford@my-dejanews.com
Listing files <remio@dmi.net>
Re: Listing files (Sam Holden)
Re: MacPerl: deleting a file <gellyfish@btinternet.com>
My first class (Slick!)
Re: My first class <uri@ibnets.com>
Need file upload to display date, size <tamaraw@mindspring.com>
need help with dbi/dbd install on bsd <vparekh@panix7.panix.com>
Re: Need to create a detached process. (Randal L. Schwartz)
Re: Pacman anyone? (Greg Andrews)
Re: perl for winnt <jwarner@tivoli.com>
Re: PERL's bug ?? why different ??? <r28629@email.sps.mot.com>
Protecting my script from form data (Groovy94)
Re: Removal of NULL's <gellyfish@btinternet.com>
Re: Retrospective on comp.lang.perl.moderated? <tchrist@mox.perl.com>
Re: Retrospective on comp.lang.perl.moderated? <jdf@pobox.com>
Scale/Mode calculator (Bill Huston)
stubs.h <tlehrer@spectrumdynamic.com>
Re: stubs.h <jdf@pobox.com>
Re: stubs.ph <tlehrer@spectrumdynamic.com>
Thanks [Was: Re: Syntactical weirdness? Or is it just m <bb@jesusfish.xmission.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 28 Dec 1998 15:31:09 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: A big problem an Medium sized one and an Ickle one.
Message-Id: <tat867.b4q.ln@magna.metronet.com>
Wallace (niall_wallace@yahoo.com) wrote:
: I have in 2 strings the values [12/DEC/1998 and +0000].
: I need to remove the [ and ] from both of them for part of my Web Log
: Analyser.
$string =~ tr/[]//d;
: The Medium Sized problem
: I have a percentage of 1.45343729537057439579749735
: But I only want it to store 1.453 in $Percentage.
: I know how to print it using Printf but it has to be stored rounded as well.
printf _does_ do rounding, so what problem are you having?
: I need to Round a percentage up or down
: i.e. 0.5 goes to 1 0.4 goes to 0.
: I have tried using Int but that only rounds down.
Try using printf() as suggested in Perl FAQ, part 4:
"Does perl have a round function?
What about ceil() and floor()?
Trig functions?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 28 Dec 1998 23:28:47 GMT
From: groovy94@aol.com (Groovy94)
Subject: About Perldoc
Message-Id: <19981228182847.25357.00003161@ng30.aol.com>
I always see everyone refer to the perl documentation by sayng perldoc -f
something. I don't have telnet access, therefore I cannot check the
documentation the easy way. Is there another way to check it on my comp by just
entering -f something in a form or something? I have perl on my computer with
all the documentation, etc.
Regards,
Gil Hildebrand, Jr.
Dynamic Scripts
Email: groovy94@aol.com
ICQ UIN: 16678754
------------------------------
Date: 28 Dec 1998 23:59:54 GMT
From: meowing@banet.net (Fluffy)
Subject: Re: About Perldoc
Message-Id: <76961j$2mc@meow.invalid>
Groovy94 <groovy94@aol.com> wrote:
> I always see everyone refer to the perl documentation by sayng
> perldoc -f something. I don't have telnet access, therefore I cannot
> check the documentation the easy way. Is there another way to check
> it on my comp by just entering -f something in a form or something? I
> have perl on my computer with all the documentation, etc.
`perldoc -f' does a search on the perlfunc POD, so you can just read
that as "look in the perlfunc page under the section entitled..."
Your browser's search key (often something like Alt-F) ought to make it
relatively painless.
------------------------------
Date: 28 Dec 1998 21:13:05 GMT
From: Burt Adsit <burt.adsit@gte.net>
Subject: Re: Can not get perlcc to work in Win95
Message-Id: <768s91$6gd$0@205.138.137.56>
Forget that stuff. Go get the 'regular' version of perl and stop
gen'ing C source.
http://www.perl.com
David Lees wrote:
>
> I am a total perl newbie. Just downloaded the ActiveState version and am
> having not trouble with the interpreter on my initial simple Hello world
> type code. I tried to compile with perlcc under Win95 and am unable to
> get it to work. A C program seems to get generated, but the perlcc batch
> file bombs out with an error message that it can not open !
>
> Anyone know if the perlcc.bat script works properly under Win95 and if so,
> what I could be messing up?
>
> Thanks in advance.
>
> David Lees
> debl@world.std.com
--
Burt Adsit
Earthenware
http://www.featurefarm.com
lat n43.10' lon w86.2'
------------------------------
Date: 28 Dec 1998 20:50:43 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Checking for existance of a file
Message-Id: <768qv3$1do$1@gellyfish.btinternet.com>
On Mon, 28 Dec 1998 12:41:23 -0500 Stephen Benjamin <steve.benjamin@juno.com> wrote:
> I am writing a program which generates a fairly random number and then
> writes to a file by that name. How can I check to see if that file
> already exists or not? Also, how can I delete a file from within perl?
>
Check out the documentation:
perldoc -f -X
perldoc -f unlink
The documentation that comes with every Perl distribution should be your first
recourse when you have questions like this - You will almost certain get your
answer quicker than posting here and certainly cheaper if you have to pay
in some way for your internet connection.
Some will accuse me in this of discouraging newcomers to Perl - this is far
from the case infact the reality is by pressing on people the use of the
documentation then they will probably learn better and quicker than if they
resort to posting to this newsgroup whenever they have a question that might
be answered by that documentation.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Mon, 28 Dec 1998 21:00:08 GMT
From: baillie@my-dejanews.com
Subject: DBI,MySQL,Apache ->DBI doesn't find database
Message-Id: <768rgo$5qo$1@nnrp1.dejanews.com>
I realize this is a real stretch of a Perl newsgroup post, but I'm having an
awful time trying to create my first database/CGI/DBI application. I have a
database installed name UNIXdb with the tables UNIXlogs and UNIXsystems, my
CGI program seems to connect fine but gives me the error
DBI error with execute:Can't find file: 'UNIXdb.frm' (errno: 2) at
/usr/local/apache/cgi-bin/list_threads.pl line 50.
which apparently means there's no database there...but I know it is, I can
add and delete records, etc, etc....although I cannot find a file named
UNIXdb.frm, the tables within this database have files with that extension,
but nothing for the database itself..what did I do wrong?
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 28 Dec 1998 13:03:45 -0800
From: Jennifer Stone <admin@oneseek.com>
Subject: Display Results of POST operation in Frame?
Message-Id: <3687F231.BFD@oneseek.com>
Hi,
Can anyone tell me if there is an easy way to display the results of a
POST operation in a frame using a Perl CGI script?
With GET this is easy, since you just write the frame code using the
URL. Is something similar with a POST operation?
Note that we do not want to use a Form which just want to directly
display the result directly.
For example, if you want to display the result from searching Yahoo for
Perl the GET URL would be:
http://search.yahoo.com/bin/search?p=perl
Is there a way to display a POST result in a similar way?
Thanks,
Jennifer Stone
------------------------------
Date: 28 Dec 1998 21:43:44 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Display Results of POST operation in Frame?
Message-Id: <768u2g$1lk$1@gellyfish.btinternet.com>
On Mon, 28 Dec 1998 13:03:45 -0800 Jennifer Stone <admin@oneseek.com> wrote:
> Hi,
>
> Can anyone tell me if there is an easy way to display the results of a
> POST operation in a frame using a Perl CGI script?
>
> With GET this is easy, since you just write the frame code using the
> URL. Is something similar with a POST operation?
>
> Note that we do not want to use a Form which just want to directly
> display the result directly.
>
> For example, if you want to display the result from searching Yahoo for
> Perl the GET URL would be:
>
> http://search.yahoo.com/bin/search?p=perl
>
> Is there a way to display a POST result in a similar way?
>
If you are using the CGI.pm module then it is actually quite easy - the
documentation for the module has a section entitled:
WORKING WITH NETSCAPE FRAMES
In general however this is not a specifically Perl question - it is general
to CGI in whatever language the program has been written - you might have
more luck with a group such as comp.infosystems.www.authoring.cgi which is
concerned with this stuff more than this one which is more language
specific.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Mon, 28 Dec 1998 18:00:24 -0500
From: Paul Fisher <fisher@ltpmail.gsfc.nasa.gov>
Subject: Embedding perl with Microsoft VC++
Message-Id: <36880D6F.2BC3220E@ltpmail.gsfc.nasa.gov>
Hello,
Has anyone ever been able to embed perl in C/C++ code on an intel 486
using Microsoft Visual C++?
I can compile and link to the perl libraries, but the code performs
"illegal instructions" at runtime with the call to perl_alloc or
perl_construct (I haven't figured out which is the culprit yet). I was
wondering if anyone else has ever gotten this to work -- or not gotten
this to work?
--Paul
--
----------------------------------
Paul Fisher
MODAPS Land Science Testing
MODIS Land Senior Programmer/Analyst
Science Systems and Applications Inc.
NASA's Goddard Space Flight Center, Code 923
Greenbelt, MD 20771
phone: (301) 286-2980
------------------------------
Date: 28 Dec 1998 23:49:29 GMT
From: eric@nafex.comi (Eric Smith)
Subject: full GUI development in perl
Message-Id: <slrn78g688.3dg.eric@eric.nafex.com>
Hi
I understand that work is afoot which will allow development for Windows
environment of GUI applications in Perl using Java front end. But I am unable
to find anything regarding this on the net.
IS the day really approaching when we may dump windoze dev tools like Delphi,
Visual basic etc for a Perl Toolkit?
Please mail and post.
Thank you
--
Eric Smith (eric@nafex.com)
Tel 0027 82 780 7888 (vodacom)
------------------------------
Date: Mon, 28 Dec 1998 22:49:03 GMT
From: kate_stafford@my-dejanews.com
Subject: Re: Installing modules without PPM
Message-Id: <7691sv$b95$1@nnrp1.dejanews.com>
In article <768pkf$4a4$1@nnrp1.dejanews.com>,
dturley@pobox.com wrote:
> This same error was being discussed on the AA mailing list last week. No
> solutions were reported yet. My guess is that AS broke something on the PPM
> server. But it works for me now.
>
> Check the perl-win32-user mailing list at
> http://www.activestate.com/support/mailing_lists.htm
>
> You'll have to scroll down, the nav link at the top of the page hasn't worked
> ever, and the AS webmaster has never fixed it.
The problem just vanished about an hour ago. Thanks for your help!
--
Kate Stafford, MCSE
ICQ 12183309
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 28 Dec 1998 16:30:47 -0800
From: Remi Olsen <remio@dmi.net>
Subject: Listing files
Message-Id: <368822B7.7AF26A73@dmi.net>
Does anybody know how to list files in WinNT with Perl5? (like the dir
command in DOS or ls in UNIX) I need to put each filename into an array,
for further processing of the files. Any help would be greatly
appreciated!
Cheers,
Remi O
------------------------------
Date: 29 Dec 1998 00:36:59 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Listing files
Message-Id: <slrn78g91b.kdl.sholden@pgrad.cs.usyd.edu.au>
On Mon, 28 Dec 1998 16:30:47 -0800, Remi Olsen <remio@dmi.net> wrote:
>Does anybody know how to list files in WinNT with Perl5? (like the dir
>command in DOS or ls in UNIX) I need to put each filename into an array,
>for further processing of the files. Any help would be greatly
>appreciated!
perldoc -f glob
perldoc -f readdir
--
Sam
Simple rule: include files should never include include files.
--Rob Pike
------------------------------
Date: 28 Dec 1998 21:22:19 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: MacPerl: deleting a file
Message-Id: <768sqb$1i1$1@gellyfish.btinternet.com>
On Mon, 28 Dec 98 14:54:46 EST PETER@yaleads.ycc.yale.edu wrote:
> Hi. What is the most elegant way of deleting/erasing files under MacPerl?
I guess the same as with other versions of Perl - with 'unlink'. You should
check out the perlfunc manpage (however you might do that on a Mac) for
more on that function.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Mon, 28 Dec 1998 22:55:06 GMT
From: slick@dick.com (Slick!)
Subject: My first class
Message-Id: <368908d3.22038529@news.shreve.net>
I'm trying to create a class with the guidance of the Camel book, but
I've had little success so far. I've copied all of the object
construction and autoloading stuff pretty much straight from the Camel
book, but no luck. The autoload bombs out on the first assignment (to
'w'). I went so far as to put a foreach $key(keys %self){print
"$key\n";}; in the constructor after the bless and it dosent print
anything, so I suspect that the constructor is part of the problem.
On the other hand I also tried an assignment in the constructor
post-bless '$self{w}=1; and it printed out in the foreach loop, but
autoload still dosen't find 'w'. I get the same output every time:
Can't access 'w' field in object of class CBox at
G:\DEVSTUFF\perl\learn\oop\CBOX.PM line 4.
'ActivePerl' build 508 under Win32(NT4 SP4)
TIA!
Here is my code:
my $box;
$box = new CBox;
$box->w(2);//line 4
$box->d(3);
$box->l(3);
print "Volume: $box->Volume()\n";
package CBox;
use Carp;
my %fields = (
l => undef,
w => undef,
d => undef,
);
sub new{
my $that= shift;
my $class=ref($that) || $that;
my $self = {
%fields,
};
bless $self,$class;
return $self;
}
sub Volume{
return $self{"l"} * $self{"w"} * $self{"d"};
}
sub AUTOLOAD
{
my $self = shift;
my $type = ref($self) || die"$self is not an object";
my $name = $AUTOLOAD;
$name=~ s/.*://; #strip fully-qualified portion
unless (exists $self->{$name}) {
croak "Can't access '$name' field in object of class $type";
}
if (@_){
return $self->{$name} = shift;
}else{
return $self->{name};
}
}
------------------------------
Date: 28 Dec 1998 18:33:02 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: My first class
Message-Id: <3967av3kr5.fsf@ibnets.com>
>>>>> "S" == Slick! <slick@dick.com> writes:
look at your code in time space.
S> my $box;
S> $box = new CBox;
you call new here.
S> $box->w(2);//line 4
you access w here.
S> $box->d(3);
S> $box->l(3);
S> print "Volume: $box->Volume()\n";
S> package CBox;
S> use Carp;
S> my %fields = (
S> l => undef,
S> w => undef,
S> d => undef,
S> );
but you define the fields here. they weren't defined before you called
new.
perl executes code in sequence. initializatiosn must happen in time
space before code refers to them, not just in code space. either put the
fields definitions in a BEGIN block or move the CBox code to a separate
file and use it. that will make the fields defined before you call new.
hth,
uri
--
Uri Guttman Hacking Perl for Ironbridge Networks
uri@sysarch.com uri@ironbridgenetworks.com
------------------------------
Date: Mon, 28 Dec 1998 19:02:20 -0500
From: Tamara Williams Jones <tamaraw@mindspring.com>
Subject: Need file upload to display date, size
Message-Id: <36881C0C.FE0BA69B@mindspring.com>
Confession: I am a Perl newbie relying on some education from generous
others!
I have customized a file upload script quite to my liking (generic
snippet follows).
However, it currently only displays the names of the files available in
the directory in the html output. I really need it to also display the
date and size of the file, so users can pick the latest file available
for download.
I know I can use the fsize and flastmod commands to do so, but don't
know where to insert the commands - this script uses arrays, which I am
just getting a grip on.
Multiple experiments have not worked.
If anyone could tell me where to insert these commands, I would be most
grateful.
Thanks,
Tamara
opendir(DIR, "$filedir"); # $filedir from constant above
local(@files) = readdir(DIR); # load @files array from readdir(DIR)
for (@files) {
if (/\\/) {
$oldfile = $_; # store current element in $oldfile
@path = split (/\\/,$oldfile); # store all path elements in
@path array
$newfile = pop(@path); # store file name w/o path to $newfile
# rename old filename with path info to just plain filename
rename("$filedir"."$oldfile","$filedir"."$newfile");
}
next if (/^\./); # bypass listing for current dir "."
next if (/^index/); # or file starting with "index"
print "<A HREF = "."$fileurl"."$_".">$_</A><P>\n"; # output html
link to file
}
if ($file = $query->param('filename')) {
print "<HR>\n";
$newfile = $file;
if (/\\/, $file) {
$oldfile = $file;
@path = split(/\\/, $oldfile);
$newfile = pop(@path);
}
print "<A HREF = "."$fileurl"."$newfile"."><H2>$newfile</H2></A>\n";
open(OUTFILE, ">$filedir"."$newfile");
while (<$file>) {
print OUTFILE "$_";
}
close OUTFILE;
------------------------------
Date: 28 Dec 1998 23:01:28 GMT
From: Vic Parekh <vparekh@panix7.panix.com>
Subject: need help with dbi/dbd install on bsd
Message-Id: <7692k8$3q1@news1.panix.com>
I get this error:
panix7% perl Makefile.PL
DBI/DBD.pm did not return a true value at Makefile.PL line 15.
BEGIN failed--compilation aborted at Makefile.PL line 15.
panix7%
and line 15 is:
14)use DBI 0.93; # must be installed first
15)use DBI::DBD;
(without the "15)" which was prepended by me, of course)
I have DBI.pm working. I am installing teh DBD:ODBC driver. Is there
something that I have not installed?
Please post replies to NNTP or to me at vparekh@pobox.com
------------------------------
Date: 28 Dec 1998 14:25:10 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Need to create a detached process.
Message-Id: <m1lnjr7vll.fsf@halfdome.holdit.com>
>>>>> "SomeoneWhoThinksAddressManglingHelps" == hi <hi@there.com> writes:
SomeoneWhoThinksAddressManglingHelps> I'm looking for some Perl
SomeoneWhoThinksAddressManglingHelps> sourcecode which will
SomeoneWhoThinksAddressManglingHelps> demonstrate EXACTLY how to
SomeoneWhoThinksAddressManglingHelps> create a detached process from a
SomeoneWhoThinksAddressManglingHelps> CGI program. I want my CGI
SomeoneWhoThinksAddressManglingHelps> program to return some HTML to
SomeoneWhoThinksAddressManglingHelps> the browser while another
SomeoneWhoThinksAddressManglingHelps> process gets on with something
SomeoneWhoThinksAddressManglingHelps> else without the user having to
SomeoneWhoThinksAddressManglingHelps> wait until it's finished.
There are a few examples like that in my WebTechniques columns. See
<URL:http://www.stonehenge.com/merlyn/WebTechniques/>.
SomeoneWhoThinksAddressManglingHelps> I've read all the man pages on
SomeoneWhoThinksAddressManglingHelps> this stuff but there's NO
SomeoneWhoThinksAddressManglingHelps> example code apart from a few
SomeoneWhoThinksAddressManglingHelps> lines, no complete programs.
Well, you would have done *much* better to post in the CGI newsgroups.
Most of the web uses Perl, but most of Perl usage is *not* about the
web.
SomeoneWhoThinksAddressManglingHelps> Please reply to:
SomeoneWhoThinksAddressManglingHelps> nc@cyberdude.com
Well, you just gave away your address. Here comes the spam. :)
print "Just another Perl hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 28 Dec 1998 13:29:41 -0800
From: gerg@shell1.ncal.verio.com (Greg Andrews)
Subject: Re: Pacman anyone?
Message-Id: <768t85$coj$1@shell1.ncal.verio.com>
Scott Allen Zsori <zsoris@post.uwstout.edu> writes:
>
>I was just sitting back reading my Camel book when all of a sudden a
>word forced a scary little image into my head: a little yellow circle
>with a pie-piece taken out, roaming around my code eating all my regular
>expressions. Does "chomp" remind anyone else of this wonderful little
>character? :) Does anyone else dream in whatever language their current
>projects are in? Has anyone else ever actually used a programming
>command in a non-programming sentence (I greped a friend's last sentence
>by accident once :)?
>
Welcome to Level Four, Grasshopper. ;-)
-Greg
------------------------------
Date: Mon, 28 Dec 1998 16:37:44 -0600
From: John Warner <jwarner@tivoli.com>
Subject: Re: perl for winnt
Message-Id: <36880838.35B393CA@tivoli.com>
Your IIS server is set up to disallow the security hole you are trying to
create. Directory browsing, as a rule, is a very bad thing to allow any
internet user to do. Allowing directory browsing can allow anybody to look at
any portion of your hard drive unless you are extremely careful. If you want
to allow this, you need to allow directory browsing in MMC for both the
directory where upload.cgi exists and your $SAVE_DIRECTORY under the
appropriate web site.
HTH,
John Warner
Shana Priwer wrote:
> Hi all - still trying to set up Perl and CGI for my website, which I
> host through IIS on a Windows NT 4 Workstation computer. Basically I
> have a file called upload.cgi, which i
> have in d:\winnt\system32\inetsrv\iisadmin\cgi-bin\. The first line of
> upload.cgi, i edited to read this: $SAVE_DIRECTORY = "../../../../Perl";
>
> because i thought it was supposed to go to the Perl path, which is
> d:\perl. When you try to use the upload script over the web, you get a
> 501 http error. (you can see this at
> http://208.235.164.47/iisadmin/upload.cgi) -- could someone please
> give me some idea of what's wrong? I've been through the FAQ and can't
> get this resolved.
>
> Many thanks-
> Shana
>
> ---== http://www.newsfeeds.com - Largest Usenet Server In The World! ==---
>
> ---== http://www.newsfeeds.com - Largest Usenet Server In The World! ==---
------------------------------
Date: Mon, 28 Dec 1998 15:45:03 -0600
From: Tk Soh <r28629@email.sps.mot.com>
To: sky <tbsky@ms7.url.com.tw>
Subject: Re: PERL's bug ?? why different ???
Message-Id: <3687FBDF.1DB783CC@email.sps.mot.com>
[posted to clpm and copy emailed]
sky wrote:
[...]
> a.pl
> #!/usr/bin/perl
> require 'b.pl';
> SOT hello ;
>
> b.pl
> #!/usr/bin/perl
> sub SOT {
> print "@_" ;
> }
> 1;
>
> i must fix a.pl like this SOT (hello) ;
> to make it work....
not sure why you must do it without the parens, but if you insist..
from perldoc perlsub:
---------------------------------------------------------------
To call subroutines:
NAME(LIST); # & is optional with parentheses.
NAME LIST; # Parentheses optional if predeclared/imported.
&NAME; # Makes current @_ visible to called subroutine.
---------------------------------------------------------------
(Somehow, some people still think Perl is full of bugs <sigh>)
HTH.
-TK
------------------------------
Date: 29 Dec 1998 00:19:01 GMT
From: groovy94@aol.com (Groovy94)
Subject: Protecting my script from form data
Message-Id: <19981228191901.25357.00003199@ng30.aol.com>
I am trying to protect my script from malicious form entry data. I have
included the following code into my own modified readparse and don't think it
works, but am not sure why.
elsif ($value =~ /([;<>\*\|'$\$\(\)\[\]\{\}:'"]) {
print <<EOHTML;
Your data was not parsed because it contained characters
that could possibly perform malicious tasks with this program.
Please go back and fill out the form, ommiting any extra characters,
such as <strong>;,<,>,*,$,/,\</strong>.
EOHTML
exit;
}
Regards,
Gil Hildebrand, Jr.
Dynamic Scripts
Email: groovy94@aol.com
ICQ UIN: 16678754
------------------------------
Date: 28 Dec 1998 21:20:24 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Removal of NULL's
Message-Id: <768smp$1hu$1@gellyfish.btinternet.com>
On Mon, 28 Dec 1998 19:36:37 +0000 Joe Santoro <joe@santoroj.demon.co.uk> wrote:
> This is a multi-part message in MIME format.
> --------------92D102AE4A4209A6E652F5CE
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
Please try and configure your browser so it doesnt insert this vcard stuff
into usent posts - at best it is unnecessary and annoying and at worse it
will cause your posts to be ignored by people. If you cant tame your browser
you should consider getting a newsreader that behaves properly.
>
> Hi,
>
> I have a number of files which have NULL's in them
>
> i.e.
>
> 1234.ABCD.NULLNULLNULL NULL.5678
>
> How do I remove just the NULL's from the files ?
>
It might depend on whether you simply want to remove the NULL characters or
replace them with something else.
Assuming you want simply to remove them you could try:
perl -pi.bak -e 's/\x00//g' <filename>
For more on this you should check out the perlre,perlop and perlrun manpages.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 28 Dec 1998 16:52:08 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <768cvo$rnd$1@csnews.cs.colorado.edu>
In comp.lang.perl.misc, les@MCS.COM (Leslie Mikesell) writes:
:Yes, I thought the object of usenet was to exchange questions and
:answers easily.
That's an... interesting perspective -- for certain values of `interesting'.
--tom
--
QVIDQVID LATINE DICTVM SIT PROFVNDVM VIDITVR
------------------------------
Date: 28 Dec 1998 23:52:45 +0100
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <m3d8537ubm.fsf@joshua.panix.com>
dturley@pobox.com writes:
> How is the noise level reduced, when many questions, like the one
> that started this thread, are cross-posted to both groups. Doesn't
> that defeat the purpose?
I read clp.misc first. After my killfile gets through with it, I
either read or mark as read the rest. Anything crossposted gets
auto-marked as read by my newsreader, and I never even see it. No
noise, no fuss, no bother.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 28 Dec 1998 22:01:48 GMT
From: bhuston@matrix.eden.com (Bill Huston)
Subject: Scale/Mode calculator
Message-Id: <768v4c$etk$1@boris.eden.com>
Hi all,
I've just written a first draft of a scale/mode calculator
in perl. It only has a web-based interface for now, but
I'm going to add a command line interface soon.
http://mu.clarityconnect.net/cgi-bin/scales
Here's all the scales and modes that it knows how to do
now:
I Ionian (major) (wwhwwwh)
II Dorian (whwwwhw)
III Phrygian (hwwwhww)
IV Lydian (wwwhwwh)
V Mixolydian (wwhwwhw)
VI Aeolian (rel. minor) (whwwhww)
VII Locrian (rare) (hwwhwww)
Diminished w/h (whwhwhwh)
Diminished h/w (hwhwhwhw)
Arabian (hhwwwww)
Harmonic minor (whwwh3h)
Jazz melodic min ascending (whwwwwh)
Jazz melodic min descending (whwwwwh)
Lydian 7b (wwwhwhw)
Whole tone (wwwwww)
Blues (3whh3w)
Maj pentatonic (ww3w3)
You can download the source code if you'd like to play
with it. Send me any bug fixes or enhancements.
Here's what I will be adding soon:
"periodic table" of scales (from 12 sharps to 12 flats),
graphically generate scale on staff, keyboard,
and guitar neck (non standard tunings supported, other
than 6 strings will be supported too)
make a .wav or .au file (or midi?) of the scale
Comments to bhuston@eden.com
Enjoy!
Bill
--
Bill Huston (bhuston@eden.com) Mon Dec 28 16:59:20 CST 1998
Lovers of Peace and freedom only: http://mu.clarityconnect.net
"Protozoa are small, and bacteria are small, but viruses are smaller
than the both put together."
------------------------------
Date: Mon, 28 Dec 1998 14:15:24 -0700
From: Thomas Lehrer <tlehrer@spectrumdynamic.com>
Subject: stubs.h
Message-Id: <3687F4EC.74A70F18@spectrumdynamic.com>
I recently upgraded to Perl 5.04-6 and found that my 4.x perl scripts
aren't running because it is unable to find /etc/stubs.ph I'm runnig
RH Linux 5.1 and I can't find stubs.ph anywhere on my machine. Can
anyone help me in locating this file, or perhaps let me know of a hack
to work around it....
------------------------------
Date: 28 Dec 1998 23:58:56 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: Thomas Lehrer <tlehrer@spectrumdynamic.com>
Subject: Re: stubs.h
Message-Id: <m3af077u1b.fsf@joshua.panix.com>
Thomas Lehrer <tlehrer@spectrumdynamic.com> writes:
> I'm runnig RH Linux 5.1 and I can't find stubs.ph anywhere on my
> machine.
More specifically, you can't find it anywhere in @INC. Try
$ man h2ph
Most likely, you'll need to do something like
$ cd /usr/include
$ h2ph -r -l gnu
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Mon, 28 Dec 1998 14:17:54 -0700
From: Thomas Lehrer <tlehrer@spectrumdynamic.com>
Subject: Re: stubs.ph
Message-Id: <3687F582.4475889@spectrumdynamic.com>
Actually it's says can't locate file gnu/stubs.ph The file that calls this
header is features.ph...
Thomas Lehrer wrote:
> I recently upgraded to Perl 5.04-6 and found that my 4.x perl scripts
> aren't running because it is unable to find /etc/stubs.ph I'm runnig
> RH Linux 5.1 and I can't find stubs.ph anywhere on my machine. Can
> anyone help me in locating this file, or perhaps let me know of a hack
> to work around it....
------------------------------
Date: Mon, 28 Dec 1998 14:32:52 -0700
From: "Brandon Burt" <bb@jesusfish.xmission.com>
Subject: Thanks [Was: Re: Syntactical weirdness? Or is it just me?]
Message-Id: <768tql$qkj$1@news.xmission.com>
Thanks to everybody who responded to my question; the explanation seems so
obvious now, particularly since I clearly remember the perldoc bellowing,
"THERE IS NO GENERAL RULE FOR CONVERTING A LIST INTO A SCALAR", as Andrew
pointed out. At least it brought up an interesting point, to judge from the
number of replies.
Thanks again,
Brandon Burt
------------------------------
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 4508
**************************************