[19850] in Perl-Users-Digest
Perl-Users Digest, Issue: 2045 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 1 00:05:31 2001
Date: Wed, 31 Oct 2001 21:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1004591108-v10-i2045@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 31 Oct 2001 Volume: 10 Number: 2045
Today's topics:
DBD::Oracle and pkg_global_type.gTabType <rhanson@blast.net>
Re: displaying headers in perl (Alastair)
Re: Getting one element of array return value (Dimitri)
Re: Getting one element of array return value <michael-a-mayo@att.net>
Re: Getting one element of array return value <joe+usenet@sunstarsys.com>
Help with a tough algorithm (Tommy Butler)
Re: How can I fix this? <rhanson@blast.net>
Re: How to pass scalar to Module <jkumar@atrenta.com>
Re: How to run a perl script as background from remote <pneumatus@NOSPAMhotmail.com>
MAC user question <tom@tealcity.com>
Need advice on getting off a SIGTTIN signal from my scr <avila_edgar@hotmail.com>
Re: Newbie Question (Jason Kawaja)
Re: Newbie Question <jurgenex@hotmail.com>
Re: Newbie Question (Tad McClellan)
Re: Optomizing Speed for Large Files <uri@stemsystems.com>
Re: Perl Image::Magick ignores QUALITY directive. (Glenn Randers-Pehrson)
Re: Perl/CGI Search Script <pneumatus@NOSPAMhotmail.com>
Re: Perl/CGI Search Script <flavell@mail.cern.ch>
Re: Question on regExp and Escape Sequences <Laocoon@eudoramail.com>
Real quick: What is the Server Name? (jkindahouse)
Re: Real quick: What is the Server Name? <tony_curtis32@yahoo.com>
Re: Real quick: What is the Server Name? <bart.lateur@skynet.be>
Re: REGULAR EXP. HELP <Laocoon@eudoramail.com>
Re: REGULAR EXP. HELP <uri@stemsystems.com>
Re: Unsigned 8 bit math (addition and subtraction) <nospam-abuse@ilyaz.org>
Re: Unsigned 8 bit math (addition and subtraction) (J.B. Moreno)
Re: Unsigned 8 bit math (addition and subtraction) <nospam-abuse@ilyaz.org>
Re: Unsigned 8 bit math (addition and subtraction) <bart.lateur@skynet.be>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 31 Oct 2001 22:31:44 -0500
From: "Robert Hanson" <rhanson@blast.net>
Subject: DBD::Oracle and pkg_global_type.gTabType
Message-Id: <Gm3E7.10689$ym4.467084@iad-read.news.verio.net>
[If there is a better place to post this, let me know... I didn't see a
database list from my news server]
I am trying to access return data from a stored procedure on Oracle 8, and
the procedure is returning a PL/SQL table as the out var. Can this be
handled with DBI/DBD::Oracle?
Here is the declaration of the procedure:
procedure messageboard_page (
p_begin IN NUMBER,
p_end IN NUMBER,
p_owner IN VARCHAR2,
p_table IN VARCHAR2,
p_order_by IN VARCHAR2,
p_asc_desc IN VARCHAR2,
p_tabvar OUT pkg_global_type.gTabType ) AS ...
I am familiar with handling cursors and OUT variables from a stored
procedure, but can't seem to get the "pkg_global_type.gTabType" data. The
error I am getting is "PLS-00306: wrong number or types of arguments in call
to 'MESSAGEBOARD_PAGE'".
Can this datatype be read from Perl with DBI/DBD::Oracle? (if not I will
just have the DBA change the PL/SQL, I am just wondering one way or another
if this is possible)
Thanks.
Robert
------------------------------
Date: Thu, 01 Nov 2001 00:24:01 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: displaying headers in perl
Message-Id: <slrn9u15h0.eh1.alastair@calliope.demon.co.uk>
cool dude <control153@yahoo.com> wrote:
> can someone help me. i want to write a cgi script
> that is called by a browser. on the browser will be displayed the header
>
> information for the request (in other words the header info of the
> browser
> since no data is being passed). i have all the lwp modules needed
> installed
Doesn't LWP::Simple suffice for this?
Cheers,
--
AS |
alastair@calliope.demon.co.uk |
http://www.calliope.demon.co.uk | PGP Key : A9DE69F8
-------------------------------------------------------------------
------------------------------
Date: 31 Oct 2001 16:19:26 -0800
From: mauroid@csi.forth.gr (Dimitri)
Subject: Re: Getting one element of array return value
Message-Id: <a3ebf7b8.0110311619.3c23c6d8@posting.google.com>
Michael Carman <mjcarman@home.com> wrote in message news:<3BE024D1.79D19AD3@home.com>...
> Dimitri wrote:
> >
> > Say we have a subroutine that returns an array (a big one). How can
> > I get the n-th element of this array, without having to assign the
> > return value to another array (and effectively copy the whole thing)?
> >
> > This doesn't work :
> >
> > sub sss { (1, 2, 3); }
> >
> > $x = ${&sss()}[1]; ## $x is undef
> >
> > $x = &sss()[1]; ## syntax error
Thanks for all the help! How about using this?
(undef, $x) = &sss();
Obviously impractical if you are looking for element 1000 rather than
element 1 (or even worse for element $x), but if you were indeed just
looking for element 1, would it be better than the proposed alternative,
memory-wise?
-Dimitri
------------------------------
Date: Thu, 01 Nov 2001 02:34:30 GMT
From: "Michael A Mayo" <michael-a-mayo@att.net>
Subject: Re: Getting one element of array return value
Message-Id: <Ww2E7.151280$3d2.5277156@bgtnsc06-news.ops.worldnet.att.net>
"Joe Schaefer" <joe+usenet@sunstarsys.com> wrote in message
> % perl -wle '@a=0..9; sub f:lvalue{@a} $#{\f}=3; print @a'
> 0123
Can you explain this? I don't understand what's going on here.
-Mike
------------------------------
Date: 31 Oct 2001 23:03:59 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Getting one element of array return value
Message-Id: <m3ady7m91s.fsf@mumonkan.sunstarsys.com>
"Michael A Mayo" <michael-a-mayo@att.net> writes:
> "Joe Schaefer" <joe+usenet@sunstarsys.com> wrote in message
> > % perl -wle '@a=0..9; sub f:lvalue{@a} $#{\f}=3; print @a'
> > 0123
>
> Can you explain this? I don't understand what's going on here.
f is an lvalued sub- see the section on "Lvalue subroutines" in
perlsub. It's a new, "experimental" feature in perl 5.6.
The basic idea is that the subroutine's return value is assignable.
For
sub f : lvalue { @a }
the return value of f() *is* the actual _array_ @a. In a scalar
context, f returns the number of elements in @a (just as it would
sans the :lvalue keyword). But in a list context, f() returns the
actual array @a, and *not* simply a list of the scalar values within
@a (that's what would normally happen without the :lvalue keyword).
Since the reference operator "\" always puts its "operand" in a list
context,
\f()
makes a reference to @a. But when applied to a list, "\" distributes
across the elements of the list, creating instead a list of references.
Witness the difference:
% perl -wle '@a = 0..9; sub f {@a} print \f'
SCALAR(0x8127164)SCALAR(0x812726c)SCALAR(0x812729c)SCALAR(0x81394bc)
SCALAR(0x81394c8)SCALAR(0x81394d4)SCALAR(0x81394e0)SCALAR(0x81394ec)
SCALAR(0x81394f8)SCALAR(0x8139504)
% perl -wle '@a = 0..9; sub f:lvalue{@a} print \f, \@a'
ARRAY(0x8139480)ARRAY(0x8139480)
So $#{ \f() } is the same as $#a, IOW the last index of @a, and
$#{\f} = 3; # same as $#a = 3;
truncates @a from 0..9 to 0..3, which is what ultimately gets printed.
You could also achieve the same thing by reassigning f():
% perl -wle '@a=0..9; sub f:lvalue{@a} (f)=0..3; print @a'
0123
^ ^
The trick here is to put magic parens around f to force the sub into
a list context.
Now a word of caution- as advertised, this is an experimental feature,
and some of the glitches are still being worked out. So don't be
surprised if you see perl do bizarre things if you make widespread
use of it-
% perl -wle '@a = 0..9; sub f:lvalue{return @a} print \f'
Bizarre copy of ARRAY in return at -e line 1.
In this case, it looks like using an explicit return() causes perl
some confusion.
HTH
--
sub TIESCALAR {bless \$_[1]} sub STORE {${$_[0]}=$_[1]}$,=" ";$\=$/;$#Just=1;
tie $left,'main',-4; sub FETCH{${$_[0]}<0?${$_[0]}:$#[${$_[0]}++%4]}$Just[0]=
sub{$left,"\l$#[-++$_[0]]",$left&&$left.","}; @#=qw/Just Another Perl hacker/
;print ++$left, @{++$left} [$left++] -> ($left++) # some words on play
------------------------------
Date: 31 Oct 2001 20:12:13 -0800
From: comp.lang.perl.misc@atrixnet.com (Tommy Butler)
Subject: Help with a tough algorithm
Message-Id: <22bcd918.0110312012.15416541@posting.google.com>
Can somebody help me out with an algo?
I'm trying to get a six-character string *in stepped sequence* from the array of
possible unique six-character strings for the character class of [a-zA-Z0-9_].
I need to make sure that I don't skip over any possibilities in the array of
possibilities, so I think that once the stepped sequence of the algo has reached
the last possible index before @#possibilities (<-- Perl syntax meaning the last
array element in my list of possible strings) it needs to recognize that the
next element to be retrieved from the array is the value of its incremented step
plus one. (Maybe the shift isn't necessary if the array length is a uneven
number?)
Obviously this means that the algo must keep track of its its current position
in the array, and make sure not to use any previously retrieved elements by
noting its current index, the length of the array, and the value of its
incremented step. At this point that shift over the array elements of (step+1)
must occur.
I can't just start popping or splicing elements out of the array to do this with
a simple process of elimination (unless I keep track of the indices of all the
elements that got spliced out of the array, I guess). Keep in mind that this
retrieval of unique 6-char strings must occur between non-persistent
cgi-sessions in order to assign website visitors one of these unique numbers as
a product serial number.
The way I've been planning to track the current position of the algorithm in the
array between sessions is to use a simple flat-file database containing only the
integer representative of the array index where the algo left off after the
previous cgi-session ended.
Any ideas? I thought it would be a fun brain buster to toss out for
everyone :o)
- Tommy Butler,
Internet Strategies, Inc. º ° º Everything is Possible.
web http://istrat.com
email mailto:tommy@istrat.com
tel 2 1 4 . 3 9 3 . 1 0 0 0 ext207
fax 8 0 0 . 3 0 7 . 8 1 0 5
2200 North Lamar, Suite 307 º ° º Dallas, TX 75202
------------------------------
Date: Wed, 31 Oct 2001 22:52:13 -0500
From: "Robert Hanson" <rhanson@blast.net>
Subject: Re: How can I fix this?
Message-Id: <_F3E7.10690$ym4.467298@iad-read.news.verio.net>
> http://www.domain.com/cgi-
> bin/frames.cgi?id=12798&url=http://www.server.com/index.asp?page=183
>
> I get only 'http://www.server.com/index.asp?page', but not '=183',
> through the frames.cgi script, that contains the code below:
The short answer is DON'T DO THAT! The URL should be URL encoded like
this...
http://www.domain.com/cgi-bin/frames.cgi?id=12798&url=http://www.server.com/
index.asp%3Fpage%3D183
You should never include special symbols or spaces in the variable name or
value. You can use URI::Escape to escape the values in whatever script is
generating the URL (or use the escape() JavaScript function if that is the
only option).
You can also just modify your code to accept that specific format (which is
probably a bad choice in the long run).
[untested]
my $q = $ENV{QUERY_STRING};
$q =~ /?id=(\d+)&url=(.*)/;
$id = $1;
$url = $2;
------------------------------
Date: Wed, 31 Oct 2001 16:26:16 -0800
From: Jayakumar Mundunuri <jkumar@atrenta.com>
Subject: Re: How to pass scalar to Module
Message-Id: <3BE096A8.52C8D90C@atrenta.com>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Thank you very much.
<p>It works..
<br>
<p>"Steffen Müller" wrote:
<blockquote TYPE=CITE>"Jayakumar Mundunuri" <jkumar@atrenta.com> schrieb
im Newsbeitrag
<br><a href="news:3BE042CF.EE83531B@atrenta.com">news:3BE042CF.EE83531B@atrenta.com</a>...
<br>| Hi Friends!
<br>| Can you guys suggest me how can I pass a variable from a perl file
to its
<br>using module/package?
<br>| Here is an example code for my problem :
<p>[snip]
<p>You could always:
<p>#untested
<br>#!/bin/perl
<br>use strict;
<br>use warnings;
<p>my $var = "This should work fine";
<br>use my_module;
<br>my_module::init($var);
<p>...
<p>my_module::do_something();
<p>----
<br>package my_module;
<p>my $var;
<p>sub init() {
<br> $var = shift;
<br>}
<p>sub do_something {
<br> print $var;
<br>}</blockquote>
</html>
------------------------------
Date: Wed, 31 Oct 2001 23:25:52 -0000
From: "Matt" <pneumatus@NOSPAMhotmail.com>
Subject: Re: How to run a perl script as background from remote host ?
Message-Id: <9rq1bq$7$1@neptunium.btinternet.com>
have a go at
nohup perl FILENAME &
Matt...
"j0eblack" <j0eblack@ihug.com.au> wrote in message
news:9rp0jl$a30$1@bugstomper.ihug.com.au...
> Hi
>
> I remotely connect to a server ** a paid hosting server ** , here's the
> problem
> I wanted to allow a script to runs in background ** the task of the
script
> is to constantly monitor certain directories and delete the appropriate
> file ** .
> the problem is as soon as my telnet connection to the hosting server
> terminated, the script stop running.
> Is there any way I can let it keep running ? ** after the disconnection of
> coz **
> ** probably this is not a so PERL question , but if u have a clue ,
greatly
> appreciate it :) **
>
> thank you
>
>
>
>
>
------------------------------
Date: Wed, 31 Oct 2001 21:16:29 -0500
From: Tom <tom@tealcity.com>
Subject: MAC user question
Message-Id: <3BE0B07C.2012@tealcity.com>
Hi all,
I'm new at this, looked for the faq,s but could find them.
So here's the question. I know it a simple one -- sorry.
Trying to run a script (os 9) set up as a server
and I get a msg. "can't find CGI.pm in @inc. Any helpful
hints appreacted.
Thanks so much
Tom
------------------------------
Date: Wed, 31 Oct 2001 19:07:42 -0600
From: "Edgar Avila" <avila_edgar@hotmail.com>
Subject: Need advice on getting off a SIGTTIN signal from my script.
Message-Id: <Pg1E7.16$hy.12866@nn1-lan0.avantel.net.mx>
Hi,
I'm trying to do this..
Need to send an alarm to a remote system thru rsh. If circuit=up -->Sev=1;
else Sev4.
I use diff to do so. If the new file has differences-->circuits down. If
the old one has--> circuits up.
I log the notifications using the original sintaxis for alarms.
Ok, the remote program (called from rsh) is called 'al'. When I run this
script from another script manually... everything goes fine....
The BIG problem is when I run it on background. It sends a SIGTTIN signal
and the program stops.
My host is running Solaris. The remote runs HP-UX.
This script runs ok from another HP-UX.
Any advice is welcomed... except to change OS cause I can't.
This is my script:
#!/usr/local/bin/perl
$path="/export/home/sse";
$new=$path.'/nnew';
$old=$path.'/nold';
$fecha=`date`; chomp $fecha;
$elemento_previo="";
@diff=`diff $new $old`;
open(LOG,">>$path/Events.log");
foreach $row (@diff){
my ($signo,$elemento,$alarma,$alarmao);
if($row=~/^(<|>) (\S+)\t(\S+.+)$/){
$signo=$1; $elemento=$2; $alarma=$3;
# Need to escape some special characters.
$alarmao=$alarma;
$alarmao=~s/\&/\\\&/g;
$alarmao=~s/\(/\\\(/g;
$alarmao=~s/\)/\\\)/g;
$alarmao=~s/\"/\\\"/g;
$alarmao=~s/\#/\\\#/g;
chomp $elemento;
if($elemento ne $elemento_previo){
if($signo eq "<"){ $sev=4 }else{ $sev=1 }
print LOG "$fecha: Sev:$sev: Elemento:$elemento:
Texto:\\\"$alarma\\\"\n";
system "rsh -l padsa host01xx /opt/admin1/al $sev
$elemento \\\"$alarmao\\\"";
$elemento_previo=$elemento;
}
}
}
close LOG;
system "mv $new $old";
Thanks,
Edgar.
------------------------------
Date: Wed, 31 Oct 2001 19:03:06 +0000 (UTC)
From: kawaja@ece.ufl.edu (Jason Kawaja)
Subject: Re: Newbie Question
Message-Id: <slrn9u0inv.o3v.kawaja@kawaja.ece.ufl.edu>
previously, Peter Morris <no_spam.ple@se.com> wrote:
> Hello, I'm just learning PERL. I don't really understand
> what these $_ and @_ variables are all about. Can someone
> explain, please.
$_ is the variable $ARG
holds the scalar that gets passed to a subroutine
@_ is the variable @ARG
holds the array of scalar args passed to a subroutine
$_ is assumed on many of perl's builtin functions requiring or depending
on passed args
print STDOUT;
print STDOUT $_;
are the same.
--
/* Regards,
Jason Kawaja, UF-ECE Sys Admin */
------------------------------
Date: Wed, 31 Oct 2001 16:25:07 -0800
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Newbie Question
Message-Id: <3be09663$1@news.microsoft.com>
"Jason Kawaja" <kawaja@ece.ufl.edu> wrote in message
news:slrn9u0inv.o3v.kawaja@kawaja.ece.ufl.edu...
> previously, Peter Morris <no_spam.ple@se.com> wrote:
> > Hello, I'm just learning PERL. I don't really understand
> > what these $_ and @_ variables are all about. Can someone
> > explain, please.
>
> $_ is the variable $ARG
> holds the scalar that gets passed to a subroutine
>
> @_ is the variable @ARG
This is just plain wrong.
$_ is $_ and not $ARG and it has nothing to do with subroutine arguments;
@_ is @_ and has nothing to do with @ARG (which doesn't even exist unless
you defined it; maybe you meant @ARGV?)
In any case:
$_ is the default variable for many of Perls buildin functions and control
structures. "Default" means that if you don't specify a variable then $_
will be used. Please check the man page for each function/control structure
for information about if and how $_ will be used.
> holds the array of scalar args passed to a subroutine
This part at least is correct.
@_ contains the arguments which are passed to a sub.
jue
------------------------------
Date: Thu, 01 Nov 2001 00:48:50 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Newbie Question
Message-Id: <slrn9u14cq.5eo.tadmc@tadmc26.august.net>
Jürgen Exner <jurgenex@hotmail.com> wrote:
>"Jason Kawaja" <kawaja@ece.ufl.edu> wrote in message
>news:slrn9u0inv.o3v.kawaja@kawaja.ece.ufl.edu...
>> previously, Peter Morris <no_spam.ple@se.com> wrote:
>> > Hello, I'm just learning PERL. I don't really understand
>> > what these $_ and @_ variables are all about. Can someone
>> > explain, please.
>>
>> $_ is the variable $ARG
>> holds the scalar that gets passed to a subroutine
>>
>> @_ is the variable @ARG
>
>This is just plain wrong.
>$_ is $_ and not $ARG
$_ _is_ $ARG if you
use English;
though.
>and it has nothing to do with subroutine arguments;
Unless "subroutine" here means "built-in function", as many
of _those_ "subroutines" will use $_ as an argument, as you
describe below.
>@_ is @_ and has nothing to do with @ARG (which doesn't even exist unless
>you defined it; maybe you meant @ARGV?)
Yeah, that part just made no sense at all.
>In any case:
>$_ is the default variable for many of Perls buildin functions and control
>structures. "Default" means that if you don't specify a variable then $_
>will be used. Please check the man page for each function/control structure
>for information about if and how $_ will be used.
>
>> holds the array of scalar args passed to a subroutine
>This part at least is correct.
>@_ contains the arguments which are passed to a sub.
To the OP:
It may help to think of them as just regular old scalars and
arrays. $_ is pretty much the same as $x except it has
a funny looking name. Anything you could do with $x you
can do with $_.
perldoc perlvar
describes all of Perl's built-in variables.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 31 Oct 2001 23:23:51 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Optomizing Speed for Large Files
Message-Id: <x71yjjxuix.fsf@home.sysarch.com>
>>>>> "DR" == Doyle Rivers <dwrivers@micron.com> writes:
DR> sub report
DR> {
DR> print "sub report: @_\n" if $debug;
DR> my ($reportfile) = $path."report.tmp";
no need for () when assigning a scalar in a my line.
DR> my ( $field,
DR> $tree,
DR> $data,
DR> $delta,
DR> $rp,
DR> @delta);
DR> &print_header;
DR> foreach $field (keys %data)
DR> {
DR> foreach $tree ( sort numerically keys %{ $data{$field} })
DR> {
first trick, when you scan a HoH tree, get a reference to each level as
you go down. then you don't need to do those long hash lookups over and
over in the tight loops. that is slow.
my $field_ref = $data{ $tree } ;
DR> my ($begin) = 0;
DR> @branch = ();
DR> foreach $rp (@rp)
DR> {
DR> if ($begin == 0)
DR> {
DR> $begin = 1;
DR> print OUT $field;
DR> print OUT $seperator,$tree;
DR> }
that flag test is slow as it will execute every loop. where does the @rp
list come from? you could write 2 loops to factor out that code. or you
could build up the reports as strings first and then print them out all
at one time. just try to remove the invariant code from the loop.
DR> if (defined($data{$field}{$tree}{$branch}))
if ( exists( $field_ref->{$branch} ) ) {
BTW, i don't see $branch assigned anywhere. i know this is not real code
but it helps if you post working code.
DR> {
DR> push @leaves, $data{$field}{$tree}{$branch};
DR> print OUT sprintf "%0.1f", $data{$field}{$tree}{$branch};
same as above. skip the invariant levels of the hash by using a ref to
this level.
DR> }
DR> else
DR> {
DR> push @leaves, "UD";
DR> }
style point:
when the last code of a loop is if/else, have the if code do a next and
then you can lose the else{} and save indents and {} which are in short
supply. it also makes the code less cluttered and easier to read IMNSHO.
DR> }
DR> @delta = &calc_delta(@branch) if ($#branch > 0);
as before, you never populate @branch so that is meaningless.
the main point is to factor out invariant stuff from lower level
loops. useless multiple hash lookups can be a big time pig.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs -------------------------- http://jobs.perl.org
------------------------------
Date: 31 Oct 2001 19:40:20 -0800
From: randeg@alum.rpi.edu (Glenn Randers-Pehrson)
Subject: Re: Perl Image::Magick ignores QUALITY directive.
Message-Id: <4b254661.0110311940.6984e40a@posting.google.com>
"Brian P. Barnes" <BrianP@Die_Spammers_Fractasia.com> wrote in message news:<3BD4D905.31FD12DA@Die_Spammers_Fractasia.com>...
>
> I have tried setting the quality before the compression type. I have
> tried setting them both together. No luck. The quality level is ignored
> in every case.
>
> Am I doing something wrong? Any ideas greatly appreciated,
You might happen to have ImageMagick version 5.2.6 which has a bug
that makes it ignore quality.
Glenn
------------------------------
Date: Wed, 31 Oct 2001 23:22:38 -0000
From: "Matt" <pneumatus@NOSPAMhotmail.com>
Subject: Re: Perl/CGI Search Script
Message-Id: <9rq15c$t19$1@neptunium.btinternet.com>
hi,
that's the script that I have tried to modify most to perform what i want,
but it replaces &'s with &
i managed to cure that for the page it generates so it comes up as a link,
but in the data file it produces, it still some up with & and all the
keywords etc are the same as the initial cgi?whatever, not
cgi?whatever&anotherwhatever .... if yoy know what i mean
any ideas how to get around this problem?
Matt
"Gregory Toomey" <nobody@nowhere.com> wrote in message
news:QJRD7.404$lh4.4678@newsfeeds.bigpond.com...
> "Matt" <pneumatus@NOSPAMhotmail.com> wrote in message
> news:9rnblg$458$1@plutonium.btinternet.com...
> > Hi,
> >
> > I'm looking for a free search script written in perl/cgi. The thing is,
I
> > want one that can handle ? and &'s in urls as the site i need it for is
> > totally CGI driven.
> >
> > I hope someone can point me in the right direction.
> >
> > Pneumatus®
> >
>
> This is the one I use. Crawling can be run from the web or from a *nix
> script.
> http://www.xav.com/scripts/search/
>
> gtoomey
>
>
------------------------------
Date: Thu, 1 Nov 2001 01:05:16 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Perl/CGI Search Script
Message-Id: <Pine.LNX.4.30.0111010056070.22881-100000@lxplus023.cern.ch>
On Oct 31, Matt stood usenet on its head and blurted out:
> that's the script that I have tried to modify most to perform what i want,
Is it, indeed? Looks like an application for killfile membership for
TOFU, but I'm reserving judgment for a short time...
> but it replaces &'s with &
Sounds like it might know something that you don't yet.
> i managed to cure that for the page it generates so it comes up as a link,
> but in the data file it produces, it still some up with & and all the
> keywords etc are the same as the initial cgi?whatever, not
> cgi?whatever&anotherwhatever .... if yoy know what i mean
Erm, do you have a URL and such?
> any ideas how to get around this problem?
Yes. Learn what you're doing. Ask questions in the accepted format,
and with proper supporting evidence - URLs and so on.
We're doing pretty good - you appear to be in a mess. I think I know
what I'd try in that situation. Most newcomers try bawling us out,
instead of trying to work with us; but you could well prove to be the
exception. Your move...?
------------------------------
Date: Thu, 1 Nov 2001 04:25:37 +0100
From: Laocoon <Laocoon@eudoramail.com>
Subject: Re: Question on regExp and Escape Sequences
Message-Id: <Xns914C2D0C69E52Laocooneudoramailcom@62.153.159.134>
>
> But \Q does not "disable quoting" whatever that might mean.
>
Yes sorry it "disables metacharachters".
------------------------------
Date: 31 Oct 2001 23:52:24 GMT
From: jkindahouse@aol.com (jkindahouse)
Subject: Real quick: What is the Server Name?
Message-Id: <20011031185224.14892.00000557@mb-ff.aol.com>
I am training to configure Outlook to display the newsgroup and I need the
Server Name. I've tried comp.lang.perl.misc and nmtp.comp.lang.perl.misc.
Thanks.
------------------------------
Date: Wed, 31 Oct 2001 17:54:48 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Real quick: What is the Server Name?
Message-Id: <87k7xbxt4n.fsf@limey.hpcc.uh.edu>
>> On 31 Oct 2001 23:52:24 GMT,
>> jkindahouse@aol.com (jkindahouse) said:
> I am training to configure Outlook to display the
> newsgroup and I need the Server Name. I've tried
> comp.lang.perl.misc and nmtp.comp.lang.perl.misc.
Huh? "Server name"? What server?
Try a newsgroup about Outlook.
--
Oh! I've said too much. Smithers, use the amnesia ray.
------------------------------
Date: Thu, 01 Nov 2001 00:58:39 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Real quick: What is the Server Name?
Message-Id: <og71utokbcrqlkec0lvu19mg44oc6d6a1l@4ax.com>
jkindahouse wrote:
>I am training to configure Outlook to display the newsgroup and I need the
>Server Name. I've tried comp.lang.perl.misc and nmtp.comp.lang.perl.misc.
The news server of your ISP. Try something like "news.aol.com".
--
Bart.
------------------------------
Date: Thu, 1 Nov 2001 04:28:44 +0100
From: Laocoon <Laocoon@eudoramail.com>
Subject: Re: REGULAR EXP. HELP
Message-Id: <Xns914C2D9347338Laocooneudoramailcom@62.153.159.134>
*snip*
> file.doc
> file2.doc
> file3.doc
>
> Input data:
>
> /windows/program/file.doc
> /windows/program/file2.doc
> /windows/tom/file/data/file3.doc
*snip*
s#.+/##g
Lao
------------------------------
Date: Thu, 01 Nov 2001 04:04:26 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: REGULAR EXP. HELP
Message-Id: <x7r8rjw2ys.fsf@home.sysarch.com>
>>>>> "L" == Laocoon <Laocoon@eudoramail.com> writes:
L> *snip*
>> file.doc
>> file2.doc
>> file3.doc
>>
>> Input data:
>>
>> /windows/program/file.doc
>> /windows/program/file2.doc
>> /windows/tom/file/data/file3.doc
L> s#.+/##g
why the /g? it is not needed.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs -------------------------- http://jobs.perl.org
------------------------------
Date: Thu, 1 Nov 2001 00:30:07 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Unsigned 8 bit math (addition and subtraction)
Message-Id: <9rq52f$t23$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Stuart Gall
<stuart@otenet.gr>], who wrote in article <9rpr5h$4r5$2@usenet.otenet.gr>:
> > $a = (($x-$y) % 256);
> >
> > and
> >
> > $a = (($x+$y) % 256);
> >
> > does and works just fine.
> Yes they do! but they should not!!!!!!
perldoc perlnumber
> ((0-1) % 256) ahould equal -1
?!!! No it should not.
> perlop says
> Binary ``%'' computes the modulus of two numbers. Given integer operands $a
> and $b: If $b is positive, then $a % $b is $a minus the largest multiple of
> $b that is not greater than $a.
This does not imply what you said.
Ilya
------------------------------
Date: Wed, 31 Oct 2001 19:30:39 -0500
From: planb@newsreaders.com (J.B. Moreno)
Subject: Re: Unsigned 8 bit math (addition and subtraction)
Message-Id: <1f25o12.15jl19bvuyigoN%planb@newsreaders.com>
Stuart Gall <stuart@otenet.gr> wrote:
> "J.B. Moreno" <planb@newsreaders.com> wrote in message
> > Stuart Gall <stuart@otenet.gr> wrote:
-snip how to do unsigned byte addition/subtraction-
-snip answer that's missing "("-
> > $a = (($x-$y) % 256);
-snip-
> > $a = (($x+$y) % 256);
> >
> > does and works just fine.
> >
> Yes they do! but they should not!!!!!!
> ((0-1) % 256) ahould equal -1
>
> perlop says
> Binary ``%'' computes the modulus of two numbers. Given integer operands $a
> and $b: If $b is positive, then $a % $b is $a minus the largest multiple of
> $b that is not greater than $a.
>
> Hmmm. I guess what perl does is more likely to be usefull to a programmer,
> like most of what perl does. But it does not follow the mathematical
> definition of modulus
The documentation is incomplete -- it doesn't say what happens if $a is
minus (or at least my and your copy of it).
> My extra +256 mod 256 was to compensate for the expected (-1 % 256) = -1 but
> it don't so you just need to apply % one time
Apparently what is happening is that the "largest multiple of $b that is
not greater than $a" can be negative.
I.e ((0-1) % 256) == (-1 - (256*-1))
(Which, on a different note, means that I could have done my subtraction
as $answer = $a-$b - (- int !($a >= $b)*256); ).
The documentation should read something like "largest multiple (can be
negative) of $b".
--
JBM
"Your depression will be added to my own" -- Marvin of Borg
------------------------------
Date: Thu, 1 Nov 2001 00:34:11 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Unsigned 8 bit math (addition and subtraction)
Message-Id: <9rq5a3$tbg$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
J.B. Moreno
<planb@newsreaders.com>], who wrote in article <1f25o12.15jl19bvuyigoN%planb@newsreaders.com>:
> The documentation should read something like "largest multiple (can be
> negative) of $b".
This should be wrong (if you follow the spirit of perldoc perlnumber
-1 % 5 should be the same as 0xFFFFFFFF % 5). And it is wrong since %
take floating point numbers too (should have remembered this, it was
me who added this)!
Sigh,
Ilya
------------------------------
Date: Thu, 01 Nov 2001 01:01:32 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Unsigned 8 bit math (addition and subtraction)
Message-Id: <mm71utgj6d6st8afafgqmu82c8htb40hj1@4ax.com>
Stuart Gall wrote:
>((0-1) % 256) ahould equal -1
I think that commonly, the modulus will get the sign of the divisor.
--
Bart.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
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.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.
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 V10 Issue 2045
***************************************