[19023] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1218 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 29 14:05:57 2001

Date: Fri, 29 Jun 2001 11:05:15 -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: <993837915-v10-i1218@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 29 Jun 2001     Volume: 10 Number: 1218

Today's topics:
        (ActiveState)  PPM not upgrading Tk <mnemotronic@mind\no-spam/spring.com>
    Re: Basic Questions about Locking a DBM (Anno Siegel)
    Re: Basic Questions about Locking a DBM <m.grimshaw@salford.ac.uk>
    Re: CGI modules : Can I run modules on a webserver with <mjcarman@home.com>
        CGI modules : Can I run modules on a webserver without  <torelg@hotmail.com>
    Re: cgi posting to another cgi (Marc Bissonnette)
    Re: cgi posting to another cgi <tony_curtis32@yahoo.com>
    Re: Code Review Needed! (Dave Hoover)
    Re: Code Review Needed! <uri@sysarch.com>
    Re: Code Review Needed! (Craig Berry)
    Re: coding technique - how would you do this? (David Wall)
    Re: Communication error : Reason Bad file descriptor <nospam@notformail.com>
    Re: converting shell "sort" command to perl.. <perler@yahoo.com>
        Coordinates for perl print command like ksh  print "\03 <e.broeren@food-express.nl>
    Re: Coordinates for perl print command like ksh  print  <tony_curtis32@yahoo.com>
    Re: Create unique file in dir? (Tony L. Svanstrom)
    Re: error making Archive::Zip (Gururaj Upadhye)
    Re: error making Archive::Zip <bart.lateur@skynet.be>
    Re: from linux to WinNT4 Ms Sql <Jenda@Krynicky.cz>
    Re: getting a defined value from a html page <rsherman@ce.gatech.edu>
    Re: getting a defined value from a html page <nospam@peng.nl>
    Re: getting a defined value from a html page <nospam@peng.nl>
        how do I return a hash var <jestersi@metacrawler.com>
    Re: how do I return a hash var <r1ckey@home.com>
        ImageMagick installation <nospam@peng.nl>
    Re: is there a way to look ahead/behind in a foreach (@ (Tony L. Svanstrom)
        LDAP inheritance (Karl Seguin)
        limiting cgi input from specific IP's <vrdoljak@uclink.berkeley.edu>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 29 Jun 2001 08:34:31 -0600
From: pt <mnemotronic@mind\no-spam/spring.com>
Subject: (ActiveState)  PPM not upgrading Tk
Message-Id: <3B3C91F7.6FFBE414@mindspring.com>

   Is this cockpit error on my part?  It appears that an attempt to
upgrade the "Tk" module isn't working.  I *think* I've used this same
procedure to upgrade  other packages.

-----  cut here  -----

PPM> version
2.1.5
PPM> query Tk
Tk [800.021] Tk - a Graphical User Interface Toolkit
PPM> verify Tk
An upgrade to package 'Tk' is available.
PPM> verify --upgrade Tk
Upgrade package 'Tk'? (y/N): y
Package 'Tk' is up to date.
PPM>

-----  cut here  -----



Remove the obvious anti-spam to reply.


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

Date: 29 Jun 2001 13:05:00 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Basic Questions about Locking a DBM
Message-Id: <9hhuds$5vc$1@mamenchi.zrz.TU-Berlin.DE>

According to Amittai Aviram <amittai@amittai.com>:
> Thanks to Dave for the kind and helpful explanation!
> Please note followup questions below. -- Amittai Aviram
> 
> "Mark Grimshaw" <m.grimshaw@salford.ac.uk> wrote in message
> news:3B3C4E12.9CED9334@salford.ac.uk...
> >
> >
> > dave wrote:
> > >
> > > open (DBLOCK, "$db_lock") or bail("Cannot open lock file $db_lock
> > > $!");
> > > flock(DBLOCK, LOCK_EX);
> > >
> > > #dbmopen, tie, save the world here, but most likely:
> > > #open something
> > > #write to it
> > > #close it
> > >
> > > close (DBLOCK) or bail("Can't close size file $db_lock $!");
> > > flock(DBLOCK, LOCK_UN);
> >
> > doesn't closing the filehandle DBLOCK implicitly unlock it?
> 
> I have been wondering the very same thing.  To my surprise, none of my basic
> sources -- the "camel book" and _Introduction to Perl_ -- actually says
> whether closing the file unlocks it automatically or not.
 
Well, it does, at least under Unix, and I'd guess anywhere flock()
is supported.  Perl warns (if allowed to) when flock is called on
an closed filehandle.

As with any Perl command that is an interface to a system function,
the Perl documentation assumes that you are familiar with the
underlying function.  At least for some details you will have to
fall back on the system documentation.

Actually it is a beautiful idea to associate locks with a filehandle
on the process side and with a file on the system side.  This way
a lock goes away when the handle goes away, which happens when the
process goes away.  So you'll never have a left-over lock from
a process that has abnormally ended.  Everyone who has tried to
do process exclusion by creating and deleting files knows what I'm
talking about.

[more questions snipped]

Anno


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

Date: Fri, 29 Jun 2001 14:42:20 +0100
From: Mark Grimshaw <m.grimshaw@salford.ac.uk>
Subject: Re: Basic Questions about Locking a DBM
Message-Id: <3B3C85BC.101AFF92@salford.ac.uk>

[snip]
> 
> Actually it is a beautiful idea to associate locks with a filehandle
> on the process side and with a file on the system side.  This way
> a lock goes away when the handle goes away, which happens when the
> process goes away.  So you'll never have a left-over lock from
> a process that has abnormally ended.  Everyone who has tried to
> do process exclusion by creating and deleting files knows what I'm
> talking about.

I know _exactly_ what you're talking about.  I've still got some scripts
around that do exactly that and got into all sorts of complicated
routines to try to guess whether the process that had actually created
the file in the first place had crashed or not leaving the file in place
instead of deleting it and allowing another process to create it and
access the db.  Now I have flock() in my life.


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

Date: Fri, 29 Jun 2001 09:52:51 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: CGI modules : Can I run modules on a webserver without having to  install them?
Message-Id: <3B3C9643.F16B3321@home.com>

toreLG wrote:
> 
> I'd like to use a few non-standard modules on a webserver hosted
> by a commercial company. The modules I'd like to use aren't 
> installed on their webserver.
> 
> Can I use the modules I want without having to installing them
> on the server?

  "In my toolbox, I have some screwdrivers and wrenches. I'd
   like to use a hammer, but I don't have one. Can I use it
   anyway?"

Um, no.

You can't use a module that isn't there. (Why would you expect
otherwise?) What might be possible -- depending on the modules involved
-- is to create your own module library and install the ones you want
there, and then put a 'use lib' in your scripts. See perlfaq8 "How do I
keep my own module/library directory?"

-mjc


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

Date: Fri, 29 Jun 2001 16:17:15 +0200
From: "toreLG" <torelg@hotmail.com>
Subject: CGI modules : Can I run modules on a webserver without having to install them?
Message-Id: <340%6.1163$tD1.143245@news3.oke.nextra.no>

I'd like to use a few non-standard modules on a webserver hosted by a
commercial company. The modules I'd like to use aren't installed on their
webserver.

Can I use the modules I want without having to installing them on the
server?

[ Thanks a lot for any help! torelg@hotmail.com ]





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

Date: Fri, 29 Jun 2001 17:50:45 GMT
From: dragnet@internalysis.com (Marc Bissonnette)
Subject: Re: cgi posting to another cgi
Message-Id: <Xns90CF8D9E31403dragnetinternalysisc@207.35.177.134>

rmhta@hotmail.com (rmhta) wrote in 
news:b3865d91.0106261921.4cc822ff@posting.google.com:

> Howdy.
> 
> I need a cgi to post to another cgi on a different server. What I'm
> trying to accomplish is this:
> 
> A cgi is posted to from a html form;
> This cgi sends an email;
> This cgi "passes" whatever data was posted to it, to another cgi on a
> different server.
> 
> Is there a straight-forward way of accomplishing this?

yes. You'll have to excuse me for (still) using cgi-lib.pl, since I've just 
never gotten around to learning cgi.pm 

This is probably rather crude, but it works, since I just tested it on my 
own server, to be sure :)

#!/usr/local/bin/perl5
use CGI::Carp qw(fatalsToBrowser); 
require 'cgi-lib.pl';
&ReadParse;
&Define;
&SendYourMail;
&SendToAnotherCGIOnAnotherServer;

sub SendToAnotherCGIOnAnotherServer {
	for (@variables) {
# Basically: for each variable of @variables in &Define, insert the 
#variable name, an equal sign, the value of the variable from the website 
#and an ampersand
		$remoteurl.=$_.'='.$in{$_}.'&';
	}

	print "Location: http://www.yoursite.com/cgi-bin/remotecgi?$remoteurl 
\n\n";
}
sub SendYourMail {
# your email routines here
}

sub Define {
    	@variables=qw(var1 var2 var3 var4);
}



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

Marc Bissonnette
InternAlysis
Intelligence in Internet Communications
http://www.internalysis.com


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

Date: 29 Jun 2001 13:02:30 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: cgi posting to another cgi
Message-Id: <878zibupu1.fsf@limey.hpcc.uh.edu>

>> On Fri, 29 Jun 2001 17:50:45 GMT,
>> dragnet@internalysis.com (Marc Bissonnette) said:

> rmhta@hotmail.com (rmhta) wrote in
> news:b3865d91.0106261921.4cc822ff@posting.google.com:

>> Howdy.
>> 
>> I need a cgi to post to another cgi on a different
>> server. What I'm trying to accomplish is this:
>> 
>> A cgi is posted to from a html form; This cgi sends an
>> email; This cgi "passes" whatever data was posted to
>> it, to another cgi on a different server.
>> 
>> Is there a straight-forward way of accomplishing this?

> yes. You'll have to excuse me for (still) using
> cgi-lib.pl, since I've just never gotten around to
> learning cgi.pm

The OP wanted "to post to another cgi [program]".  Your
code just did a GET.

CGI.pm isn't for that.  The OP wants LWP,

    perldoc lwpcook
    perldoc URI

hth
t
-- 
Somebody light this monkey.  AAAAGGGHHHH!!  Bad monkey!


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

Date: 29 Jun 2001 06:48:24 -0700
From: redsquirreldesign@yahoo.com (Dave Hoover)
Subject: Re: Code Review Needed!
Message-Id: <812589bb.0106290548.269762c0@posting.google.com>

John W. Krahn wrote ...
> Dave Hoover wrote:
> > 
> > I would greatly appreciate ANY feedback anyone could provide. The
> > following page will provide details and a link to download the
> > tarball.
> > 
> > http://www.redsquirreldesign.com/soapbox
> 
> From Soapbox.pm:
> 
[snip]
> Replace the previous 22 lines of code with:
> 
> my @date = localtime;
> return [ $date[4] + 1, $date[3], $date[5] % 100 ];

Awesome.  That's just a tad more efficient.

> In Soapbox.pm there are nine times where a file is opened but only once
> do you test the return from open!

Simple laziness (not the good kind, though), thanks for checking.
 
[snip]
> An array in scalar context can not have a negative value, it is probably
> simpler to combine the two statements.
> 
>     if (my $n = @count) {
>         $out .= "<a
> href=$s->{config}{soap_web}main.cgi?type=Browse&sub_id=$_->[0]>$_->[1]</a>
> ($n)<br>";
>     }

I'll give that a try.
 
> In sub deleteArticle you don't test the return value of unlink.
> 
> In sub siteNameUpdate and sub contentUpdate you don't test the return
> value of rename.
 
Again, lazy programming. It should have been done.

[snip]
> Why put the character classes in variables when the scope is only three
> lines?  Some characters are escaped that don't need to be, some that
> aren't escaped should be. Or did you really want the the range of
> characters "'-\" which includes "()*+,-./0-9;:<=>?@A-Z["?
> 
>         if ( m{([^ a-zA-Z0-9'\-\\.@,?/"!:]|[()*+=<>;])} ) {

Putting the character classes in variables helped me mentally organize
the regex.  I agree it is unneccesary, though.  No, I did not want the
range...the dash should have been escaped.
 
> sub convertApos {
>     for ($s->{param}{title}, $s->{param}{summary},
> $s->{param}{keywords}) {
>         s/\Q'/&#039\E/g; # Converting apostrophe
>           ^^       ^^
>     }
> }
> 
> The "\Q" and "\E" aren't needed and the "\E" is in the wrong place
> anyways. (also in sub formatTerms)

Noted.  Thanks for your time John.  This is exactly the kind of
feedback I was hoping to get.
 
--
Dave Hoover
"Twice blessed is help unlooked for." --Tolkien
http://www.redsquirreldesign.com/dave


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

Date: Fri, 29 Jun 2001 15:26:43 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Code Review Needed!
Message-Id: <x7ofr78fyk.fsf@home.sysarch.com>

>>>>> "TM" == Tad McClellan <tadmc@augustmail.com> writes:

  TM> If the file is named 'soapbox.tar.gz', folks expect it to
  TM> create a directory named 'soapbox' to put its files in.

that is one reason i almost always run tar ztvf foo.tar.gz on tarballs
of unknown origin. it is amazing how many don't have a parent dir they
create and they would untar all their files into the current dir. what
were those people thinking when they made that tarball?

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info:     http://www.sysarch.com/perl/OOP_class.html


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

Date: Fri, 29 Jun 2001 17:43:09 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Code Review Needed!
Message-Id: <tjpfhdm6nv69f@corp.supernews.com>

Uri Guttman (uri@sysarch.com) wrote:
: that is one reason i almost always run tar ztvf foo.tar.gz on tarballs
: of unknown origin. it is amazing how many don't have a parent dir they
: create and they would untar all their files into the current dir. what
: were those people thinking when they made that tarball?

Your question contains a hidden assumption. :)

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Magick is the art and science of causing change in conformity
   |   with Will."  - Aleister Crowley


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

Date: Fri, 29 Jun 2001 15:32:43 -0000
From: darkon@one.net (David Wall)
Subject: Re: coding technique - how would you do this?
Message-Id: <Xns90CF7567271DAdarkononenet@207.126.101.97>

troll@gimptroll.com (TuNNe|ing) wrote on 28 Jun 2001:

> Hello.
> Bear with me, this may appear to be a CGI question, but I feel it
> drives at the root of my perly technique.
> 
> Ok. I have two templates that contain HTML.
> To create "dynamic" content I use variables in my templates.

Why not use HTML::Template or HTML::Embperl ?

You can find them, and more, at 
http://search.cpan.org/Catalog/World_Wide_Web/HTML/

"troll" is not exactly the best username to have when posting to usenet... 

-- 
David Wall
darkon@one.net


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

Date: Fri, 29 Jun 2001 16:45:35 +0200
From: "DetUudslukkelige" <nospam@notformail.com>
Subject: Re: Communication error : Reason Bad file descriptor
Message-Id: <9hi44e$2fq$1@news.inet.tele.dk>


> In the following section change each instance of "Communication error" to
> something unique like "helo1 failed", "from1 failed", "data1 failed" using
> "helo2 failed", etc. for the autoresponder section.  Then in these and the
> "rcpt to" errors, include the smtp server response ($_).  For example:
>
>   if (/^[45]/) { close SOCK; error ("helo1 error : Reason $_"); }
>

Hi David,

When I change to $_ I got the message:

Error : Communication3 error : Reason 503 No recipients specified

What would you suggest I do now?

Thanks in advance!


-Mathias





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

Date: Fri, 29 Jun 2001 17:03:34 +0200
From: Patrick Erler <perler@yahoo.com>
Subject: Re: converting shell "sort" command to perl..
Message-Id: <Xns90CFAD87697A2fuyyehcesyrdx@62.153.159.134>

Benjamin Goldberg <goldbb2@earthlink.net> wrote in news:3B3C1A30.54DC5E6
@earthlink.net:

> Patrick Erler wrote:
>> now i want to convert the script to perl, no big problem, but this
>> command i just don't get converted:
>> 
>> sort -k 4.9b,4.13n -k 4.5b,4.7M -k 4.2b,4.3n -k4.14b,4.15n
>> -k 4.17b,4.18n -k 4.20b,4.21n
>> 
>> what it sorts is a simple apache log like this:
>> 213.83.52.132 - - [28/Jun/2001:20:29:43 +0200] "GET / HTTP/1.0" 200
>> 3392 "-" "check_http/1.32.2.6 (netsaint-plugins 1.2.9-4)"
>> 
>> ok, i could call the shell but i really would like to do it in perl...
[Benjamins code deleted]
> I could have used Time::Local rather than packing the date components as
> bytes, but there is no need to bring it in, since it isn't really
> needed.
> 
> Note that this code is untested.
thanks benjamin.. i corrected some bugs in the code.. here is a tested 
version:

#!/usr/bin/perl -w
use strict;


#$#ARGV >= 1 or die "Usage:\n\t$0 [logfile]\n";

my %mon;
@mon{qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)} = (0..11);

my $stabilizer = 0;

open my $ifh, "<", $ARGV[0] # my $ifh closed at end of do-block.
    or die "Could not open $ARGV[0] for r: $!\n";
rename( $ARGV[0], $ARGV[0] . ".bak" )
    or die "Could not rename $ARGV[0] to $ARGV[0].bak: $!\n";
open my $ofh, ">", $ARGV[0] # note there is no "my" here.
    or die "Could not open $ARGV[0] for w: $!\n";

print $ofh substr $_, 11 for
    sort
    map {
        # 213.83.52.132 - - [28/Jun/2001:20:29:43 stuff
        m/^\S* \S* \S* (\S*)/;
        my @date = unpack "xa2xa3xa4xa2xa2xa2", $1;
        pack "ncccccNa*",
            $date[2], $mon{$date[1]}, @date[0,3,4,5],
            ++$stabilizer, $_;
    } do {{ # double leftbrace to make a block
        ($ifh, $ofh) = (*STDIN, *STDOUT), last if @ARGV == 0;
        } # end of block; "last" from above skips to here.
        <$ifh>;
    };
close $ofh or die "Couldn't close $ARGV[0]: $!\n" if @ARGV == 1;
__END__

only the simplest thing with this code i don't get solved right now.. how 
should this line look like correctly?

$#ARGV >= 1 or die "Usage:\n\t$0 [logfile]\n";


thanks benjamin, you've been a great help!


-- 
PAT


vcard/LDAP/PGP: http://dresden-online.com/perler/identity.html
PGP fingerprint: DAC6 2FDA 1ED7 AD55  BD1F 5142 3D5F 72BF
Yahoo-ID: perler - http://jpager.yahoo.com/jpager/messenger.html


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

Date: Fri, 29 Jun 2001 17:07:25 +0200
From: "Eugene" <e.broeren@food-express.nl>
Subject: Coordinates for perl print command like ksh  print "\033[1;37HHello"
Message-Id: <9hi5jo$dah$1@ncc1701.cistron.net>

Hello all,


Is it possible to position the perl print command like in unix ksh print
"\033[1;37HHello"
How can i do this in perl

Thanks,




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

Date: 29 Jun 2001 10:18:13 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Coordinates for perl print command like ksh  print "\033[1;37HHello"
Message-Id: <87hewzuxfu.fsf@limey.hpcc.uh.edu>

>> On Fri, 29 Jun 2001 17:07:25 +0200,
>> "Eugene" <e.broeren@food-express.nl> said:

> Hello all, Is it possible to position the perl print
> command like in unix ksh print "\033[1;37HHello" How can
> i do this in perl

You can do it even more portably (hey, everything isn't a
vt100).

    perldoc Curses

hth
t
-- 
Somebody light this monkey.  AAAAGGGHHHH!!  Bad monkey!


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

Date: Fri, 29 Jun 2001 16:56:28 GMT
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Create unique file in dir?
Message-Id: <1evryvo.1rhkzxxlp9y68N%tony@svanstrom.com>

Craig Berry <cberry@cinenet.net> wrote:

> Anybody have suggestions on how to create a unique file in a directory,
> possibly obtaining an open filehandle to it in the process?  (Obviously, I
> could open it as a separate step, but doing both in one process would be
> an optimization).  I don't care about the details of the name.  Obviously,
> race conditions between separate processes trying to do this must be
> avoided.  Any suggestions?

Personally i use time-pid-[4 random numbers], if that fails then the you
most likely have a lot more serious server-related problems to deal with
then non-unique files. Besides, since you lock the file nothing bad will
happen anyways...


        /Tony
-- 
the truth is dead, faith is gone, reality killed... ruled by the plastic
laws of modern life we're pushed towards the hell of personal doubt,
betrayal, hate, lust and murder... the now has become an illusion, a
paradise of a dead tomorrow... (c)2000-2001 tony@svanstrom.com


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

Date: 29 Jun 2001 07:54:36 -0700
From: gururaj@powertec.com (Gururaj Upadhye)
Subject: Re: error making Archive::Zip
Message-Id: <23c54ab6.0106290654.27144cb@posting.google.com>

I tried using GUI package manager and also dpm. I got following
messages:
Can't call method "gzread" on an undefined value at
d:/Perl/site/lib/Archive/Tar.pm line 274.

Before trying to install Archive-zip I tried to install Archive-Tar.
While installing something failed, but still went ahead and installed.
I am assuming the error is because of that error. I tried to uninstall
Archive-Tar to avoid this error. I am getting following error for
that:
Removing package Archive-Tar [0.072]
Error: packlist (d:\Perl/dpm/Archive-Tar.packlist) for package
Archive-Tar not found
Making TOC
DONE

The error is coming from line $file->gzread ($head,
$tar_header_length)
in sub _read_tar.

Thank you for following the problem so far. Looking forward for your
reply.

Thanks and Regards,
-Gururaj.


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

Date: Fri, 29 Jun 2001 16:32:57 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: error making Archive::Zip
Message-Id: <p4bpjtkmfidmjbugnimn4um13fi3i9mk8i@4ax.com>

Gururaj Upadhye wrote:

>I tried using GUI package manager and also dpm. I got following
>messages:
>Can't call method "gzread" on an undefined value at
>d:/Perl/site/lib/Archive/Tar.pm line 274.
>
>Before trying to install Archive-zip I tried to install Archive-Tar.
>While installing something failed, but still went ahead and installed.
>I am assuming the error is because of that error.

Uh-oh. I'm virtually 100% sure that Archive::Tar (and Compress::Zlib) is
part of the basic installation of IndigoPerl. I should be *very* wrong
if that is not the case.

Yup. Checking the ZIP containing indigoperl, and sorting the files by
name, I can see both zlib.* files (incl. zlib.dll and zlib.pm), and
Tar.* files (incl. Tar.pm).

Try decompressing these files from the ZIP file, keeping them in their
folder structure, and moving them to their intended place in the perl
file tree. That should restore the installation of Compress::Zlib and
Archive::Tar. Once that is done, you should be back on track.

-- 
	Bart.


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

Date: Fri, 29 Jun 2001 13:18:34 GMT
From: Jenda Krynicky <Jenda@Krynicky.cz>
Subject: Re: from linux to WinNT4 Ms Sql
Message-Id: <1103_993820714@JENDA>

> "Joonas Timo Taavetti Kekoni" <jkekoni@cc.hut.fi> wrote in message
> news:9hdi3h$ju6$1@nntp.hut.fi...
> > novastar <subscriber@novastar.dtdns.net> wrote:
> > : Can you tell me please what module do I have to use to connect and query
> a
> > : Microsoft SQL installed on a Windows NT4 box from a linux one ?
> >
> > Microsoft SQL server is normally queried from perl via ODBC.
> > There is however no odbc drivers for MS SQL server outside
> > win32. Therefore you need either ODBC-ODBC bridge
> > like:
> >
> > http://www.easysoft.com/products/da_components/oob/main.phtml
> >
> > Or driver that talks directly SQL server protocol. Bea has
> > one for java, but i don't know one for perl.
> >
> >
> >
> > --
> > _-  Joonas Kekoni       OH2MTF     I                           -_

I've never tried, but maybe DBD::Sybase would work since both MS SQL and Sybase 
share the same predecesor.

Jenda



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

Date: Fri, 29 Jun 2001 10:59:03 +0500
From: Robert Sherman <rsherman@ce.gatech.edu>
Subject: Re: getting a defined value from a html page
Message-Id: <3B3C1927.60C81F29@ce.gatech.edu>

Lex wrote:

> Hi,
>
> I've got a html page with the following written it:  <object1>19.1</object>
> (for example)
>
> How do I insert in a perl script that it picks out what is in between
> <object> and </object> so I can process the value?
>
> Thanks for pointing me in the right direction!
>
> Lex Thoonen
> Pêng Smart Web Design
> http://www.peng.nl

you could use a pattern match:

/\<object\>(.+)\<\/object\>/

$1 will hold your value



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

Date: Fri, 29 Jun 2001 15:59:54 GMT
From: "Lex" <nospam@peng.nl>
Subject: Re: getting a defined value from a html page
Message-Id: <_B1%6.152241$u5.2987309@zwoll1.home.nl>

"Robert Sherman" <rsherman@ce.gatech.edu> wrote in message
news:3B3C1927.60C81F29@ce.gatech.edu...

> you could use a pattern match:
>
> /\<object\>(.+)\<\/object\>/
>
> $1 will hold your value

Thanks!!!




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

Date: Fri, 29 Jun 2001 16:31:50 GMT
From: "Lex" <nospam@peng.nl>
Subject: Re: getting a defined value from a html page
Message-Id: <W32%6.152333$u5.2992147@zwoll1.home.nl>

"Robert Sherman" <rsherman@ce.gatech.edu> wrote in message
news:3B3C1927.60C81F29@ce.gatech.edu...

> you could use a pattern match:
>
> /\<object\>(.+)\<\/object\>/
>
> $1 will hold your value
>

Hi Robert,

I'm no programmer, just want to get this working and it doesn't...
can you see what I'm doing wrong?
(thanks!)
 ------------------------------

open(FILE,"$source_file") || &error('open->source_file',$source_file);
@FILE = <FILE>;
close(FILE);

$_ = join('',@FILE);

while (/\<Temperatuur\>(.+)\<\/Temperatuur\>/) {

print $1;

}

exit;
--------------------------------

Lex Thoonen
Pêng Smart Web Design
http://www.peng.nl





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

Date: Fri, 29 Jun 2001 10:16:52 -0700
From: "news.sohoskyway.com" <jestersi@metacrawler.com>
Subject: how do I return a hash var
Message-Id: <3b3cb782_1@sohoskyway.net>

i.e.

sub somefunc {
    %somevar = {"100","green","200","red" };
    return($somevar);
}

$myhash = &somefunc();
print ref($myhash);    #this prints NOTHIN!!

any guru's figure this out?





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

Date: Fri, 29 Jun 2001 17:40:52 GMT
From: Rickey Ingrassia <r1ckey@home.com>
Subject: Re: how do I return a hash var
Message-Id: <E43%6.2414$wr.12359@news1.frmt1.sfba.home.com>

news.sohoskyway.com <jestersi@metacrawler.com> on Fri, 29 Jun 2001 10:16:52 -0700 wrote:
>i.e.

>sub somefunc {
>    %somevar = {"100","green","200","red" };
                ^   shouldn't this be ()   ^
>    return($somevar);
>}

>$myhash = &somefunc();
>print ref($myhash);    #this prints NOTHIN!!

>any guru's figure this out?
By no measure am I a guru...

Are you trying to return a reference to the hash?  If so use this,

	return(\%somevar); # returns a reference to %somevar

Or are you trying to return one of the values of the hash? If so try this,

	%somevar = (100 => green,
                    200 => red);
        return($somevar{100}); # will return green




-- 



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

Date: Fri, 29 Jun 2001 16:55:24 GMT
From: "Lex" <nospam@peng.nl>
Subject: ImageMagick installation
Message-Id: <0q2%6.152408$u5.2996242@zwoll1.home.nl>

Hi,

I've asked my host to install: ImageMagick
  http://www.wizards.dupont.com/cristy/ImageMagick.html

My host replied like this:

==============

At 11 Jun 2001 22:36 EST, Esosoft wrote:

 - Dear Lex,

Unfortunately we are unable to install it for free on our servers as
it requires an admin person to sit in front of the computer. We can
install it for your for an $50.00 per hour charge.

--Esosoft Support


>>>>>>>>>>>>>>>>>>>>>>>>>>>>
At 14 Jun 2001 19:15 EST, Esosoft wrote:

 - Hi Lex,

I've checked with our system admin and we are unable to install it
for an hourly fee as it is a too complex program which needs
installation of additional programs in order to compile and work.

--Esosoft Support

==============

Now, I've never had much trouble with them, I would just like to know it
their reply is reasonable.

Does anybody know? Is ImageMagick so hard to install?

Thanks


Lex Thoonen
Pêng Smart Web Design
http://www.peng.nl




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

Date: Fri, 29 Jun 2001 15:29:50 GMT
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: is there a way to look ahead/behind in a foreach (@l)?
Message-Id: <1evrwp3.1blx8xxwr0xs2N%tony@svanstrom.com>

tuxy <nospam@cfl.rr.com> wrote:

> "Tony L. Svanstrom" wrote:
> > 
> > tuxy <nospam@cfl.rr.com> wrote:
> > 
> > > I could peek ahead or behind in an old-fashioned loop such as:
> > >
> > >   for ($i=2; $i<100; $i++)
> > >    {print 'yikes!' if ($l[$i]> $l[$i-1]);}
> > >
> > > is there a way to see other elements of an array in a foreach, as in:
> > >
> > >   foreach (@l)
> > >     {next unless defined $predecessor;
> > >      print 'yikes!' if ($_ > $predecessor);}
> > 
> > Combine them, sort of...
> > 
> > @::test = (1,2,3,4,5,6,7,8,9);
> > foreach (@::test) {$::i++; print "$_ $::i @::test[$::i-1]\n"}

> Thanks guys good ideas- my question was more general however, I was
> wondering how to look ahead & behind, to say, any value in the array,
> maybe $a[$current location + 20] or whatever. I think that from your
> replies that foreach () isn't such a hot idea in these cases! Best to use
> indices I guess, which I generally avoid.

Maybe I don't understand the question, but you can do that using my
solution, you simply change the "-1" to the value you want to look
ahead, or back, -1 (since the first one is 0, and the counter begins at
one).



        /Tony
-- 
the truth is dead, faith is gone, reality killed... ruled by the plastic
laws of modern life we're pushed towards the hell of personal doubt,
betrayal, hate, lust and murder... the now has become an illusion, a
paradise of a dead tomorrow... (c)2000-2001 tony@svanstrom.com


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

Date: 29 Jun 2001 06:58:47 -0700
From: karl@dm-x.com (Karl Seguin)
Subject: LDAP inheritance
Message-Id: <767ab8f7.0106290558.3cc50bfc@posting.google.com>

I'm researching the functionality of LDAPs supper/subclassing to
compliment perl object inheritance..or maybe just let the LDAP layer
take care of it all.  My LDAP book clearly states that LDAP doesn't
support overriding in that if a superlcass defines an attribute, it
must be present in the subclass.

I'm looking for additional information on LDAP inheritance...and
specifically overriding.  What happens if both the superclass and the
subclass have the same defined attribute (by name)...does the
subclass' definition override that of the superclass?  And how does it
all fit in with Net::LDAP ?

Any references to LDAP RFC about attribute overriding (aka, thorough
discussion on the objectclass type), or other ressources would be much
appreciated.  Any information (if there is any) on implementing LDAP
inheritance through Net::LDAP would be great as well!

Thanks,
Karl


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

Date: Fri, 29 Jun 2001 09:23:18 -0700
From: Gordon Vrdoljak <vrdoljak@uclink.berkeley.edu>
Subject: limiting cgi input from specific IP's
Message-Id: <3B3CAB76.39BC879D@uclink.berkeley.edu>

hello,
Is it possible to limit some perl/cgi scripts so that they can only be run from
certain ip addresses?
Gordon

-- 
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Gordon Ante Vrdoljak                                  Electron Microscope Lab
ICQ 23243541   http://nature.berkeley.edu/~gvrdolja   26 Giannini Hall
vrdoljak@uclink.berkeley.edu                          UC Berkeley
phone (510) 642-2085                                  Berkeley CA 94720-3330
fax   (510) 643-6207 cell (510) 290-6793


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

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 1218
***************************************


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