[17024] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4436 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 26 18:10:55 2000

Date: Tue, 26 Sep 2000 15:10:37 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <970006236-v9-i4436@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 26 Sep 2000     Volume: 9 Number: 4436

Today's topics:
    Re: Halloween Fun <bhoran@gate.net>
    Re: Halloween Fun <ren.maddox@tivoli.com>
        help rbfitzpa@my-deja.com
    Re: How can I combine regular expressions? (Craig Berry)
        How to get length of scalar? <no@spam.thanks>
    Re: How to get length of scalar? <ronnie@catlover.com>
    Re: How to get length of scalar? <jeffp@crusoe.net>
    Re: How to get length of scalar? (Andrew Johnson)
    Re: How to get length of scalar? <tim@ipac.caltech.edu>
    Re: How to get length of scalar? <newsposter@cthulhu.demon.nl>
    Re: How to get length of scalar? <mcarruth@talk21.com>
    Re: inserting a binary scalar into a DBI blob <xeno@bigger.aa.net>
        Install Problem with Win98 <idleisidle@usa.net>
        interpreter optimizations (Michael P. Soulier)
    Re: More Newbie Help <anmcguire@ce.mediaone.net>
    Re: Need help on Hash ? <tim@ipac.caltech.edu>
        Perl & SQL Server <berube@odyssee.net>
    Re: Perl & SQL Server <amonotod@netscape.net>
        Perl & WAIS <berube@odyssee.net>
        perl modules and insecure dependency errors <mari@civil.columbia.edu>
    Re: Portability of Perl/Tk programs? <latsharj@my-deja.com>
    Re: Portable equivalent of `cat`? <ren.maddox@tivoli.com>
    Re: Portable equivalent of `cat`? (Craig Berry)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 26 Sep 2000 14:31:20 -0400
From: Brian Horan <bhoran@gate.net>
To: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Halloween Fun
Message-Id: <Pine.A41.4.21.0009261430350.62340-100000@dakota.gate.net>

> No, that's when Christmas starts.  There's no real money to be made
> from
> Thanksgiving.   

-- unless of course some pre-IPO finds a market for turkey left-overs

   ~             
  'v'   Brian Horan
 // \\  Systems Analyst/Administrator/Programmer 
/(   )\ Miami Herald Publishing Company		 bhoran@herald.com
 ^`~'^   
Linux: For when you're sick of CTRL-ALT-DEL

On Tue, 26 Sep 2000, Larry Rosler wrote:

> In article <slrn8t0j20.lo9.abigail@alexandra.foad.org>, abigail@foad.org 
> says...
> 
> <SNIP all the Perl stuff:->
> 
> > But I'm unfamiliar with the practise of telling spooky stories after
> > Halloween. Isn't the Halloween period from labour day up till Oct 31,
> > and on Nov 1, as soon as the shops open, Thanksgiving starts?
> 
> No, that's when Christmas starts.  There's no real money to be made from 
> Thanksgiving.
> 
> -- 
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
> 



------------------------------

Date: 26 Sep 2000 14:53:02 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Halloween Fun
Message-Id: <m3vgvjq6ap.fsf@dhcp11-177.support.tivoli.com>


I could be wrong, but I think the OP wanted a slightly different
behavior on the 31st and 2nd, before 9am and after 5pm, respectively.
In theory, he should be able to figure that out himself, but I thought
I would preempt the additional question....  Here are the (minor)
modifications:

abigail@foad.org (Abigail) writes:

>     #!/opt/perl/bin/perl -w
> 
>     use Time::Local;
>     use subs qw /    display1     display2     display5
>                  spookystory1 spookystory2 spookystory3/;
> 
      my @MIDNIGHT          = ( 0,  0,  0);        # midnight
>     my @MORNING           = ( 0,  0,  9);        #   9:00
>     my @EVENING           = ( 0,  0, 17);        #  17:00
>     my @HALLOWEEN         = (31,  9);            # Oct 31
>     my @ALLSAINTS         = ( 1, 10);            # Nov  1
>     my @ALL_SOULS         = ( 2, 10);            # Nov  2
      my @DAY_AFTER         = ( 3, 10);            # Nov  3
>     my $YEAR              = (localtime) [5];     # This year.
> 
      my $HALLOWEEN_START   = timelocal (@MIDNIGHT, @HALLOWEEN, $YEAR);
>     my $HALLOWEEN_MORNING = timelocal (@MORNING, @HALLOWEEN, $YEAR);
>     my $HALLOWEEN_EVENING = timelocal (@EVENING, @HALLOWEEN, $YEAR);
>     my $ALLSAINTS_MORNING = timelocal (@MORNING, @ALLSAINTS, $YEAR);
>     my $ALLSAINTS_EVENING = timelocal (@EVENING, @ALLSAINTS, $YEAR);
>     my $ALL_SOULS_MORNING = timelocal (@MORNING, @ALL_SOULS, $YEAR);
>     my $ALL_SOULS_EVENING = timelocal (@EVENING, @ALL_SOULS, $YEAR);
      my $ALL_SOULS_END     = timelocal (@MIDNIGHT, @DAY_AFTER, $YEAR);
> 
>     my     $now = time;
> 
         if ($now < $HALLOWEEN_START)   {    display1}
      elsif ($now < $HALLOWEEN_MORNING) {    display5}
>     elsif ($now < $HALLOWEEN_EVENING) {spookystory1}
>     elsif ($now < $ALLSAINTS_MORNING) {    display5}
>     elsif ($now < $ALLSAINTS_EVENING) {spookystory2}
>     elsif ($now < $ALL_SOULS_MORNING) {    display5}
>     elsif ($now < $ALL_SOULS_EVENING) {spookystory3}
      elsif ($now < $ALL_SOULS_END)     {    display5}
>     else                              {    display2}
> 
>     __END__

-- 
Ren Maddox
ren@tivoli.com


------------------------------

Date: Tue, 26 Sep 2000 16:27:43 GMT
From: rbfitzpa@my-deja.com
Subject: help
Message-Id: <8qqipk$32a$1@nnrp1.deja.com>

I'm trying to run 'mon' on my solaris 2.6 box and I'm getting the
following error:

--------------------------

Warning: Use of "defined" witout parens is ambiguous at
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/_h2ph_pre.ph line2.
(Did you mean $ or @ instead of &?)
syntax error at /usr/local/lib/perl5/site_perl/5.005/sun4-
solaris/_h2ph_pre.ph line 4, near "unless"
BEGIN failed--compilation aborted at ./mon line 41.

---------------------------

I ran 'h2ph /usr/include/*.h /usr/include/sys/*.h and it seems to run
fine. Any ideas of what's going on would be appreciated.

Thanks.


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Tue, 26 Sep 2000 21:35:23 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: How can I combine regular expressions?
Message-Id: <st25krjh1r16a1@corp.supernews.com>

Philip Lees (pjlees@ics.forthcomingevents.gr) wrote:
: Hi. I've written a routine that transliterates Greek text into English
: (used for converting names, addresses, etc.). Sometimes, one Greek
: letter becomes two English letters (e.g. theta -> th or TH).
: 
: When one of these is at the start of a word I need to match the case
: of the second letter in the pair with that of the following character.
: These lines do the trick (for Greek letters chi, theta and psi, in
: case you're interested).
: 
: $line =~ s/\bCH([a-z]|\W)/Ch$1/g;	# adjust case of second letter
: $line =~ s/\bTH([a-z]|\W)/Th$1/g;	# if followed by lower case
: $line =~ s/\bPS([a-z]|\W)/Ps$1/g;	# letter or non-word character
: 
: Is there any way I can combine these into just one glorious, Perlish,
: obfuscated expression?

Sure!  You can also make it marginally better (IMHO) by replacing the
read-then-rewrite of the following character with a lookahead.  Finally,
I'm moving the list of letters you want to do this to out of the regex,
making the whole thing easier to maintain (when you decide to add digamma
GG or whatever. :).  So, here goes:

  my @doubles = qw ( CH TH PS );
  my $dpat    = join '|', @doubles;

  $line =~ s/\b($dpat)(?=[a-z]|\W)/\u\L$1/g;

: By the way, I'm becoming increasingly impressed by the awesome power
: of Perl for these tasks. The above lines of code replace a whole
: string of nested IF blocks within a loop that were needed in the
: language the routine was originally written in.

Once you've coded string manipulations in Perl, you'll feel like you're
swimming in molasses trying to do it in C++, Java, or any of the other big
players.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Quidquid latine dictum sit, altum viditur."
   |


------------------------------

Date: Tue, 26 Sep 2000 12:08:44 -0700
From: Samuel P <no@spam.thanks>
Subject: How to get length of scalar?
Message-Id: <30t1tss6qcdb8jgu0nmq28hj59c3i1t5hb@4ax.com>

Hello

How do I get the length of a string contained in a scalar variable?
For example:

$someNum = 0123456789;

How can I now get the length (in characters) of $someNum?

Thanks in advance

Samuel


------------------------------

Date: Tue, 26 Sep 2000 15:27:39 -0400
From: "Ron Grabowski" <ronnie@catlover.com>
Subject: Re: How to get length of scalar?
Message-Id: <8qqt96$hm6$1@news.cis.ohio-state.edu>

>How do I get the length of a string contained in a scalar variable?

The first thing I would try is 'length($someNum);'





------------------------------

Date: Tue, 26 Sep 2000 15:25:47 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: How to get length of scalar?
Message-Id: <Pine.GSO.4.21.0009261525160.5957-100000@crusoe.crusoe.net>

On Sep 26, Samuel P said:

>How do I get the length of a string contained in a scalar variable?
                  ^^^^^^

There's a very poorly named function for determining the LENGTH of a
string.  Guess its name.

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/



------------------------------

Date: Tue, 26 Sep 2000 19:30:05 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: How to get length of scalar?
Message-Id: <1P6A5.2202$zl4.383110@news1.rdc1.mb.home.com>

In article <30t1tss6qcdb8jgu0nmq28hj59c3i1t5hb@4ax.com>,
 Samuel P <no@spam.thanks> wrote:
> Hello
> 
> How do I get the length of a string contained in a scalar variable?

Included in the Perl documentation set that comes in the standard
perl distribution is document page called 'perlfunc' ... you can read
it by entering:

    perldoc perlfunc

at your prompt. In it, you will find described all of Perl's built-in
functions -- there is even a categorized listing of them early on in
the document. Take a look under the category "functions for scalars
or strings" and you will see the following:

       Functions for SCALARs or strings
           `chomp', `chop', `chr', `crypt', `hex', `index', `lc',
           `lcfirst', `length', `oct', `ord', `pack',
           `q/STRING/', `qq/STRING/', `reverse', `rindex',
           `sprintf', `substr', `tr///', `uc', `ucfirst', `y///'

If any of those appear related to what you are looking for, you can
then either search down the page for the whole entry, or access the
entry from the command prompt using:

    perldoc -f some_function_name

If none of those appear related to your question regarding the
'length of a scalar' then I suggest you give up on programming
altogether.

Please check the documentation that is installed with perl (or visit
perl.com for the documentation online) before posting your enquiries
here. If you would like to know more about the copious documentation
and how to read it, try these:

    perldoc perldoc
    perldoc perl
    perldoc perlfaq

regards,
andrew

-- 
Andrew L. Johnson   http://members.home.net/andrew-johnson/
      you are truly warped.
          -- Uri, referring to me, on comp.lang.perl.misc
      


------------------------------

Date: Tue, 26 Sep 2000 13:45:14 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: How to get length of scalar?
Message-Id: <39D10ADA.75476714@ipac.caltech.edu>

Samuel P wrote:
> How do I get the length of a string contained in a scalar variable?
                   ^^^^^^

Another self answering question. Is anyone keeping stats on these?

--

-- Tim Conrow         tim@ipac.caltech.edu                           |


------------------------------

Date: 26 Sep 2000 20:49:15 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: How to get length of scalar?
Message-Id: <8qr24b$g9t$1@internal-news.uu.net>

In comp.lang.perl.misc Tim Conrow <tim@ipac.caltech.edu> wrote:
> Samuel P wrote:
>> How do I get the length of a string contained in a scalar variable?
>                    ^^^^^^

> Another self answering question. Is anyone keeping stats on these?

You are ;)

Erik



------------------------------

Date: Tue, 26 Sep 2000 22:15:21 +0100
From: "Mark Carruth" <mcarruth@talk21.com>
Subject: Re: How to get length of scalar?
Message-Id: <8qr3ml$67l$1@plutonium.btinternet.com>

This is a multi-part message in MIME format.

------=_NextPart_000_0023_01C02807.430420C0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

$scalarlength =3D length($someNum);

--=20
-----------------------------------------------
Mark Carruth
mcarruth@talk21.com
  "Samuel P" <no@spam.thanks> wrote in message =
news:30t1tss6qcdb8jgu0nmq28hj59c3i1t5hb@4ax.com...
  Hello

  How do I get the length of a string contained in a scalar variable?
  For example:

  $someNum =3D 0123456789;

  How can I now get the length (in characters) of $someNum?

  Thanks in advance

  Samuel

------=_NextPart_000_0023_01C02807.430420C0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4207.2601" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DVerdana size=3D2>$scalarlength =3D =
length($someNum);</FONT></DIV>
<DIV><BR>-- <BR>-----------------------------------------------<BR>Mark=20
Carruth<BR><A =
href=3D"mailto:mcarruth@talk21.com">mcarruth@talk21.com</A></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV>"Samuel P" &lt;<A =
href=3D"mailto:no@spam.thanks">no@spam.thanks</A>&gt;=20
  wrote in message <A=20
  =
href=3D"news:30t1tss6qcdb8jgu0nmq28hj59c3i1t5hb@4ax.com">news:30t1tss6qcd=
b8jgu0nmq28hj59c3i1t5hb@4ax.com</A>...</DIV>Hello<BR><BR>How=20
  do I get the length of a string contained in a scalar variable?<BR>For =

  example:<BR><BR>$someNum =3D 0123456789;<BR><BR>How can I now get the =
length (in=20
  characters) of $someNum?<BR><BR>Thanks in=20
advance<BR><BR>Samuel</BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0023_01C02807.430420C0--



------------------------------

Date: 26 Sep 2000 11:11:28 -0600
From: Xeno Campanoli <xeno@bigger.aa.net>
Subject: Re: inserting a binary scalar into a DBI blob
Message-Id: <39d0e6d0$1_1@huge.aa.net>

I'm mostly beyond the first problem, but I'm getting the following diagnostic on both
the insert and the update:

ORA-04043: object FP_Images does not exist (DBD ERROR: OCIDescribeAny/LOB refetch)

or inside the error_log file:

DBD::Oracle::st execute failed: ORA-04043: object FP_Images does not exist (DBD ERROR: OCIDescribeAny/LOB refetch) at /home/xeno/web/sn40/PerlModules/Tables/BaseItem.pm line 237.

Any feedback is again appreciated.  Sincerely, Xeno

Xeno Campanoli <xeno@bigger.aa.net> wrote:
: I'm stumped this morning as to how to assign a binary Perl
: Perl scalar into an Oracle blob through the DBI interface.
: It complains whether or not I use $dbh->quote, and I cannot
: seem to find any other facility in the Perldoc DBI documentation.
: I'd expect a call like $dbh->binary($binarythingy) I suppose,
: but perhaps that's too easy.  Thanks in advance for any feedback.

: Sincerely, Xeno

: -- 
: Xeno Campanoli (erstwhile Xeno Whitenack, and Rick Burgess)
: Email:	xeno@aa.net	(Web pages:  http://www.aa.net/~xeno)

-- 
Xeno Campanoli (erstwhile Xeno Whitenack, and Rick Burgess)
Email:	xeno@aa.net	(Web pages:  http://www.aa.net/~xeno)


------------------------------

Date: Tue, 26 Sep 2000 14:30:39 -0500
From: "Ben Ben" <idleisidle@usa.net>
Subject: Install Problem with Win98
Message-Id: <hP6A5.2778$rr.47675@vixen.cso.uiuc.edu>

I installed PWS on Win98.
I installed ActivePerl 5.18 on Win98.
I also installed dcom98.exe and dcm95cfg.exe.
And I modified
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC\Parameters\Script
Map\.pl
into c:\perl\bin\perl.exe %s %s
Somehow, it doesn't work. When I try to see test.pl, the brower just say
that "waiting
reply ..." I tryed "perl test.pl" in command line and it works.
I installed perl on Win95 in this way and it works correctly.
What's the problem?
BTW, asp and php work well on my server now.





------------------------------

Date: 26 Sep 2000 21:28:41 GMT
From: msoulier@nortelnetworks.com (Michael P. Soulier)
Subject: interpreter optimizations
Message-Id: <8qr4e9$8pf$2@bmerhc5e.ca.nortel.com>


    So I haven't looked at the sourcecode myself yet, but I'm wondering if
anyone knows already. 
    Does the perl interpreter do copy-on-write? So, if I pass a large array by
value, and don't change it, is the interpreter smart enough to not copy the
entire thing?

    Mike

-- 
Michael P. Soulier, 1Z22, SKY  Tel: 613-765-4699 (ESN: 39-54699)
Optical Networks, Nortel Networks, SDE Pegasus
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort."  -Harley Hahn, A Student's Guide to UNIX
Nortel Linux User's Group Ottawa: (internal) http://nlug.ca.nortel.com:8080


------------------------------

Date: Tue, 26 Sep 2000 13:13:36 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: More Newbie Help
Message-Id: <Pine.LNX.4.21.0009261311510.17425-100000@hawk.ce.mediaone.net>

On 26 Sep 2000, Jonathan Klaff quoth:

JK> I have found a way around my earlier problem, but would also like to know
JK> how I can source a shell script from a perl script.
JK> 
JK> Please excuse my newbiesness.

I posted a potential solution to your problem not too far back...
Go to http://www.dejanews.com, and search on:

andrew mcguire perl source shell

Hopefully you can modify that to fit your needs.

anm
-- 
# Andrew N. McGuire
my $j = [ [ qw+ 4A 75 73 74 20 61 0 +] => [ qw+ 6E 6F 74 68 65 72 0 + ] =>
,,,,,,,,, [ qw+ 20 50 65 72 6C 20 0 +] => [ qw+ 48 61 63 6B 65 72 A + ] ];
;;;;;;;;; print map chr(hex()) => map @$_ => map @$j->[$_-0xA], 0xA .. 0xD



------------------------------

Date: Tue, 26 Sep 2000 12:01:47 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: Need help on Hash ?
Message-Id: <39D0F29B.D93E47FD@ipac.caltech.edu>

Ren Maddox wrote:
> 
> Tim Conrow <tim@ipac.caltech.edu> writes:
> >
> > If the files are of modest size:
> >
> > open(my $fh1,"<file1name") or die "file1: $!";
> > open(my $fh2,"<file2name") or die "file2: $!";
> > my %file1 = split(" ",join("",<$fh1>));
> > my %file2 = split(" ",join("",<$fh2>));
> > print $file1{$file2{Station1}}."\n";
> 
> Which prints:
> 
> 34

OK, OK:

print "$_  $file1{$file2{$_}}\n" for keys %file2;

Geez.

> I would use something like:
> 
> my $file1 = shift;
> my $file2 = shift;
> die "Usage: $0 file1 file2\n" unless defined $file1 and defined $file2;
> 
> open my $fh1, $file1 or die "Could not open $file1: $!\n";
> my %file1 = map split, <$fh1>;

This is a way cooler way to hashize a file than my clunky expression. I'll add
this to my quiver.

> close $fh1;
> 
> open my $fh2, $file2 or die "Could not open $file2: $!\n";
> while ( <$fh2> ) {
>   my @fields = split;
>   print "$fields[0] $file1{$fields[1]}\n";
> }

Unless there's some order dependancy for file2, since both files are hash-like,
why not store them as hashes? I assumed the input about whether one wants
station1 or station2 would be user input, which will be easier to look up in a
hash.

Oh well: TMTOWTDI.

--

-- Tim Conrow         tim@ipac.caltech.edu                           |


------------------------------

Date: Tue, 26 Sep 2000 16:24:28 -0400
From: "Neb" <berube@odyssee.net>
Subject: Perl & SQL Server
Message-Id: <sz7A5.496$hs2.20197@news.globetrotter.net>

Hi,

In the project I'm working on, I must be able to use SQL Server via ODBC to
make my Perl program interact with a database.  Can someone refer me to
documentation about this?

Thanks,

Neb





------------------------------

Date: Tue, 26 Sep 2000 21:06:29 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Perl & SQL Server
Message-Id: <8qr34f$f75$1@nnrp1.deja.com>

In article <sz7A5.496$hs2.20197@news.globetrotter.net>,
  "Neb" <berube@odyssee.net> wrote:
> Hi,
>
> In the project I'm working on, I must be able to use SQL Server via
> ODBC to make my Perl program interact with a database.  Can someone
> refer me to documentation about this?
If you are using Win32 Perl from ActiveState, just read the
documentation inside the PERLROOT\site\lib\Win32\ODBC.pm.  If you are
using *nix, you're S.O.L. unless somebody's gonna buy a third-party
client driver for your platform.

Also, Dave Roth's site has a few good examples of ODBC,
http://www.roth.net/perl/

amonotod

--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Tue, 26 Sep 2000 16:26:50 -0400
From: "Neb" <berube@odyssee.net>
Subject: Perl & WAIS
Message-Id: <GB7A5.497$hs2.19936@news.globetrotter.net>

Hello,

I need to be able to index all my pages of my web site.  I know that WAIS
can do such a thing.  But my site is entirely dynamically generated by a
Perl script.  Each HTML page is generated by the script.  Is it possible to
use WAIS with Perl scripts?

Thanks,

Neb





------------------------------

Date: Tue, 26 Sep 2000 17:03:16 -0400
From: mari <mari@civil.columbia.edu>
Subject: perl modules and insecure dependency errors
Message-Id: <Pine.LNX.4.10.10009261629490.16848-100000@civil.columbia.edu>

Im in the process of migrating mod_perl scripts from on server to
another.. (Debian to Redhat).. and the only changes that have been made
really are upgrading from Apache 1.3.9 to 1.3.12 and upgrading the
Apache::Session module and other modules. I am running with PerlTaintCheck
On, which simulates the -T switch, but so was the other server. I dont kow
how they got around these errors w/o hacking the Apache::Session:File
code.

I've read all of deja's archived messages on the topic and I now
understand why its giving me the insecure dependencies, but w/o changing
the code in the module, how do i fix this? Inst it the module that is
marking the directory as tainted bc it comes fromt he filesystem? Im using
Apache::Session::File using the 'fake' Nulllocker File locking method (to
not lock) and using the FileStore.pm method to store session data on the
filesystem.

My mod_perl script does this

tied(%SESSION_DATA)->delete;  #just like the Apache::Session doc says

the hash is created like this:
tie %SESSION_DATA, 'Apache::Session::File', undef, {Directory =>
 "$othermod::SESSIONDIR"};

where othermod.pm contains variables set... including the directory to
store session data.

the error is this:

[Sun Sep 24 22:43:01 2000] [error]      (in cleanup) Insecure dependency
in unlink while running with -T switch at 
/usr/lib/perl5/site_perl/5.005/Apache/Session/Store/File.pm line 106.

the code it references is this:

sub remove {
    my $self    = shift;
    my $session = shift;
        
    my $directory = $session->{args}->{Directory} || 
$Apache::Session::Store::File::Directory;

    if ($self->{opened}) {
        CORE::close $self->{fh};
        $self->{opened} = 0;
    }

    if (-e $directory.'/'.$session->{data}->{_session_id}) {
        unlink ($directory.'/'.$session->{data}->{_session_id}) || #ln 106
            die "Could not remove file: $!";
    }
    else {
        die "Object does not exist in the data store";
    }
}

the actual delete function is this:

sub delete {
    my $self = shift;
    
    return if ($self->{status} & NEW);
    
    $self->{status} |= DELETED;
    $self->save;
} 

any help is appreciated in understanding this. should i just 'launder'
whats going in the FileStore.pm mod? or can i 'launder' in my script and
have the module not think it's tainted... i'm still also very interested
in knowing how they got around this problem, why the exact same config.
the Dir is not writable by others other than httpd and the only small diff
is that the session IDs are now 32 chars and not 16 chars. 

thanks!
m.



------------------------------

Date: Tue, 26 Sep 2000 17:33:58 GMT
From: Dick Latshaw <latsharj@my-deja.com>
Subject: Re: Portability of Perl/Tk programs?
Message-Id: <8qqmm6$52d$1@nnrp1.deja.com>

In article <qq4A5.11135$hD4.2731831@news1.rdc1.mi.home.com>,
  clintp@geeksalad.org (Clinton A. Pierce) wrote:
> [Posted and mailed]
> [Trimmed newsgroups, again!]
>
> In article <8qnibn$pau@beanix.metronet.com>,
> 	Tye McQueen <tye@metronet.com> writes:
> > clintp@geeksalad.org (Clinton A. Pierce) writes:
> > )
> > ) Bzzzt.  Wrong.  Has been since 5.6.
> >
> > But there is no "reliable fork() in Windows".  It is pretty easy
> > to get the fork() in Perl 5.6.0 to fail rather colorfully.
>
> In what way that hasn't already been addressed on this thread?

If you attempt to run the Interactive Client with IO::Socket and the
TCP Server with IO::Socket examples from the perlipc man page, the
child process in the client hangs when attempting to write to the
socket handle. See open entry 306 at bugs.activestate.com.

--
Regards,
Dick


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: 26 Sep 2000 12:53:54 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Portable equivalent of `cat`?
Message-Id: <m37l7zrqdp.fsf@dhcp11-177.support.tivoli.com>

Tim Richardson <ter@my-deja.com> writes:

>  In a script I want to send the contents of a file to stdout.
> I wonder if there is a portable way of doing this better than slurping
> the file into a variable and printing the variable, portable meaning a
> solution that can be run without system calls to 'cat' and its
> equivalents. File::Copy seems to be one solution. The problem seems so
> trivial, I wonder if I'm missing something.

print while <>;

> This is for a cgi script, and the system function may be prevented
> anyway, if the script is running on a Windows server using isapi which
> therefore bans system calls since perl shares the server process.

For CGI, the above is not quite enough, but it should get you going.

-- 
Ren Maddox
ren@tivoli.com


------------------------------

Date: Tue, 26 Sep 2000 20:41:14 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Portable equivalent of `cat`?
Message-Id: <st22fa84eelnfd@corp.supernews.com>

Tim Richardson (ter@my-deja.com) wrote:
:  In a script I want to send the contents of a file to stdout.
: I wonder if there is a portable way of doing this better than slurping
: the file into a variable and printing the variable, portable meaning a
: solution that can be run without system calls to 'cat' and its
: equivalents. File::Copy seems to be one solution. The problem seems so
: trivial, I wonder if I'm missing something.

Yes, you are.  Open a file handle for reading, then do

  print while <FILE>;

if you want to be careful, or

  print <FILE>;

if you're sure the whole file will fit in memory at once (true for most
files a beginner would be dealing with).

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Quidquid latine dictum sit, altum viditur."
   |


------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4436
**************************************


home help back first fref pref prev next nref lref last post