[10268] in Perl-Users-Digest
Perl-Users Digest, Issue: 3861 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 30 19:07:31 1998
Date: Wed, 30 Sep 98 16:01:44 -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 Wed, 30 Sep 1998 Volume: 8 Number: 3861
Today's topics:
Re: Alternate colors in tables with perl command? (Ken Fox)
Re: BANIP (Marc Bissonnette)
Re: BANIP <sneaker@sneex.fccj.org>
can't find loadable module? help.. <wweng@attila.stevens-tech.edu>
Re: can't find loadable module? help.. (Honza Pazdziora)
Can't generate HTML! Why??? <kchunt@mail.hac.com>
changing shell launched from system()? <digital_puer@hotmail.com>
Re: elements of an array passed as args to embedded exp <jdporter@min.net>
Help on sorting <gerskine@rrippl.com.au>
Help with regular expression!!! nguyen.van@imvi.bls.com
Re: How do I do this c-ish pointerly thing in perl? (Ken Fox)
Re: How to make the MAKE! ??? <REPLY_TO_damonbrent@earthlink.net>
Re: How to make the MAKE! ??? <anthony@nc.com>
Re: I hate it when I do that. (Andrew M. Langmead)
Re: Need help with interpolation of a scalar !! ? (Steve maZe)
Re: Need IP Address Sort Subroutine (Mark-Jason Dominus)
PERL and Win32 TIME <swwoolse@sprintparanet.com>
Perl Security Feature? <mhicks@nowis.com>
soft reference to object? <kin@omni.c-cube.com>
Re: SRC: encrypt your Perl scripts! :-) <eashton@bbnplanet.com>
Re: system function question <metcher@spider.herston.uq.edu.au>
Re: Uploading file to browser <damonbrent@earthlink.net>
Web crawler? <stewart.taylor@skt.co.uk>
Re: Win32 <swwoolse@sprintparanet.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 30 Sep 1998 21:33:05 GMT
From: kfox@pt0204.pto.ford.com (Ken Fox)
Subject: Re: Alternate colors in tables with perl command?
Message-Id: <6uu82h$bd7@eccws1.dearborn.ford.com>
abigail@fnx.com (Abigail) writes:
> Daniel Pray (daniel@intecomp.com) wrote:
> ++ I've seen some professional web site that have a perl script list a
> ++ database request. The table is alternated rows of color. Does anyone
> ++ know how to do this?
>
> I would use crayons.
Be sure to provide an alternate version of your table for people with high
temperature output devices as the wax can melt and ruin the presentation.
I usually find that tables displayed using the color-by-number technique
are simpler, more portable and more easily customized by the reader. I
can't recommend the traditional black velvet background though because it
doesn't compress very well.
- Ken
--
Ken Fox (kfox@ford.com) | My opinions or statements do
| not represent those of, nor are
Ford Motor Company, Powertrain | endorsed by, Ford Motor Company.
Analytical Powertrain Methods Department |
Software Development Section | "Is this some sort of trick
| question or what?" -- Calvin
------------------------------
Date: 30 Sep 1998 20:23:46 GMT
From: dragnet@internalysis.com (Marc Bissonnette)
Subject: Re: BANIP
Message-Id: <6uu40i$7p9$1@news.interlog.com>
In article <3612647C.7FB899C7@fccjmail.fccj.cc.fl.us>,
webmaster@fccjmail.fccj.cc.fl.us says...
>
>Marc Bissonnette wrote:
>>
>> Unless the HTML page being called was in fact being read by the CGI itself,
>> i.e., change your root page to index.cgi and do the Perl/IP checking before
the
>> HTML is displayed (Assuming his server supports using index.cgi as a default
>> document)
>
>Hmm, then it would not be calling an HTML page, it would
>be calling a CGI...
>
Yes, but I'm assuming he wants to block certain IP's from seeing the content of
his site, or section thereof. If the first page loaded was index.cgi, the IP
checking could be performed, then, if passed, the script could print to browser
the html (which users could then navigate the site with html only).
It's not secure by a long shot, i.e. if a banned user knew the URL to any page
within the site, (s)he could get to it, but it's a start :)
(I'm also assuming the original poster doesn't have root access to the
webserver, where it would probably be a lot easier to set up bans...)
--
Marc Bissonnette
InternAlysis
Corporate Internet Research and Results!
http://www.internalysis.com
------------------------------
Date: Wed, 30 Sep 1998 17:06:49 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: BANIP
Message-Id: <36129D69.151126AC@sneex.fccj.org>
Marc Bissonnette wrote:
>
> Unless the HTML page being called was in fact being read by the CGI itself,
> i.e., change your root page to index.cgi and do the Perl/IP checking before the
> HTML is displayed (Assuming his server supports using index.cgi as a default
> document)
>
I tried to respond to both your mailings but your
server doesn't exist. Hmmm...
At any rate, that would still fall under .htaccess guidelines,
even if the original poster doesn't have root access.
:]
-Sneex-
__________________________________________________________________
Bill Jones | FCCJ Webmaster | http://webmaster.fccj.org/Webmaster
__________________________________________________________________
We are the CLPM... Lower your standards and surrender your code...
We will add your biological and technological distinctiveness to
our own... Your thoughts will adapt to service us...
...Resistance is futile...
------------------------------
Date: 30 Sep 1998 21:37:57 GMT
From: Wei Weng <wweng@attila.stevens-tech.edu>
Subject: can't find loadable module? help..
Message-Id: <6uu8bl$gvf$1@apocalypse.dmi.stevens-tech.edu>
Hi all
I was trying to access Oraperl module installed on school server.
But everytime I tried to access it, it gave me error:"
Can't find loadable object for module DBI in @INC
(/opt/gnu/lib/perl5/site_perl /usr/share/lib/perl5/irix-n32/5.003
/usr/share/lib/perl5 /usr/share/lib/perl5/site_perl/irix-n32
/usr/share/lib/perl5/site_perl .) at /opt/gnu/lib/perl5/site_perl/DBI.pm
line 81
The oraperl.pm file is in /opt/gnu/lib/perl5/site_perl directory. And I
already set up PERL5LIB to /opt/gnu/lib/perl5/site_perl
What more do I need to do to fix it?
thanks in advance
--
Wei Weng
--- May star fall upon you ---
------------------------------
Date: Wed, 30 Sep 1998 22:10:00 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: can't find loadable module? help..
Message-Id: <slrn715b1o.l58.adelton@aisa.fi.muni.cz>
On 30 Sep 1998 21:37:57 GMT, Wei Weng <wweng@attila.stevens-tech.edu> wrote:
> Hi all
> I was trying to access Oraperl module installed on school server.
> But everytime I tried to access it, it gave me error:"
> Can't find loadable object for module DBI in @INC
> (/opt/gnu/lib/perl5/site_perl /usr/share/lib/perl5/irix-n32/5.003
> /usr/share/lib/perl5 /usr/share/lib/perl5/site_perl/irix-n32
> /usr/share/lib/perl5/site_perl .) at /opt/gnu/lib/perl5/site_perl/DBI.pm
> line 81
>
> The oraperl.pm file is in /opt/gnu/lib/perl5/site_perl directory. And I
> already set up PERL5LIB to /opt/gnu/lib/perl5/site_perl
The module is not installed properly. Are you sure that whoever
installed the module did more than just copy the *.pm file somewhere?
Oraperl needs (IMHO) to be compiled.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: Wed, 30 Sep 1998 13:25:46 -0700
From: Kenneth Hunt <kchunt@mail.hac.com>
Subject: Can't generate HTML! Why???
Message-Id: <361293CA.1F6C08B1@mail.hac.com>
I think I've hit a wall.
I'm trying to generate an HTML document with my Perl script. I'm reading
in a list from a file and putting that into an option list.
The problem is I can generate everything except the a drop-down list in
a form. When I call the script from netscape I get everything in the
page I want but that list, and it is driving me crazy! The strange part
is that when I run the script from a UNIX prompt, it spits out the HTML
code with all the options in the list...no problem. What am I doing
wronge?
part of the script is below...
print "Content-type: text/html\n\n";
print<<END;
<HTML>
<HEAD>
...[snip]
<TABLE CELLPADDING="5">
<TR>
<TD WIDTH=200 valign=top ALIGN=RIGHT><BIG><BIG>Picture
Gallery</BIG></BIG><BR>
<HR>
</TD>
<TD WIDTH=20 valign=top ALIGN=LEFT></TD>
<TD WIDTH=620 valign=top ALIGN=LEFT>
<FORM ACTION="http://queen.es.hac.com/~datcntrl/cgi-bin/picture.cgi">
<P ALIGN=Left>
<B>List of Images:</B><BR>
<SELECT NAME="picture">
END
#------------ OPTION LIST GENERTION ---------------#
for($x=0; $x < $len; $x++) {
if ($x == 0) {
print "<OPTION SELECTED>$options[$x]\n";
} else {
print "<OPTION>$options[$x]\n";
}
}
for($x=0; $x < $len; $x++) {
print "$options[$x]";
}
#--------------------------------------------------#
print<<END;
</SELECT><BR>
<INPUT TYPE=submit VALUE="Show Me This Unit!"><BR>
</FORM>
<P>
<B>View thumbnail images of:</B>
<UL>
<LI>
Input Multiplexers
<LI>
Output Multiplexers
<LI>
Payload Filters
<LI>
Switch and Mobile Filters
</UL>
<P>
</TD>
</TR>
</TABLE>
<P ALIGN=Center>
</BODY></HTML>
END
exit;
--
------------------------------------------------------
Kenneth Hunt
SC S12 V321 Rm. C233
office: 364-7755 pager: 715-0600
------------------------------------------------------
------------------------------
Date: Wed, 30 Sep 1998 14:05:20 -0700
From: Digital Puer <digital_puer@hotmail.com>
Subject: changing shell launched from system()?
Message-Id: <36129D10.E640C6AA@hotmail.com>
Hi, how do you change the shell that is launched from a system()
call? The sh shell is started when I use system(), but I want it
to be the csh. I apologize if this is a FAQ, but I couldn't find
it in the FAQ list.
------------------------------
Date: Wed, 30 Sep 1998 16:32:32 -0400
From: John Porter <jdporter@min.net>
Subject: Re: elements of an array passed as args to embedded expect.
Message-Id: <36129560.A34F095B@min.net>
mmurphy@infomedics.com wrote:
>
> Hi, I'm able to set the contents of a given file into an array.
> I can then print each line separately to stdout.
> How do I pass each element of a given line
> as an argument to another (embedded) script.
> So I'd have multiple lines like this:
> cust,job1,job2,dat1,dat2,dat3,dat4
>
> And I want to pull one line, split on /,/
> set $var1
> $var2
> $var3
> (etc...)
> and pass them to an embedded expect script.
> (it works if hardcoded...)
I'm having a hard time figuring out what you're trying to do.
Could you post the code you have? Let's see how it works
with hard-coded values, and take it from there.
--
John "Many Jars" Porter
------------------------------
Date: Thu, 1 Oct 1998 07:07:39 +1000
From: "Greg Erskine" <gerskine@rrippl.com.au>
Subject: Help on sorting
Message-Id: <6uu6el$6po$1@merki.connect.com.au>
Could anyone help. I am developing a script to read our proxy logs
and generate a report listing users and sites visited. To do this
I need read our logs then sort on sites then sort on users.
The code that follows is a example of what I am trying to do.
Unfortunately, the results aren't what I expect. I have tried all
the obvious (to me) sources of help. I suspect I am missing
something obvious, but the more I try the more confused I get.
Thanks in advance.
Code
====
#C:\Perl\5.005\bin\MSWin32-x86-object\perl.exe -w
use strict;
my(@Countries) = ();
while (<>) {
chop;
my($Country, $Population) = split(",",$_);
push(@Countries, {
Country => $Country,
Population => $Population
});
}
print "\nResult\n";
print "======\n";
my @sortbypopulation = (sort { ($::a->{Population}) <=>
($::b->{Population}) } @Countries);
for my $Country (@sortbypopulation) {
print "$$Country{Country} : $$Country{Population}\n";
}
print "\n";
my @sortbycountry = (sort { ($::a->{Country}) cmp ($::b->{Country}) }
@sortbypopulation);
for my $Country (@sortbycountry) {
print "$$Country{Country} : $$Country{Population}\n";
}
Input
====
Aus,241961
India,140440000
China,106941
India,773430000
China,81230000
China,241960000
Aus,241960
France,14
China,341960000
Aus,241962
France,1
Result
======
France : 1
France : 14
China : 106941
Aus : 241960
Aus : 241961
Aus : 241962
China : 81230000
India : 140440000
China : 241960000
China : 341960000
India : 773430000
Aus : 241960
Aus : 241961
Aus : 241962
China : 241960000
China : 341960000
China : 106941
China : 81230000
France : 1
France : 14
India : 140440000
India : 773430000
------------------------------
Date: Wed, 30 Sep 1998 22:02:10 GMT
From: nguyen.van@imvi.bls.com
Subject: Help with regular expression!!!
Message-Id: <6uu9p1$gvg$1@nnrp1.dejanews.com>
Hi gus,
I have a little problem with regex. Below is my access file. I want to print
out to a file with only "crno=number"(i.e crno=7035269) and
"Mozilla/number.numbers"(i.e Mozilla/3.0). However, I just want to pick these
out of lines without AOL number.numbers(i.e AOL 3.01) and MSIE
number.numbers(i.e MSIE 4.02). For example, I'm interested in the following
lines: 207.172.36.247 - - [30/Jul/1998:00:49:16 -0400] "GET
/GFX/quick_gray.gif HTTP/1 .0" 304 0
"http://www.yp.bellsouth.com/?mkt=****&crno=7035273" "Mozilla/4.5b1 [ en]
(WinNT; I)"
207.60.68.173 - - [30/Jul/1998:00:49:13 -0400] "GET /?mkt=MBAL&crno=7003145
HTT P/1.0" 200 19278 "http://www.yp.bellsouth.com/?mkt=****&crno=7003145"
"Mozilla/ 4.5b1 [en] (Win95; I)"
but the following lines:
206.27.179.212 - - [30/Jul/1998:00:49:43 -0400] "GET
/cgi-bin/rd?t=c&evt=20&mkt
=NO&crno=7035280&a=http://www.realguides.com/automotive%3fmkt=NOLA%26crno=703
52 80 HTTP/1.1" 302 0 "http://yp.bellsouth.com/?mkt=NOLA" "Mozilla/4.0
(compatible ; MSIE 4.01; Windows 95)"
152.163.206.184 - - [30/Jul/1998:00:49:06 -0400] "POST /?mkt=NATN HTTP/1.0"
200 10177
"http://yp.bellsouth.com/?MAPOZI!=&crno=7035242&type=B&str=gte+wireless&
city=nashville&mkt=NATN&cityid=0%2c243&geoid=0%2c243&geo=C&irno=3509503&beg=0
&p
g=MAPOZI&mapZ=1&mapI=79091&mapL=3fbfaabd50f40cb0a1c0ce26f2cc401c&mapS=24000&m
ap B=12000" "Mozilla/2.0 (compatible; MSIE 3.01; AK; AOL 3.0; Windows 95)"
I tried some things like following but not succeed:
printf HANDLE_NETSCAPE ("%10s %7s\n" ,$1, $2) if ( $_ =~
/\b(crno=\d{2,})\b.*\b(Mozilla\\\d\.\d+)\b.*[^(MSIE\s\d\.\d+)].*[^(AOL\s\d\.\
d+)]/);
Your help is appreciated.
Thanks Van Nguyen
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
------ 205.147.245.41 - - [30/Jul/1998:00:49:32 -0400] "GET
/GFX/quick_gray.gif HTTP/1 .0" 304 -
"http://www.yp.bellsouth.com/?mkt=****&crno=7035269" "Mozilla/3.0Gold
(Win95; U)" 205.147.245.41 - - [30/Jul/1998:00:49:32 -0400] "GET
/?mkt=****&crno=7035269 HT TP/1.0" 200 14122 "http://www.yp.bellsouth.com/"
"Mozilla/3.0Gold (Win95; U)" 207.60.68.173 - - [30/Jul/1998:00:49:17 -0400]
"GET /?mkt=HUAL&crno=7003145 HTT P/1.0" 200 20208
"http://www.yp.bellsouth.com/?mkt=****&crno=7003145" "Mozilla/ 4.5b1 [en]
(Win95; I)" 207.172.36.247 - - [30/Jul/1998:00:49:16 -0400] "GET
/GFX/quick_gray.gif HTTP/1 .0" 304 0
"http://www.yp.bellsouth.com/?mkt=****&crno=7035273" "Mozilla/4.5b1 [ en]
(WinNT; I)" 152.163.206.184 - - [30/Jul/1998:00:49:06 -0400] "POST /?mkt=NATN
HTTP/1.0" 200 10177
"http://yp.bellsouth.com/?MAPOZI!=&crno=7035242&type=B&str=gte+wireless&
city=nashville&mkt=NATN&cityid=0%2c243&geoid=0%2c243&geo=C&irno=3509503&beg=0
&p
g=MAPOZI&mapZ=1&mapI=79091&mapL=3fbfaabd50f40cb0a1c0ce26f2cc401c&mapS=24000&m
ap B=12000" "Mozilla/2.0 (compatible; MSIE 3.01; AK; AOL 3.0; Windows 95)"
207.60.68.173 - - [30/Jul/1998:00:49:13 -0400] "GET /?mkt=MBAL&crno=7003145
HTT P/1.0" 200 19278 "http://www.yp.bellsouth.com/?mkt=****&crno=7003145"
"Mozilla/ 4.5b1 [en] (Win95; I)" 206.27.179.212 - - [30/Jul/1998:00:49:41
-0400] "GET /cgi-bin/rd?t=c&evt=20&mkt
=NO&crno=7035280&a=http://www.realguides.com/automotive%3fmkt=NOLA%26crno=703
52 80 HTTP/1.1" 302 0 "http://yp.bellsouth.com/?mkt=NOLA" "Mozilla/4.0
(compatible ; MSIE 4.01; Windows 95)" 206.27.179.212 - -
[30/Jul/1998:00:49:43 -0400] "GET /cgi-bin/rd?t=c&evt=20&mkt
=NO&crno=7035280&a=http://www.realguides.com/automotive%3fmkt=NOLA%26crno=703
52 80 HTTP/1.1" 302 0 "http://yp.bellsouth.com/?mkt=NOLA" "Mozilla/4.0
(compatible ; MSIE 4.01; Windows 95)"
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
------
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 30 Sep 1998 21:11:37 GMT
From: kfox@pt0204.pto.ford.com (Ken Fox)
Subject: Re: How do I do this c-ish pointerly thing in perl?
Message-Id: <6uu6q9$bd6@eccws1.dearborn.ford.com>
mcafee@waits.facilities.med.umich.edu (Sean McAfee) writes:
> Jedediah D. Parsons <jed@glug.hip.berkeley.edu> wrote:
> > What's a perl equivalent for this?:
> > while (*a != '\0') do_something_with(a++);
>
> while ($a =~ /(.)/gs) {
> do_something_with($1);
> }
Your example doesn't stop on a NUL. I don't know if this is
important, but a lot of C string handling code doesn't grok NUL.
> Alternately, you could write an extension which accesses the internal
> representation of the string, and loops through the characters in pretty
> much the same way as in your sample code.
Perl is fabulous at string handling. C is fabulous for byte handling.
I've usually found that my C byte munging algorithms don't port to
Perl very well. It's better to rewrite them. String parsing is a
great example of how applying the C approach will yield ridiculous Perl.
If you really need to iterate over letters, using substr() or a regex
will (probably) be faster than using an XSUB to grab a letter. Been
there, done that. I was mildly surprised to say the least.
- Ken
--
Ken Fox (kfox@ford.com) | My opinions or statements do
| not represent those of, nor are
Ford Motor Company, Powertrain | endorsed by, Ford Motor Company.
Analytical Powertrain Methods Department |
Software Development Section | "Is this some sort of trick
| question or what?" -- Calvin
------------------------------
Date: Wed, 30 Sep 1998 17:05:18 -0500
From: brent verner <REPLY_TO_damonbrent@earthlink.net>
Subject: Re: How to make the MAKE! ???
Message-Id: <3612AB1E.F16CAD32@earthlink.net>
dragnovich@my-dejanews.com wrote:
>
> Ok folks !! Im back! I have perl for win (ActiveState) and I whant to install
> somo modules like ::LZH, and ::FILTER but!
> It say in the installing intructions it's easy! just type :
>
> perl MakeFile.PL (I type it ! AND WORKS!!! YEA!!!)
> make (command not found =4( BBbbbuuuuaaaaaa )
> make install (command not found =4( BBbbbuuuuaaaaaa )
> make test (command not found =4( BBbbbuuuuaaaaaa )
>
> Ok ! Lets donwnload the Make program!
> I download the GNU make distriobution !! YES!!
> HoHo !!! it requieres the GNU gcc ! to compile in MSDOS/Windows !
>
> But I try to find it and there is not GNU gcc or a Shareware, freeware, or
> someting in the net! soo how can I compile it ?? Note I dont have ANY C
> compiler If you know something that can substitute and the modification, it
> will be very helpfull for me. (please send URL's! for that!)
>
> ------------------------
> Juan Carlos Lopez
> QDesigns President & CEO
> http://www.qdesigns.com
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
doh! no compiler! you really, really do need one. do a search for 'dgpp'
on your favorite search engine -- dgpp is a dos port of the gnu gcc
compiler. it will suffice for compiling basic modules, but the
networking/socket code is broken AFAIK. i don't know of any other free
compilers for windows. you may want pick up borland's, er, inprise's,
compiler (comes with C++ Builder now) for a good price.
hth.
brent
------------------------------
Date: Wed, 30 Sep 1998 14:46:06 -0700
From: Anthony Lee-Masis <anthony@nc.com>
To: dragnovich@my-dejanews.com
Subject: Re: How to make the MAKE! ???
Message-Id: <3612A69E.7894F91C@nc.com>
Try this,
http://www.delorie.com/djgpp/
dragnovich@my-dejanews.com wrote:
> But I try to find it and there is not GNU gcc or a Shareware, freeware, or
> someting in the net! soo how can I compile it ?? Note I dont have ANY C
> compiler If you know something that can substitute and the modification, it
> will be very helpfull for me. (please send URL's! for that!)
>
> ------------------------
> Juan Carlos Lopez
> QDesigns President & CEO
> http://www.qdesigns.com
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 30 Sep 1998 20:59:15 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: I hate it when I do that.
Message-Id: <F047Mr.Cvv@world.std.com>
Jonathan Feinberg <jdf@pobox.com> writes:
>I'd say that once a day, on average, I write this:
> $foo = s/something/something else/;
For this particular problem, would the UnderScore.pm module in the
Perl Cookbook help? Or are there too many places that you do use $_.
no UnderScore;
$foo = s/something/something else/;
Read access to $_ forbidden at junk.pl line 6
--
Andrew Langmead
------------------------------
Date: Wed, 30 Sep 1998 21:56:33 GMT
From: steveg@nospam.org (Steve maZe)
Subject: Re: Need help with interpolation of a scalar !! ?
Message-Id: <3612a850.533507080@news.usmicro.com>
On 29 Sep 1998 18:14:47 -0400, Uri Guttman <uri@camel.fastserv.com>
wrote:
ok final question on that subject :
why would this line :
$pagehit = `grep -c $current $logfile`;
knowing that $logfile is fine (used somewhere else and works fine) and
that current contains something like info.html
$pagehit is always 0
and if you do it this way
$pagehit = `grep -c 'current' $ogfile`;
$pagehit becomes the total line length of the file in $logfile... I
need grep to find how many lines have $current in them (what is inside
the var abviously ??
don't get why it doesn't work ... ??
THx
Steve
>>>>>> "Sm" == Steve maZe <steveg@nospam.org> writes:
>
> Sm> 29 Sep 1998 16:48:49 -0400, Uri Guttman <uri@camel.fastserv.com>
> Sm> wrote:
>
> >> use the Basename module or some other common method to get the filename
> >> from a path. forking a process to do it is a big waste of cpu time.
>
> Sm> didn't know one existed but I am learning
> Sm> I am assuming it's something like $current = basename($temp);
>
>do a search on dejanews for basename to see some threads on using the
>module and other builtin ways to do that. it's perl's motto, there is
>more than one way to do it.
>
>uri
>
>--
>Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
>uri@fastengines.com http://www.fastengines.com
------------------------------
Date: 30 Sep 1998 16:59:17 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Need IP Address Sort Subroutine
Message-Id: <6uu635$nq2$1@monet.op.net>
In article <36124B48.DA6515B8@min.net>, John Porter <jdporter@min.net> wrote:
>You could wrap that little operation with a sub
>which you can then memoize:
>
> use Memoize;
> sub pack_split { pack("C4",split(/\./,shift)) }
> memoize 'pack_split';
> @ips_sorted = sort { pack_split($a) cmp pack_split($b) } @ips;
The `Orcish Maneuver' is usually better than memoization for sort
comparators. here's why: Suppose your list @ips has 1,000 elements.
`sort' will want to do about 8,700 comparisons. It will make about
15,000 calls to `pack_split'.
With no memoization, you get 15,000 calls to pack_split, 15,000
splits, and 15,000 packs.
With `Memoize', you only have 1,000 splits and 1,000 packs, but you
still have 15,000 calls to `pack_split', although 14,000 of them
return immediately.
If you use the Orcish Maneuver, like this:
@ips_sorted = sort compare_ips @ips;
{ my %cache;
sub compare_ips {
($cache{$a} ||= pack_split($a))
cmp
($cache{$b} ||= pack_split($b))
}
}
Then you have only 1,000 calls to pack_split.
The big benefit of `Memoize' is that you can have it store the results
of `pack_split' on disk, and then the next time you run your program
it will run even faster:
------------------------------
Date: Wed, 30 Sep 1998 16:05:58 -0500
From: Sam Woolsey <swwoolse@sprintparanet.com>
Subject: PERL and Win32 TIME
Message-Id: <36129D36.9BC98D65@sprintparanet.com>
How do convert a time/date stamp in a unix PERl file to an NT Perl file?
I need to include the date and time but it is not working on an NT box.
thanks
sam
------------------------------
Date: Wed, 30 Sep 1998 17:08:46 -0400
From: Michael Hicks <mhicks@nowis.com>
Subject: Perl Security Feature?
Message-Id: <36129DDE.C4700924@nowis.com>
Hello All:
I have a cgi script which takes form input, passes it to an executable on the
system to be encrypted, and then returns the encrypted string to the browser.
This works fine on many systems, but it does not work on my new Red Hat Linux
system. Instead of returning the encrypted string to the browser, I get nothing!
Is this a new security issue? A portion of the script is below:
require "cgi-lib.pl";
&ReadParse(*input);
open(HANDLE,"-|") || exec "MyEncryptionAPP", "Parameter1", $input{'Parameter2'},
$input{'Parameter3'};
$this = <HANDLE>;
close HANDLE;
Later, when I try to return $this to the browser, it is empty! But only using
Perl on my new Red Hat system.
Any suggestions? Is this a security feature? How do I get around it? The version
of Perl on my new system (where the script fails) is 5.004_01 The system on
which it works is using version 4.0
Thanks,
-Michael Hicks
mhicks@nowis.com
------------------------------
Date: 30 Sep 1998 15:08:17 -0700
From: Kin Cho <kin@omni.c-cube.com>
Subject: soft reference to object?
Message-Id: <cohbtnx9ru6.fsf@omni.c-cube.com>
What's the
If I have a class BAR, what's syntax to soft reference BAR->new?
I tried:
$a = ${'BAR->new'};
which doesn't work.
Any ideas?
-kin
package FOO;
sub new {
my $type = shift;
my $self = {};
bless $self, $type;
}
package BAR;
@ISA = qw(FOO);
------------------------------
Date: Wed, 30 Sep 1998 20:40:19 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: SRC: encrypt your Perl scripts! :-)
Message-Id: <361294C1.B87554E5@bbnplanet.com>
Greg Bacon wrote:
> Tom is tall enough to ride this roller coaster. By your participation
> in this thread, you and Elaine have shown that you aren't. :-)
*cough* Ummm, I think I am taller than Tom if I remember correctly. Who
'ya callin' short jerky-boy? ;)
e.
"All of us, all of us, all of us trying to save our immortal souls, some
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon." R. Carver
------------------------------
Date: Thu, 01 Oct 1998 08:51:00 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: system function question
Message-Id: <3612B5D4.3E9FBE78@spider.herston.uq.edu.au>
Martien Verbruggen wrote:
>
<snip>
> while(defined($line = <LSVG_file>))
> {
> chomp;
# Should be...
chomp $line;
> last if $line eq "";
> my $rc = system("lsvg $line > dummy.out");
> # check the return code, blablabla
> }
>
--
Jaime Metcher
------------------------------
Date: Wed, 30 Sep 1998 16:43:58 -0500
From: brent verner <damonbrent@earthlink.net>
Subject: Re: Uploading file to browser
Message-Id: <3612A61E.8541263E@earthlink.net>
Steve & Debby Caldwell wrote:
>
> Help!!! I'm a Perl newbie and I have been working on this problem for a
> week without much success. I have several files I want to be able to
> upload to web users. They are set up as Adobe Acrobat files (PDF) and
> the only way I have been able find to let people download them if by
> using--print "Location: ..." Trouble is, if the user has the Acrobat
> plug-in, Reader kicks in without really saving the file. There has to
> be a way to get the file to the user either as a binary file, or without
> triggering the plug-in.
> I have been through every FAQ I can find, and run though all my
> manuals. I even contacted Netscape and Microsoft (boy, was that a waste
> of time). Rumor is, all the knowledge of the universe resides here in
> this newsgroup. I hope you can help.
> Keep the explanations simple; I'm not that bright.
> Debby
without editing each users file-type handling (this is what makes the
PDF reader pop-up), you are left with the option of changing the file's
extension -- consider using WinZip to pack them prior to uploading
them...most people have WinZip which is necessary to unpack them.
alternately, you could simply rename the *.pdf to *.pdf_X then instruct
users to remove the '_X' from the file before viewing...use your
imagination. maybe just instruct users to 'RightClick' and choose 'Save
File...' option. again, use your imagination...
hth.
brent
------------------------------
Date: Wed, 30 Sep 1998 22:56:24 +0100
From: "Stewart Taylor" <stewart.taylor@skt.co.uk>
Subject: Web crawler?
Message-Id: <6uu9e5$9ke$1@plug.news.pipex.net>
I need to produce a script which will get a document from a particular URL,
read some data from specific lines, and save it to a file, several times
over. Is there a source of scripts for this type of function?
Stewart.Taylor@skt.co.uk
S dot K dot T Ltd
------------------------------
Date: Wed, 30 Sep 1998 16:11:48 -0500
From: Sam Woolsey <swwoolse@sprintparanet.com>
To: Fred Leefarr <f.leefarr@zetnet.co.uk>
Subject: Re: Win32
Message-Id: <36129E93.297DB948@sprintparanet.com>
It depends upon which versions of everthing you are using (IIS, PWS, And
which Perl for win32 build)
but, I would check in registry and make sure that your .pl is mapped to
perl.exe
H_KEY_LOCAL_MACHINE/SYSTEM/CURRENT_CONTROL_SET/SERVICES/W3SVC/PARAMETERS/SCRIPT_MAP/
If you don't have anything in there for a .pl or .cgi extension, add it
with the path to your perl.exe and %s %s
Fred Leefarr wrote:
>
> Hi all,
>
> A question regarding the use of Perl on both Windows95 and NT4.0
> Workstations..
>
> I've installed Perl on both machines, and have tested a simple "print"
> program from the command prompt on both. However, when I try to active the
> "print" program from an HTML document, I get some strange results;
>
> On Win95, the Perl script contents are simply listed on the screen i.e., the
> program didn't execute.
>
> On WinNT, the command prompt flashes up quickly, and then dissappears, with
> no error message.
>
> Both PWS and IIS have been configured to make sure the folders containing
> the Perl scripts are executable. And I've scoured the FAQs for a solution to
> the problem. It's kinda embarrassing to get stuck so early on in my Perl
> career! Perhaps I should stick to gardening!
>
> Regards,
>
> Fred.
--
_ |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| _
/ ) | Sam W. Woolsey PIN 382-1128 | ( \
/ / | | \ \
_( /_ | _ Technical Analyst Cybernauts Houston _ | _) )_
(((\ \> |/ ) Sprint Paranet, Inc. ( \| </ /)))
(\\\\ \_/ / \ \_/ ////)
\ / email: swwoolse@sprintparanet.com \ /
\ _/pager mail: swwoolse@pager.sprintparanet.com \_ /
/ / |______________________________________________| \ \
/ / "When we lose the right to be different, \ \
we lose the privelege to be free."
------------------------------
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 3861
**************************************