[11514] in Perl-Users-Digest
Perl-Users Digest, Issue: 5114 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 11 20:37:20 1999
Date: Thu, 11 Mar 99 17:00:23 -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, 11 Mar 1999 Volume: 8 Number: 5114
Today's topics:
Re:
1000 thread limit? archon16@my-dejanews.com
An Image's Dimension in CGI? tatabu@my-dejanews.com
Re: An Image's Dimension in CGI? <jamesht@idt.net>
Re: BigInt: Decimal to Hex <dagon@halcyon.com>
Can't call method <esuarez@fcaglp.fcaglp.unlp.edu.ar>
Re: Can't call method (Sam Holden)
can't install Msql-Mysql-modules-1.2017 <emschwar@mail.uccs.edu>
Re: CGI https-detector <jamesht@idt.net>
Re: Complex Structure Question <bruceh@interaccess.com>
Re: debugger mystery... <john.chambers@gte.com>
Disableing NT Accounts (Michael Griswold)
Re: Executing SSI from CGI Output <jamesht@idt.net>
Failures compiling LWP modules on SunOS <john.chambers@gte.com>
How to modify the call stack? archon16@my-dejanews.com
How to you pass parameters into subroutines in Perl? <wwyeung@undergrad.math.uwaterloo.ca>
IDE for Perl swamichandra@my-dejanews.com
Re: Link validation <jamesht@idt.net>
Re: Link validation (Randal L. Schwartz)
Re: Mysql question (John )
Re: Newbie Perl for NT question <ceeembee@nlsport.com>
Re: perl filters for inn (Tad McClellan)
Re: Perl Question <jamesht@idt.net>
Perl segfaulting with Argument "CLIKE" isn't numeric in (Hakan Ardo)
Re: perlexe.pl problems? (Mike Stillman)
Re: Printing in Perl <ebohlman@netcom.com>
Re: problems reading HTML file <ebohlman@netcom.com>
Re: Problems with Perl and tar (Steve Lamb)
Re: Regex help needed <jamesht@idt.net>
regular expression <nnygsi@ny.ubs.com>
Sending data to another script <support@onlineauctions.co.uk>
Re: Speed-optimizing regular expressions (Alan Barclay)
Re: test if a string is in an array? (Tad McClellan)
Re: using variables in patterns <jamesht@idt.net>
Re: Which CGI Perl module/lib to use? (Andre L.)
Writing to Temp file a couple fo times.. then reading b andrew_linmax@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 11 Mar 1999 18:12:08 -0500
From: James Tolley <jamesht@idt.net>
To: Bob Langdon <bingdo19@earthlink.net>
Subject: Re:
Message-Id: <36E84DC8.9D3E7A4C@idt.net>
This works for me:
#!/usr/bin/perl
opendir(BBS, '/home/gigs/public_html/bbs');
@allfiles = readdir(BBS);
foreach $file(@allfiles){
$file =~ s/(.*)\.html/$1/g;
}
exit;
I just put a semi-colon after the 'exit' command and took away the single quotes
from around the s///g;
It compiled, and ran fine for me as it is above, but it doesn't do anything.
James
------------------------------
Date: Thu, 11 Mar 1999 21:53:43 GMT
From: archon16@my-dejanews.com
Subject: 1000 thread limit?
Message-Id: <7c9e12$q81$1@nnrp1.dejanews.com>
I'm playing with the Thread module... and I was dismayed to discover a limit
of about 1000 threads allowed at a time (on my machine, at least.) After
hitting this limit, the program simply dumps core. Does anyone know of a way
to get around this limitation? (Without recompiling the Linux kernel, that
is.) I really, really need to have about 30,000 simultaneous threads.
(Don't ask. I just do. ;-)
Thanks!
- Archon
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 11 Mar 1999 22:09:44 GMT
From: tatabu@my-dejanews.com
Subject: An Image's Dimension in CGI?
Message-Id: <7c9euv$qvp$1@nnrp1.dejanews.com>
Is it possible to get an image's dimensions in CGI?
This is because I don't necessarily know them a priori.
On the other hand, could I pass a picture's dimensions
in an HTML file as parameters in the CGI file that is
being posted to?
Thank you so much.
soulis
friends@soulis.com
http://soulis.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 11 Mar 1999 19:18:39 -0500
From: James Tolley <jamesht@idt.net>
To: tatabu@my-dejanews.com
Subject: Re: An Image's Dimension in CGI?
Message-Id: <36E85D5F.9AA46B34@idt.net>
Here's something that should work for gifs.
There are modules at CPAN that will help as well (of course).
sub gifsize {
local ($gif) = @_;
local ($w, $w2, $h, $h2, $gifwidth, $gifheight, $type) = ();
open (GIF, $gif); read (GIF, $type, 3);
seek (GIF, 6, 0); read (GIF, $w, 1);
read (GIF, $w2, 1);
$width = ord ($w) + ord ($w2) * 256;
read (GIF, $h, 1) ; read (GIF, $h2, 1);
$height = ord ($h) + ord ($h2) * 256;
close (GIF);
return ( $width , $height, $type );
}
hth
James
tatabu@my-dejanews.com wrote:
> Is it possible to get an image's dimensions in CGI?
> This is because I don't necessarily know them a priori.
> On the other hand, could I pass a picture's dimensions
> in an HTML file as parameters in the CGI file that is
> being posted to?
> Thank you so much.
>
> soulis
> friends@soulis.com
> http://soulis.com
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 11 Mar 1999 10:28:16 -0800
From: Mark Rafn <dagon@halcyon.com>
Subject: Re: BigInt: Decimal to Hex
Message-Id: <7c9200$7q1$1@halcyon.com>
><tchrist@mox.perl.com>],
>> my($quo, $rem) = $num->bdiv(16);
>> $num = new Math::BigInt $quo; # why aren't they bigints?
Ilya Zakharevich arranged electrons in a pattern like this:
>Why should they? If you do not use
> $a % $b
>then you know what you do. An overhead of creating a new object may
>be prohibitive.
They should be because of exactly what we're doing. We want to call a
BigInt method on a number and than a BigInt method on the result.
Also, perldoc Math::BigInt sez
$i->bdiv(BINT) return (BINT,BINT) division (quo,rem) just quo if scalar
indicating that the return values should be BigInt as well.
--
Mark Rafn dagon@halcyon.com <http://www.halcyon.com/dagon/> !G
------------------------------
Date: Thu, 11 Mar 1999 21:14:10 -0300
From: "Eduardo A. Suarez" <esuarez@fcaglp.fcaglp.unlp.edu.ar>
Subject: Can't call method
Message-Id: <36E85C52.512767C4@fcaglp.fcaglp.unlp.edu.ar>
Hi,
what means
Can't call method "subroutine_2" on unblessed reference at subroutine_1
line nn
Eduardo.
------------------------------
Date: 12 Mar 1999 00:29:49 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Can't call method
Message-Id: <slrn7egnvt.egk.sholden@pgrad.cs.usyd.edu.au>
Eduardo A. Suarez <esuarez@fcaglp.fcaglp.unlp.edu.ar> wrote:
>Hi,
>
>what means
>
>Can't call method "subroutine_2" on unblessed reference at subroutine_1
>line nn
At line nn you have a line similar to :
$ref->subroutine_2();
However, $ref is a reference to something but has not been blessed to be an
object.
For example $ref might be something like :
$ref = { name => 'bill', age => 20};
whereas it should be something like :
$ref = bless { name => 'bill', age => 20}, 'Person';
Although 'Person' should not be hard coded and should be the package name
passed to the construction method (but that would require more code).
Then it would call the subroutine_2 sub in the Person package passing it the
$ref as the first argument (in fact it would call the first subroutine_2
sub it found in a the inheritance tree but that is another issue (and still
not the whole story)).
--
Sam
It has been discovered that C++ provides a remarkable facility for
concealing the trival details of a program--such as where its bugs are.
--David Keppel
------------------------------
Date: 11 Mar 1999 16:12:17 -0700
From: Eric The Read <emschwar@mail.uccs.edu>
Subject: can't install Msql-Mysql-modules-1.2017
Message-Id: <xkf90d3k4dq.fsf@valdemar.col.hp.com>
I ftp'd the aforementioned module from CPAN, and set about compiling it--
all is well. When I tried installing it, it insists on trying to put it
in /site/lib/perl. I tried 'perl Makefile.PL PREFIX=/home/emschwar/cpan',
but it goes ahead and tries to install in /site/lib/perl anyhow.
I've read perlfaq8, which gave me the above. Is there something obvious
I'm missing here? Perhaps I should be using another module for accessing
msql databases from perl?
I'm running perl 5.004_04 (No, I can't upgrade it, sorry) if it helps.
-=Eric, eagerly awaiting enlightenment
------------------------------
Date: Thu, 11 Mar 1999 19:26:17 -0500
From: James Tolley <jamesht@idt.net>
To: Spaghettio <webmaster@cgninteractive.com>
Subject: Re: CGI https-detector
Message-Id: <36E85F29.C7DADC23@idt.net>
If you really need to do this, the only thing to be done is to gather a list of HTTP User Agents you don't
think can handle https.
Compare $ENV{'HTTP_USER_AGENT'} to those list items and act accordingly.
hth
James
------------------------------
Date: Thu, 11 Mar 1999 18:08:55 -0500
From: Bruce Hodo <bruceh@interaccess.com>
To: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Complex Structure Question
Message-Id: <36E83EF7.AB106BF7@interaccess.com>
Let me see if I understand what you said:
I can save a reference to the array as long as I redeclare the array inside my loop,
and Perl will keep track of each instance until the program terminates? If my
understanding is correct, then that solves my problem!
Thanks!
Larry Rosler wrote:
>
> In article <36E81DB4.AADC9F29@interaccess.com> on Thu, 11 Mar 1999
> 15:47:01 -0500, Bruce Hodo <bruceh@interaccess.com> says...
> > The Sixty-Four Dollar Question is: Isn't saving the reference basically saving
> > the location (reference), and not the values of the array? The reason I didn't
> > do that is because I resuse some of the arrays. I want to save the original
> > values so I can recall them latter. It was my impression that dereferencing
> > them would get me the last values stored, not the ones I wanted.
>
> The $0.02 answer is: You are right, to some degree. Saving a reference
> to an array gives you access to the current contents of the array.
> However, if the array is declared by a 'my' variable in a loop, new
> storage is allocated for each reference. Alternatively, one can copy an
> array into an anonymous array (as in the *comments* in the examples
> below), and store a reference to that.
>
> > Ala Qumsieh wrote:
> ...
> > > $data{$gate} = \@dests; # or = [@dests];
> > > $data{$gate}{$dest} = \@areas; # or = [@areas];
> > >
> > > Then, to access those arrays back, you need to dereference them:
> > >
> > > @dests = @{$data{$gate}};
> > > @areas = @{$data{$gate}{$dest}};
>
> There is great confusion here. The keys of %data are set up by the
> first store above to be references to arrays. The second store then
> treats them as references to hashes. The compiler complains "Can't
> coerce array into hash at ...".
>
> --
> Larry Rosler
> Hewlett-Packard Company
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
--
Bruce Hodo - Webmaster, GetAwayNetwork, Inc.
==Providing unique vacation information on the World Wide Web==
For Villas, Resorts, Hotels, Air/Hotel Packages, Charter Airfares
And Now Offering Travel Auctions!
=============== Visit us at http://getawaynet.com ===============
------------------------------
Date: Thu, 11 Mar 1999 17:21:17 -0500
From: John Chambers <john.chambers@gte.com>
Subject: Re: debugger mystery...
Message-Id: <36E841DD.BF300CDE@gte.com>
James Tolley wrote:
>
> Hello all,
>
> The debugger displays some of my code out of order. It also seems to
> skip over some while loops.
>
> Has anyone sen anything like this? What's causing it?
Yeah; I noticed that after I first picked up 5.004 many moons
ago. It doesn't happen all that often, but when it does, it
pretty much makes the debugger unusable. I've since seen it
on any number of different machines, including SunOS, Digital
Unix (OSF1), and linux, so it's definitely a new feature. I
asked a few questions and got no replies at all.
------------------------------
Date: Thu, 11 Mar 1999 22:31:20 GMT
From: Mike.Griswold@*spam*orst.edu (Michael Griswold)
Subject: Disableing NT Accounts
Message-Id: <36e840af.22324778@news.orst.edu>
I'm a PERL newbie, so bare with me please. :)
I have a text file of users in a Windows NT Domain that I want to read in and then disable all the accounts (to be deleted
later). I can not get anything to work as far as disableing the account. I loaded and sucessfully tested the AdminMisc module
and tried to use the following code that I found elsewhere stateing that it would do what I want, but to no avail.
use Win32::AdminMisc;
Win32::AdminMisc::UserSet MiscAttributes('\\\\server','username',USER_FLAGS,$Attributes{USER_FLAGS} |&UF_LOCKOUT) || die $!;
I don't fully understand (yet) what this line is doing, only adding to my confusion. It dies everytime. If anyone has
some code example they could post for me or could help me understand exactly what this line of code is doing I would be gratefull.
Thanks.
------------------------------
Date: Thu, 11 Mar 1999 17:21:29 -0500
From: James Tolley <jamesht@idt.net>
To: Mike Watkins <mwatkins@promotion4free.com>
Subject: Re: Executing SSI from CGI Output
Message-Id: <36E841E9.C09299ED@idt.net>
You can do it yourself.
open(F, "file.file");
while(<F>) {
if($_ =~ /<!--([^>]+)-->/) {
print $` . &do_ssi($1) . $';
next;
}
print $_;
}
###
sub do_ssi {
my $ssi = shift;
# process it
}
Don't know if this is what you had in mind, but it can be done this way.
hth,
James
------------------------------
Date: Thu, 11 Mar 1999 17:17:57 -0500
From: John Chambers <john.chambers@gte.com>
Subject: Failures compiling LWP modules on SunOS
Message-Id: <36E84115.C9C5C1C0@gte.com>
It started off going pretty well. But then several of the modules
(such as Digest-MD5-2.04) bombed with the output:
: make
cc -c -I/build/nightly.229/solaris.229-108-990126/contrib/SunOS/include -O -DVERSION=\"1.00\" -DXS_VERSION=\"1.00\" -Kpic -I/space/imail/perl/lib/CORE MD2.c
/usr/ucb/cc: language optional software package not installed
*** Error code 1
make: Fatal error: Command failed for target `MD2.o'
Current working directory /space/home/jc/src/perl/Digest-MD5-2.04/MD2
*** Error code 1
make: Fatal error: Command failed for target `subdirs'
:
Does anyone know what a "language optional software package" might
be, and how I would go about installing it? That does seem to be about
all it wants to tell me. It doesn't say which package is not installed,
and there doesn't seem to be a line number visible, so I can't check
with the MD2.c file to see what it was trying to reference.
A couple of other modules get the same error. But not all; most of
them compile just fine.
There's also that weird
-I/build/nightly.229/solaris.229-108-990126/contrib/SunOS/include
option. This seems to be a totally bogus path, and not even /build
exists on this system. Why would the Makefile have something like
this hard-coded?
------------------------------
Date: Thu, 11 Mar 1999 22:06:33 GMT
From: archon16@my-dejanews.com
Subject: How to modify the call stack?
Message-Id: <7c9ep2$qu0$1@nnrp1.dejanews.com>
Does anyone know how to modify the call stack (or continuation chain, or
scope stack, or whatever you want to call it) in Perl? I can *read* parts of
it, using the caller() function, but I can't figure out how to *modify* it.
I need this (I think) in order to implement my own ugly-hack version of
Thread.pm. I am aware that the original Thread module was written in C, but
I can't find the place in Thread.c where the call stack is saved/restored.
Basically, I want some way to save/restore *everything* needed for a thread
to pick up where it left off.
Thanks for any help,
- Archon
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 11 Mar 1999 18:36:37 -0500
From: William Yeung <wwyeung@undergrad.math.uwaterloo.ca>
Subject: How to you pass parameters into subroutines in Perl?
Message-Id: <36E85385.BE7AA26B@undergrad.math.uwaterloo.ca>
How to you pass parameters into subroutines in Perl?
Thanks.
------------------------------
Date: Thu, 11 Mar 1999 22:01:25 GMT
From: swamichandra@my-dejanews.com
Subject: IDE for Perl
Message-Id: <7c9efe$qhj$1@nnrp1.dejanews.com>
Is there any IDE (preferably graphical other than X-Emacs) for Perl
programming.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 11 Mar 1999 17:54:03 -0500
From: James Tolley <jamesht@idt.net>
To: kelby@mplx.com
Subject: Re: Link validation
Message-Id: <36E8498B.FD385790@idt.net>
try this:
use LWP;
use HTTP::Request;
print &check_url("http://www.perl.com/");
sub check_url {
my $url = shift;
my $ua = new LWP::UserAgent;
my $request = new HTTP::Request('GET',$url);
my $response = $ua->request($request);
return $response->is_success;
}
James
------------------------------
Date: 11 Mar 1999 15:24:56 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Link validation
Message-Id: <m190d3wqwn.fsf@halfdome.holdit.com>
>>>>> "James" == James Tolley <jamesht@idt.net> writes:
James> try this:
James> use LWP;
James> use HTTP::Request;
James> print &check_url("http://www.perl.com/");
James> sub check_url {
James> my $url = shift;
James> my $ua = new LWP::UserAgent;
James> my $request = new HTTP::Request('GET',$url);
James> my $response = $ua->request($request);
James> return $response->is_success;
James> }
Or simpler:
use LWP::Simple;
$is_good = defined get "http://www.perl.com";
--
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: Thu, 11 Mar 1999 22:49:23 GMT
From: John@melon17.freeserve.co.uk (John )
Subject: Re: Mysql question
Message-Id: <36e947b2.9096280@news.freeserve.net>
On Thu, 11 Mar 1999 13:59:56 -0800, Tobin Fricke
<tobin@cory.eecs.berkeley.edu> wrote:
>I think you're confused.. if you modify the database, the database is
>modified regardless of how you subsequently access it.
Yes I am confused a little.
I have created a mysql database, can access it
, but cannot find out/figure where the file is situated (not
visible on my web site).
John
>Tobin
------------------------------
Date: Thu, 11 Mar 1999 23:24:19 +0100
From: "CMB" <ceeembee@nlsport.com>
Subject: Re: Newbie Perl for NT question
Message-Id: <921191198.498358@pluto.cybercomm.nl>
Hai,
here is some text to configure IIS
To configure PERL script mapping
WARNING: Using Registry Editor incorrectly can cause serious, system-wide
problems that may require you to reinstall Windows NT to correct them.
Microsoft cannot guarantee that any problems resulting from the use of
Registry Editor can be solved. Use this tool at your own risk.
1.Start Regedt32.exe and open the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC
\Parameters\ScriptMap
2.Click Add Value from the Edit menu.
3.The Value Name is .pl
4.The Data type is REG_SZ.
5.The String value is <the full path to perl.exe>\perl.exe %s %s
NOTE: The "%s %s" is case sensitive. (e.g. "%S %S" will not work).
6.Restart the WWW service.
Now that the registry has been configured, you can test the PERL script with
your browser. Using the defaults directory structure with IIS, the URL would
be the following:
http://<Server Name>/scripts/helloworld.pl?
I'm not sure anymore if this is all you had to do, but it is a start.
I got these info from the web somewere, so if it is not enough, it's out
there
.
Goodluck
Ron Warlich
Mike Begeman heeft geschreven in bericht <36e2e889.0@news.glasscity.net>...
>I installed Perl on our NT server (IIS3). When I click on link in IE or
>Netscape that is supposed to run a perl script, it brings up the dialog for
>downloading the file (testperl.pl). Is there something I have to do to
IIS3
>to get it to run the script?
>
>Mike Begeman
>
>
------------------------------
Date: Thu, 11 Mar 1999 10:32:11 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: perl filters for inn
Message-Id: <rln8c7.2t8.ln@magna.metronet.com>
P.M.Wong (s11976@net1.hkbu.edu.hk) wrote:
: However the inn software encountered some problems lately.
: It couldn't be started suddenly.
Can you start it slowly instead :-)
: The error log reports this message:
: Global symbol "mode" requires explicit package name
All of the error messages that perl might issue are documented
in the perldiag.pod file that comes with every perl distribution.
For your message it says:
--------------
=item Global symbol "%s" requires explicit package name
(F) 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 "::").
--------------
: I had no idea of what this is. I posted under the nntp
: newsgroup and someone told me that it is
: a perl filter error.
: What exactly does it mean (i'm a newbie in perl)
See above.
It means you have used a variable without declaring the variable.
: He asked also if my perl pass -wc ?
: What does he mean ?
He means to ask perl to do a syntax check of a program without
executing the program. You do that like this:
perl -cw name_of_perl_program_file
: All in all, how do i go about fixing this perl filter thing
I don't know what INN's perl filter thing is or looks like.
Can't fix unseen code.
It really depends on how 'mode' is used in the program.
You might try putting
my $mode;
near the top of the script somewhere...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 11 Mar 1999 18:29:25 -0500
From: James Tolley <jamesht@idt.net>
To: Helen Zhou <hzhou@newbridge.com>
Subject: Re: Perl Question
Message-Id: <36E851D5.A3EB0BD5@idt.net>
#! /usr/local/bin/perl
#! /usr/local/tcsh
$searchStr = $ENV{'QUERY_STRING'};
$pathname = '/system/local/';
grep $search $pathname;
# read(STDIN, $buffer, $ENV{'QUERY_STRING'});
usually, one reads in STDIN like this:
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
#@filename = split(/&/, $buffer);
################
try the following:
use strict;
$|=1; # flush the buffer at each write.
print "Content-type: text/html\n\n";
my $pathname = "/path/path";
my @files;
my $param = 'param';
my $search = $ENV{'QUERY_STRING'} =~ /$param=([^&]+)/;
opendir(DIR, "$pathname") or print "Couldn't open the dir $pathname: $!" and exit;
while(my $file = readdir(DIR)) {
# assuming it's a GET request:
if($file =~ /\.html?$/i && $file =~ /$search/i) {
push(@files, $file);
}
}
print <<EndHdr;
<html><head><title>Search Results</title></head>
<p>
<h2>Search Results</h2>
<ul>
EndHdr;
foreach my $filename (@files) {
print "<li><a href=\"$pathname/$filename\">$filename</a><BR>\n";
}
print <<EndFooter;
</ul>
<p>
</body>
</html>
EndFooter
;
This might need some tweaking. The script above assumes that the request is GET and
that the string is handed to the script as a value called 'param'.
hth,
James
------------------------------
Date: 11 Mar 1999 23:45:54 GMT
From: hakan@hobbe.lub.lu.se (Hakan Ardo)
Subject: Perl segfaulting with Argument "CLIKE" isn't numeric in regcomp
Message-Id: <7c9kji$7co$2@news.lth.se>
Hi,
I'm having problem with perl. I'm working on a perl library for
viewing and editing msql databases with relations on the web and all
of a suden it started to say:
Argument "CLIKE" isn't numeric in regcomp at
blib/lib/DBIx/HTMLView/Selection.pm line 220.
and then it segfaults. Selection.pm looks like this at rows 219 to 224:
219 foreach ($self->opps) {
220 if ($self->{'str'} =~ s/^$_//) {
221 $self->token("opp",$_);
222 return;
223 }
224 }
$self->opps returns the following array: ['<', '>', '=', '<=', '>=',
'<>', 'LIKE', 'RLIKE', 'CLIKE'], and if I add a "print $self->{'str'}"
between line 219 and 220 to check it the error goes away and
everything works just fine.
I've tried both with perl v 5.005_02 and 5.004_04.
Any sugestions on what might be worng?
--
---------------------------------------------------------------
Name: Hakan Ardo
E-Mail: hakan@debian.org
WWW: http://www.ub2.lu.se/~hakan/sig.html
Public Key: Try "finger hakan@master.debian.org"
Fingerprint: E9 81 FD 90 53 5C E9 3E 3D ED 57 15 1B 7E 29 F3
Interests: WWW, Programming, 3D graphics
Thought for the day: As long as one understands, the
spelling does not matter :-)
---------------------------------------------------------------
------------------------------
Date: 11 Mar 1999 22:37:30 GMT
From: mikebvc@ripco.com (Mike Stillman)
Subject: Re: perlexe.pl problems?
Message-Id: <7c9gja$5t5$1@gail.ripco.com>
Andrew Beer (abeer@hplb.hpl.hp.com) wrote:
: I'm trying to create a standalone executable from a perl script I have
: written but keep coming across the same error regardless of what perl
: module I use to send mail. The compilation error messages are as
: follows.
: Failed to Load Net::SMTP Failed to Load Socket
: BEGIN failed--compilation aborted (in cleanup) Failed to Load Socket
: BEGIN failed--compilation aborted at (eval 4) line 13.
I've found that the Win32 versions of Perl2exe (the demo) and
Pl2Exe (the commercial release) work well with simple programs, but
run into difficulties compiling larger scripts that call on many
packages and DLLs. I couldn't get the Service Pack version of Pl2exe
to include any DLLs or packages, and had only slightly better luck when
I restored the Resource Kit CD version. I was trying to make executable
a script of 100+ lines that used Tk and some Net packages, but like
your script above, Pl2exe didn't include everything necessary to run
the program on a workstation without Perl installed, even though the
executable ended up being 1.8 Mb in itself.
_.,-*~'`^'*-,._ _.,-*'`^'*-,.
'*-,._ Mike Stillman '*-,
'*-,.__.,-*' Chicago, IL _.,-*~'`^'*-,._
mikebvc@rci.ripco.com '*-,._.,-*'`^ '
------------------------------
Date: Thu, 11 Mar 1999 22:32:24 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Printing in Perl
Message-Id: <ebohlmanF8GBy0.3EL@netcom.com>
Bart Lateur <bart.lateur@skynet.be> wrote:
: Larry Rosler wrote:
: >Why 'a seriously
: >outdated concept'?
: Because it looks so unprofessional. Unreadable. If books were printed in
: fixed pitch font, people would read A LOT less than they do now.
Fixed-width fonts are certainly less readable than variable-width fonts
for *prose*. But Perl's report facilities were never intended for
producing prose. They were intended for producing tabular material,
where different readability considerations apply.
------------------------------
Date: Thu, 11 Mar 1999 23:28:59 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: problems reading HTML file
Message-Id: <ebohlmanF8GEKB.AFt@netcom.com>
Cybernetic Bear <cybear_x[nospam]@geocities.com> wrote:
: The HTML files I am working with are created by various sources, some
: read in just fine, others seem to miss lines. I am trying to get the
: title of the HTML file. the syntax I am using is:
: open (FILE, $indexfile);
: while (<FILE>){
: my $line = <FILE>;
: chomp ($line);
: #print "\nUser: $user line: $line";
: if ($line =~ /<TITLE>/i){ #match line against <TITLE>
: tags
: print "\nline: $line";
: $line =~ s/<TITLE>//i; #remove first title tag
: $line =~ s/<\/TITLE>//i; #remove last title
: tag
: print " title: $line";
: my $titlefound = 1;
: return $line; #return title
: }
Even if you fix the problems others have pointed out to you, this still
won't work in general. Nothing in the HTML specification requires
elements to be all on one line;
<TITLE>
An Illustration of the Lack of Significance of Consecutive Spaces
</TITLE>
is perfectly legal HTML, but your program can't deal with it. It's also
possible for "<TITLE>" to appear in places (such as comments or quoted
literals) where it isn't actually the opening tag for a <TITLE> element.
I'd strongly suggest you get (if you don't already have it)
HTML::HeadParser, and learn how to use it. It makes this sort of thing a
piece of cake.
------------------------------
Date: 11 Mar 1999 14:15:36 +0800
From: morpheus@no-spam.calweb.com (Steve Lamb)
Subject: Re: Problems with Perl and tar
Message-Id: <slrn7egg47.bas.morpheus@teleute.rpglink.com>
On 9 Mar 1999 14:59:18 +0800, Steve Lamb <morpheus@no-spam.calweb.com> wrote:
> From the command line, it works fine. Inside perl, however, the console
>gets spew from tar at some point. Here is the command:
>system("/bin/sh -c 'tar cpsf - $files | tee /backup/$locmount.tar | tar xpvf
>- -C /backup/local/$locmount > /backup/$locmount.cat'");
OK, found the problem. For some reason $files was getting a new line
added to the end of it. I was chomp()ing the string it came from when
reading it into an array but apparently that didn't take care of it all. So
when system() passed the string to /bin/sh it was only getting the first tar
which, as it was told, spews to the console. :/
--
Steve C. Lamb | Opinions expressed by me are not my
http://www.calweb.com/~morpheus | employer's. They hired me for my
ICQ: 5107343 | skills and labor, not my opinions!
---------------------------------------+-------------------------------------
------------------------------
Date: Thu, 11 Mar 1999 19:41:53 -0500
From: James Tolley <jamesht@idt.net>
To: pabs2000@my-dejanews.com
Subject: Re: Regex help needed
Message-Id: <36E862D0.D0338EDD@idt.net>
pabs2000@my-dejanews.com wrote:
> I want to create a regular expression that reads the log file and, just prior
> to displaying the file's contents, replaces all occurrences of the newline
> character, except the final one in the record. I end each record with "!!!".
> Is it possible to do what I'm asking? Is there a better way to do so?
>
If you want to store the info in one-line-per-submission format (a handy format,
to be sure):# this is the non- 'use CGI' way, but you really should use CGI
if/when you can.
for (keys %in) {
$in{$_} =~ s/\r\n/ <BR>/g; # use '<BR>' to maintain the format of the message
when outputting as html.
}
That's it.
hth,
James
------------------------------
Date: Thu, 11 Mar 1999 18:14:13 -0500
From: Ian Goldstein <nnygsi@ny.ubs.com>
Subject: regular expression
Message-Id: <36E84E45.BD81D130@ny.ubs.com>
Hello all...
I am attempting to parse an amd map.
$!/usr/local/bin/perl
open(C,"ypcat -k amd.home |") {
$user = $rhost = $rfs = $_;
$user =~ s/^(.+)\s+.*$/$1/;
$rhost =~ s/rhost:=(.+)\;/$1/;
$rfs =~ s/rfs:=(.+)\;/$1/;
printf("%10s %15s %s\n",$user,$rhost,$rfs);
}
Here is an example of the output.
username
host!=server;type:=nfs;rhost:=server;rfs:=/export/home/user;opts:=rw,hard,intr
host==server;type:=link;fs:=/export/home/user
Any suggestions?
Please respond by e-mail as well as posting.
Thanks in advance
Ian
------------------------------
Date: Thu, 11 Mar 1999 23:56:06 +0000
From: On Line Auctions UK <support@onlineauctions.co.uk>
Subject: Sending data to another script
Message-Id: <36E85816.31CA0210@onlineauctions.co.uk>
I'm trying to send data to a http server basically i just want to open a
page on another server in the form
http://myhost.com/cgiscript?var1=stuff&var2=stuff2 so the data gets sent
to another script on another server.
Does any one have any ideas please let me know
Gary Mayor
------------------------------
Date: 12 Mar 1999 00:21:48 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: Speed-optimizing regular expressions
Message-Id: <921198096.938199@elaine.drink.com>
In article <wRBF2.10834$Ge3.43045840@news.itd.umich.edu>,
Sean McAfee <mcafee@waits.facilities.med.umich.edu> wrote:
>This was the first method I thought of, but Joe mentioned that there were
>~250 different domains. I assumed that most operating systems won't allow
>this many open files at once. I just tried opening lots of files on
>Solaris 2.6, and it balked at opening the 61st. Hmmm. Now I tried the
This is exactly what the FileCache module was designed to handle.
perldoc FileCache
------------------------------
Date: Thu, 11 Mar 1999 10:19:12 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: test if a string is in an array?
Message-Id: <gtm8c7.2t8.ln@magna.metronet.com>
David Lambert (dalambert@rocketmail.com) wrote:
: What is the most efficient way to test for the occurrence of a string in an
: array?
The most efficient way would have been to look it up in the
Perl FAQ, part 4 rather than posting.
Too late for that now though.
Now you'll have to settle for a less than most efficient way,
which is to ask tens of thousands of people who have seen
your questions hundreds of times, and get a few dozen pointers
back to the FAQ, where you should have been in the first place.
:-)
"How can I tell whether a list or array contains a certain element?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 11 Mar 1999 19:31:48 -0500
From: James Tolley <jamesht@idt.net>
To: olmert@netvision.net.il
Subject: Re: using variables in patterns
Message-Id: <36E86074.90202DC5@idt.net>
Here you go:
$string = 'hello';
while(<STDIN>) {
print "match.\n" if $_ =~ /$string/;
}
hth,
James
------------------------------
Date: Thu, 11 Mar 1999 19:14:16 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Which CGI Perl module/lib to use?
Message-Id: <alecler-1103991914160001@dialup-697.hip.cam.org>
[courtesy e-mail copy sent to karabot@cam.org]
In article <36E7FF16.8599D3AD@cam.org>, George Karabotsos
<karabot@cam.org> wrote:
> Hello guys,
>
> is there any Perl module for CGIs you recomend I use?
CGI.pm is the standard module for writing CGI applications. It's part of
standard perl distribution, so you can use it without having to install
anything.
There are also individual CGI::* modules, that are lighter than CGI.pm,
that you can download from www.cpan.org.
Consider how easy CGI makes it to retrieve and decode a query (example only):
use CGI qw/:standard/;
print header;
foreach (param) {
print "$_ : ", join(' - ', param $_), "<br>\n";
}
HTH,
Andre -- alecler@cam.org
------------------------------
Date: Thu, 11 Mar 1999 23:33:36 GMT
From: andrew_linmax@my-dejanews.com
Subject: Writing to Temp file a couple fo times.. then reading back into a form... then deleteing file once finished...
Message-Id: <7c9jsg$vhm$1@nnrp1.dejanews.com>
Hi,
I was just wondering how to do the following :
Writing to Temp file a couple fo times.. then reading back into a form... then
deleteing file once finished...
if you know of any scripts already made... please send me :o)
Thanks...
Andrew
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
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 5114
**************************************