[11111] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4711 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 21 13:06:05 1999

Date: Thu, 21 Jan 99 10:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 21 Jan 1999     Volume: 8 Number: 4711

Today's topics:
        "News Group Not Found" KernelKlink@webtv.net
    Re: ** Seems Like a Natural for Perl ** <ldaffner@rsn.hp.com>
        Am I wrong about Symbolic References? <burton@mcs.net>
    Re: Am I wrong about Symbolic References? (Sean McAfee)
    Re: Am I wrong about Symbolic References? <abey@hill.ucr.edu>
        Automatically Posting forms <jsilver@multisoft.com>
    Re: Changing elements in a text file <aqumsieh@matrox.com>
    Re: context prob: assign @rowarray to 3d $table[@row],[ <lbenfie1@nospamford.com>
    Re: dereference entire array of array references <abey@hill.ucr.edu>
    Re: dereference entire array of array references (Sean McAfee)
    Re: dereference entire array of array references <lbenfie1@nospamford.com>
    Re: dereference entire array of array references <lbenfie1@nospamford.com>
    Re: Difficult issues not suitable for this newsgroup? (I R A Aggie)
    Re: File Upload. (Sam Curren)
        Hourly pay rate for Perl programmers (Tad McClellan)
    Re: How do I use modules? <chrisl@hamptons.com>
        How to set keyboard timeout (Mark Fearer)
        LookupAccountSid Help (Jason Stanley)
    Re: memory leak (Perl-odbc-MSSQL) (Barry deFreese)
    Re: Newbie-Looking for Network Monitoring scripts <toddl@SiTera.com>
        Oracle from Linux <rolf@parallax.co.uk>
        pattern matching (details) <cousin@ensam.inra.fr>
        Problems installing the Time::HiRes module !!! <stefan.nonneman@cec.be>
    Re: Problems installing the Time::HiRes module !!! (Randy Kobes)
    Re: Script for Alpha Pager Notification <njones@firstquadrant.com>
    Re: Script for Alpha Pager Notification (Richard Nimz)
    Re: Seeking a Book on (MS) SQL w/ perl KernelKlink@webtv.net
    Re: Simple CGI with Perl <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Simple CGI with Perl <javaprogrammer@Mindspring.com>
    Re: Sybase module for perl from CPAN <mpeppler@mbay.net>
        Y2K? (Tuomas Angervuori)
    Re: Y2K? (Alan Barclay)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 21 Jan 1999 11:41:33 -0500 (EST)
From: KernelKlink@webtv.net
Subject: "News Group Not Found"
Message-Id: <19133-36A758BD-22@newsd-101.iap.bryant.webtv.net>

Not a Perl issue...but could be one day. 

I just now found out that the Newsgroup search tool built into Webtv
only returns SOME newsgroups. Type "Microsoft" into the widget and the
results come back so fast and plentiful that it will knock my tv onto
the floor, but type in for example NetObjects (and others) and you get
"News Groups Not Found". Newsgroup comes back "Not Found" even if I type
in the direct address to it.

I wonder how long it will be before "Perl" is not found?



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

Date: 21 Jan 1999 11:10:32 -0600
From: Larry Daffner <ldaffner@rsn.hp.com>
Subject: Re: ** Seems Like a Natural for Perl **
Message-Id: <f5ohftkmu0n.fsf@rsn.hp.com>

>>>>> "DWB" == David W Bourgoyne <david.bourgoyne@bigfoot.com> writes:

    DWB> Here's the situation.  Everyone at my household has a unique
    DWB> email address at a mail forwarding service.  All emails get
    DWB> forwarded to my single ISP account.  I would like to develop
    DWB> a POP3 Client that sucks all the email off the ISP, looks at
    DWB> the To: fields and appends it to the correct persons mbox.
    DWB> Also, I would like the POP3 Client to automatically respond
    DWB> (send email back to the Sender) to image request.

First of all, are you SURE you want to do this? Mailing lists and
blind copies could make this impossible to get right, unless your
forwarding service makes the envelope address it sees avaiailable in a
specific header (To: won't work, because of mailing lists, Cc: and
Bcc:, etc.

However, if there is a definite way to tell mail apart (such as an
X-Envelope-to: from the forwarding service), then why reinvent the
wheel? Just get a copy of fetchmail and set it up for multidrop
mode. It'll most likely be easier and more correct than any attempts
to reinvent the wheel.

Just my $0.02
Larry (Speaking only for myself)

-- 
| Larry Daffner - Software Engineer | email: ldaffner@rsn.hp.com        |
|      Hewlett Packard RSSL         | #include <disclamer.h>            |
  The average man, who does not know what to do with his life, wants
  another one which will last forever.  --Anatole France


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

Date: Thu, 21 Jan 1999 10:08:16 -0600
From: Burton Kent <burton@mcs.net>
Subject: Am I wrong about Symbolic References?
Message-Id: <36A750F0.34849453@mcs.net>


I'm trying to use symbolic references to print a list of 
variables.  A vastly simplified listing follows.

My question is, how am I misunderstanding symbolic references?
According to my Camel book, this code should work!

Thanks!

Burton

--------------------------------------------------
#!/opt/x11r6/bin/perl

#This is perl, version 5.004_04 built for sun4-solaris (etc.)

 my ($work_item_no, $request, $loc, $title, $impact,
   $considerations, $timestamp, $validate, $approval,
   $comment, $status)
   = split ',' , "1,2,3,4,5,6,7,8,9,10,11";

 for $field ( 'work_item_no', 'request', 'loc', 'title',
   'impact', 'considerations', 'timestamp', 'validate',
   'approval', 'comment', 'status') {
        $symbolic = "${$field}";
        print "$field: $symbolic\n";
 }


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

Date: Thu, 21 Jan 1999 16:31:07 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Am I wrong about Symbolic References?
Message-Id: <fDIp2.3316$Ge3.14288723@news.itd.umich.edu>

In article <36A750F0.34849453@mcs.net>, Burton Kent  <burton@mcs.net> wrote:
>I'm trying to use symbolic references to print a list of 
>variables.  A vastly simplified listing follows.

>My question is, how am I misunderstanding symbolic references?

>--------------------------------------------------
> my ($work_item_no, $request, $loc, $title, $impact,
>   $considerations, $timestamp, $validate, $approval,
>   $comment, $status)
>   = split ',' , "1,2,3,4,5,6,7,8,9,10,11";
> for $field ( 'work_item_no', 'request', 'loc', 'title',
>   'impact', 'considerations', 'timestamp', 'validate',
>   'approval', 'comment', 'status') {
>        $symbolic = "${$field}";
>        print "$field: $symbolic\n";
> }

Symbolic references cannot be used to access lexical ("my") variables.  Get
rid of the "my", and it will work.  In all likelihood, though, a much
better solution is to use a hash:

@fields = qw(work_item_no request loc title impact considerations
    timestamp validate approval comment status);

@variable{@fields} = split ',', "1,2,3,4,5,6,7,8,9,10,11";

for $field (@fields) {
    print "$field: $variable{$field}\n";
}

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: Thu, 21 Jan 1999 08:41:53 -0800
From: Abraham Grief <abey@hill.ucr.edu>
To: Burton Kent <burton@mcs.net>
Subject: Re: Am I wrong about Symbolic References?
Message-Id: <Pine.LNX.4.05.9901210840140.6578-100000@hill.ucr.edu>


In the camel book, p. 255:

Only package variables are visible to symbolic references.  Lexical
variables (declared with my) aren't in a package symbol table, and thus
are invisible to this mechanism.


On Thu, 21 Jan 1999, Burton Kent wrote:

> 
> I'm trying to use symbolic references to print a list of 
> variables.  A vastly simplified listing follows.
> 
> My question is, how am I misunderstanding symbolic references?
> According to my Camel book, this code should work!
> 
> Thanks!
> 
> Burton
> 
> --------------------------------------------------
> #!/opt/x11r6/bin/perl
> 
> #This is perl, version 5.004_04 built for sun4-solaris (etc.)
> 
>  my ($work_item_no, $request, $loc, $title, $impact,
>    $considerations, $timestamp, $validate, $approval,
>    $comment, $status)
>    = split ',' , "1,2,3,4,5,6,7,8,9,10,11";
> 
>  for $field ( 'work_item_no', 'request', 'loc', 'title',
>    'impact', 'considerations', 'timestamp', 'validate',
>    'approval', 'comment', 'status') {
>         $symbolic = "${$field}";
>         print "$field: $symbolic\n";
>  }
> 
> 



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

Date: Thu, 21 Jan 1999 12:15:48 -0500
From: "Justin M. Silver" <jsilver@multisoft.com>
Subject: Automatically Posting forms
Message-Id: <787nbk$p73@netaxs.com>

I am trying to get a script which parses a file, assigns variables to the
data, and then assignes these variables to hidden fields automatically post
these hidden fields to the next script. I have been successful in writing
the script, but you still have to click [Submit] to post to the next script.
Is it possible to get it do this automatically (kind of lika a meta
refresh)? Any help would be appreciated.

Justin Silver

--
--------------------------------------------------------
MultiSoft Incorporated         Phone: 770-612-8411 X1417
http://www.multisoft.com       Pager: 404-743-7488
Email: jsilver@multisoft.com   Fax:   770-612-1978
--------------------------------------------------------





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

Date: Thu, 21 Jan 1999 11:21:59 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Changing elements in a text file
Message-Id: <x3yu2xkoau5.fsf@tigre.matrox.com>


iqbal <iqbal@orangenet.co.uk> writes:

> 
> Artoo wrote:
> > 
> > How can you change specific elements in a text file?
> > 
> > EG: Text file:
> > hello|test|1234|
> > goodbye|tset|4321|
> > 
> > How can you make perl just edit the file and replace 1234 with 5678.  Is it

perl -pi.bak -e 's/1234/5678/' file_name

This will create a backup for your original file, and modify it (the
original file).

> > Artoo
> 
> Make a call to sed
> 
> Iqbal

Hmm .. since Perl has an easy and fast solution to that, and the
question was asked in a Perl newsgroup, why would you suggest sed?
Besides, sed is more limited. From sed's manpage:

     sed is a text editor.  It cannot edit binary files or  files
     containing ASCII NUL (\0) characters or very long lines.

Also, according to my experience, the speeds of sed and perl (in the
specific task of replacing a certain string with another in a file)
are comparable. Perl is even usually a few seconds faster.

Ala



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

Date: Thu, 21 Jan 1999 15:36:01 +0000
From: Lee Benfield <lbenfie1@nospamford.com>
Subject: Re: context prob: assign @rowarray to 3d $table[@row],[$cursor]
Message-Id: <36A74961.B68A6262@nospamford.com>

Mark Hamlin wrote:
> 
> My problem is probably something to do with scalar/ array context.
> Whats wrong with:
> 
> $table[@row][$cursor] = @next_row_returned_ from_db_select_query

surely you mean $row??

> or like this:
> $table{@row,$cursor} = @next_row_returned_ from_db_select_query
> 
> ???? What is the correct syntax.  Must I define the array first?

cast it to an array ref before you put it in the array.

$table[$row][$cursor] = \@next_row_returned_ from_db_select_query

to get it back out (one way)

my $rowref = $table[$row][$cursor]
@row = @$rowref

(of course, you don't need to put it back into an array, you can access
the data from the reference, see man perlref for details)

> 
> Please could you cc a direct response to me.  Many thanks,
> Mark Hamlin.

 :)

> 
> UK (144) 01473 646703
> 
> --
> 
>         ___....-----'---'-----....___
>   =========================================
>          ___'---..._______...---'___
>         (___)      _|_|_|_      (___)
>           \\____.-'_.---._'-.____//
>             ~~~~'.__'---'__.'~~~~
>                    ~~~~~~~
>         'More speed'
>                   Sisco
> 
> Work: mailto:mark.c.hamlin@bt.com
> Personal: mailto:mark@dimitrinet.demon.co.uk
> 
> Please use you auto reply where possible to distribute to both mailboxes.

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Lee Benfield, Ford Motor Co.


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

Date: Thu, 21 Jan 1999 08:12:47 -0800
From: Abraham Grief <abey@hill.ucr.edu>
To: techmatt@my-dejanews.com
Subject: Re: dereference entire array of array references
Message-Id: <Pine.LNX.4.05.9901210809200.6319-100000@hill.ucr.edu>


How about something ot the effect of:

(@array1,@array2,@array3) = map {${$_}} @results;

I haven't tried it, but I'm pretty sure that it should work.


On Thu, 21 Jan 1999 techmatt@my-dejanews.com wrote:

> I am using a function that returns an array of references to arrays.
> example: @results = foo (@input);
> 
> Each element of the array is a reference to an array which contains the
> results. I have no problem dereferencing on element at a time. example: 
> @array0 = ${$results[0]};  @array1 = ${$results[1]};  etc. The problem is
> that I think there must be some elegant way of doing the assignment all on
> one line (without using a loop). Something like this:
> (@array1,@array2,@array3) = @{[@results]};
> 
> But this doesn't work.	Is there any way to dereference the entire array in
> one fell swoop?
> 
> Matthew Schaffner
> real email address:  techmatt@home.net
> 
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    
> 
> 



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

Date: Thu, 21 Jan 1999 16:24:20 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: dereference entire array of array references
Message-Id: <UwIp2.3314$Ge3.14284979@news.itd.umich.edu>

In article <787gsi$l8d$1@nnrp1.dejanews.com>,
 <techmatt@my-dejanews.com> wrote:
>I am using a function that returns an array of references to arrays.
>example: @results = foo (@input);

>Each element of the array is a reference to an array which contains the
>results. I have no problem dereferencing on element at a time. example: 
>@array0 = ${$results[0]};  @array1 = ${$results[1]};  etc.

ITYM "@array0 = @{$results[0]}; @array1 = @{$results[1]}; etc."

>The problem is
>that I think there must be some elegant way of doing the assignment all on
>one line (without using a loop). Something like this:
>(@array1,@array2,@array3) = @{[@results]};

>But this doesn't work.	Is there any way to dereference the entire array in
>one fell swoop?

In Perl 5.005:

@{"array$_"} = @{$results[$_]} foreach 0 .. $#results;

If I were you, though, I'd try to find a way to just use the data in
@results directly.

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: Thu, 21 Jan 1999 15:59:55 +0000
From: Lee Benfield <lbenfie1@nospamford.com>
Subject: Re: dereference entire array of array references
Message-Id: <36A74EFB.A7EF6E8E@nospamford.com>

techmatt@my-dejanews.com wrote:
> 
> I am using a function that returns an array of references to arrays.
> example: @results = foo (@input);
> 
> Each element of the array is a reference to an array which contains the
> results. I have no problem dereferencing on element at a time. example:
> @array0 = ${$results[0]};  @array1 = ${$results[1]};  etc. The problem is
> that I think there must be some elegant way of doing the assignment all on
> one line (without using a loop). Something like this:

But loops *are* elegant!

> (@array1,@array2,@array3) = @{[@results]};

But hold on, how could (anything like) this possibly work?

Every value would go into @array1, leaving @array2 & 3 empty.

I think what you were hoping to do is this:

@a = (1,2,3);
@b = (3,4,5);
@c = (4,5,6);

@d = (\@a,\@b,\@c);

($null,@e,$null,@f,$null,@g) = map {$_ => @$_} @d;

print "".join(",",@e)."\n";

------
but, of course, you'll see that @e swallows everything.


-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Lee Benfield, Ford Motor Co.


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

Date: Thu, 21 Jan 1999 16:36:04 +0000
From: Lee Benfield <lbenfie1@nospamford.com>
Subject: Re: dereference entire array of array references
Message-Id: <36A75774.418F414@nospamford.com>

Sean McAfee wrote:
    ^^^^^^^^
Any relation to the McAfee AV? *8)

> 
> In Perl 5.005:
> 
> @{"array$_"} = @{$results[$_]} foreach 0 .. $#results;
> 

*grin* foreach... he wanted one without a loop.  
That's neat though. :)

> If I were you, though, I'd try to find a way to just use the data in
> @results directly.
> 
> --
> Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
>             | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
>             | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Lee Benfield, Ford Motor Co.


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

Date: Thu, 21 Jan 1999 11:06:19 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Difficult issues not suitable for this newsgroup?
Message-Id: <fl_aggie-2101991106190001@aggie.coaps.fsu.edu>

In article <m14spkocc7.fsf@halfdome.holdit.com>, merlyn@stonehenge.com
(Randal L. Schwartz) wrote:

+ Randal, Usenet Cabal member # 02134

TINC

James


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

Date: Thu, 21 Jan 1999 08:57:23 -0800
From: samc@empirewest.com (Sam Curren)
Subject: Re: File Upload.
Message-Id: <MPG.1110fc4ddf49e1139896d3@news.sonic.net>

But what happens with a binary file? Now it has newlines periodicly 
through it.

use CGI.pm and pull the values out that way. Much more powerful and 
simple to use.

-Sam Curren

In article <36A6ED92.7EC03B43@khayal.com>, ghulam@khayal.com says...
> Assuming that your file input variable is "cv" , the following should
> suffice :
> 
> #-------Beginning Code----------
> 
> #!/usr/bin/perl
> require "cgi-lib.pl";
> &ReadParse;
> open (F, ">uploaded.dat");
> print F "$in{'cv'}\n";
> close (F);
> 
> #-------End of Code-------------
> Note : You can name the new file  to whatever you want instead of
> "uploaded.dat" depending on type.e.g "wordfile.doc"
> 
> piece of cake, huh?
> 
> Alex Blyumenkrants wrote:
> 
> > Hi!
> >
> > I have the following problem:
> >
> > i need to upload a file from an Html,
> > if i use type="file"
> > what should i do to save this file in my Cgi?
> >
> > Thank You,
> > Alex
> 
> 


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

Date: Thu, 21 Jan 1999 08:55:09 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Hourly pay rate for Perl programmers
Message-Id: <d4f787.7vr.ln@magna.metronet.com>


Contract Professional magazine has published the results of
their survey, including rates for Perl programming.


   http://www.cpuniverse.com/cpuarch/1999/rs/toc.htm



< $50     28.4%

$50-89    62.6%

> $90      9%


[ figures taken from the 67 respondents in the printed magazine ]



--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 21 Jan 1999 16:44:23 GMT
From: Chris <chrisl@hamptons.com>
Subject: Re: How do I use modules?
Message-Id: <36A75967.C9B6DBE5@hamptons.com>

> How hard did you look on CPAN?

Perfectly hard.

> http://www.cpan.org
>
> Contents of --> http://www.cpan.org/ROADMAP.html
>
> module/extensions --> http://www.cpan.org/modules/
>
> by naming hierarchy --> http://www.cpan.org/modules/by-module/
>
> CGI --> CGI.pm
>
> You must have overlooked your initiative :/

No, actually I found that stuff, but all that got me was a directory called
CGI with a whole bunch of files with names like CGI.pm-2.36.tar.gz (at the
friendliest). I didn't see .zip files, or anything that looked like they'd
help a Win32 guy.



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

Date: 21 Jan 1999 17:14:11 GMT
From: mfearer@mail.fearernet.com (Mark Fearer)
Subject: How to set keyboard timeout
Message-Id: <787n93$rmj$1@pyrite.mv.net>

  Anyone know how to have a perl program terminate execution if the user
running it
hasn't touched the keyboard in a predermined amount of time?


--
--------------------------------------------------
Mark Fearer                        *   C:\DOS
mfearer@mail.fearernet.com         *   C:\DOS\RUN
http://www.fearernet.com/mfearer   *   RUN\DOS\RUN


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

Date: Thu, 21 Jan 1999 11:23:56 -0600
From: jstanley@mmm.com (Jason Stanley)
Subject: LookupAccountSid Help
Message-Id: <787nrc$720$1@magnum.mmm.com>

I am trying to use this module to extract the user name from a sid I enter
in.  Needless to say it doesn't work.  When I use LookupAccountName it will
return the correct domain but the sid is returned in ASCII.  I need to know
how to do it where it returns a normal looking sid.  Here is the script I
enter and the output that follows.
use Win32;

$system = "\\\\winsaccts999";
$account = "wins\\ussab002";
Win32::LookupAccountName($system, $account, $domain, $sid, $sidtype);
$domain, $sid, $sidtype);
print "SID:$sid\n";
print "SID Type:\t\t\t$sidtype\n";
print "Node:\t\t\t$node\n";
print "Domain:\t\t\t$domain\n";

Output:
SID:??     ?'   f?+?Q[ W-&?@j_  ?   7g+ ?&+ -3-     &n- 2:: `<$ bv$ qv$
?( ?n- ?+' v
>- @2-  &?     @2- ?   =<$ a??-3-     +=- ?+'  p+ a=' ?   P&$ ?+'  p+ a=' ?
P&$ ?p
  (     - at-     -n? ?+'  p+ a=' ?   P&$ "p+ `   ?       ?   qv$ p?( @2-
V!$
  j?@ ?   &e???   ?   nn- @2-
SID Type:                       1
Node:
Domain:                 WINS


Thanks for the help.




Opinions expressed herein are my own and may not represent those of my employer.



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

Date: Thu, 21 Jan 1999 16:33:06 GMT
From: bdefreese@sportsspecialties.com (Barry deFreese)
Subject: Re: memory leak (Perl-odbc-MSSQL)
Message-Id: <36a7569a.3122930@news.speed.net>

There are a couple of memory leak issues with IIS though SP4 was
supposed to take care of them.  Check http://support.microsoft.com

On Thu, 21 Jan 1999 05:32:01 GMT, "jim" <ji1@home.com> wrote:

>Hi,
>
>We are running a web site using NT 4.0 with service pack 4 and mssql 6.5.
>We have some perl scripts read and update the database.  We are running
>into some memory leak problems.  If we leave the system running for a couple
>of days, the IIS server will grabs all the memory in the system and
>eventually
>make the system useless.  We suspect the problem is in the perl or odbc
>since we also use IDC to query the database.  If we turn off perl scripts,
>it is not much a problem.
>
>Has anyone out there experienced the same probem?  Is this a bug in
>perl, odbc, or IIS?  Any pointer will be highly appreciated.
>
>
>Jim
>
>

Barry deFreese
Manager Network Services
Sports Specialties Corp.
bdefreese@sportsspecialties.com

It's much easier to get forgiveness than permission!


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

Date: Thu, 21 Jan 1999 10:27:42 -0700
From: Todd LaWall <toddl@SiTera.com>
Subject: Re: Newbie-Looking for Network Monitoring scripts
Message-Id: <36A7638E.E2780CBC@SiTera.com>


Although it's not perl, you might want to look at Big-Brother:

http://MacLawran.ca/bb-dnld/

HTH
Todd

"Michael J. Bahr" wrote:
> 
> Hello all,
> 
> Im trying to find some scripts or pointers for help to do the following:
> 
> I need to produce a network map in html format, indicating which of my
> nodes are up and which are down. Im using active perl on a Win32
> platform. I found an article
> (http://www.webdeveloper.com/categories/management/management_network_mapping.html)
> on doing this using fping and gd.pm but I couldn't find a compatible
> win32 based ping program - (or rather dont know how to implement it.)
> 
> Basically I create a .gif image of the network and a text file with the
> coordinates and IP of each node on the gif. The ping program needs to
> ping the contents of the text file and return all non-responding nodes.
> It should then look up the coordinates of the non-responding nodes and
> fill those areas of the gif with the color red (using gd.pm) It should
> the print it to html.
> 
> Anyone have any ideas on how to do this or perhaps another solution?
> 
> TIA
> 
> Michael Bahr


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

Date: Thu, 21 Jan 1999 16:49:17 +0000
From: Rolf Howarth <rolf@parallax.co.uk>
Subject: Oracle from Linux
Message-Id: <36A75A8D.B6DFE206@parallax.co.uk>

What's the easiest way to connect to an Oracle database (on NT) from
Perl (on Linux)? I've got the DBD::Oracle module but this requires Pro*C
or SQL*Net client drivers for Linux. Are these freely available, and if
so, where from? (They're not on Oracle's free software download page).
Ideally, I don't want to have to install any special code or code
requiring a license on the client.

Why is there no standard database access transport layer? ODBC is just
an API, not a protocol, so I still need a proprietary database vendor's
(or middleware vendor's) network layer such as SQL*Net, don't I? People
have suggested using JDBC but even there (quite apart from the hassle of
calling Java from Perl) you seem to have a choice between:

* requiring vendor specific native code on your client (type 1/2)
* requiring (middleware-) vendor specific java & server code (type 3)
* requiring (dbms-) vendor specific java client code (type 4)

It can't be very difficult to design or implement a simple, *open*
database access protocol that lets you talk ODBC (or JDBC) down a TCP/IP
wire. You would then be able to talk to any database from any platform
and never need to install another driver, but I guess that's too easy. I
don't understand why it hasn't happened, apart from the fact that all
the middleware vendors would go out of business! (Unless it has and I've
missed it? I'd be only too happy if it turns out I'm wrong!)

-Rolf


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

Date: Thu, 21 Jan 1999 17:43:43 +0000
From: Xavier Cousin <cousin@ensam.inra.fr>
Subject: pattern matching (details)
Message-Id: <36A7674F.22B35C56@ensam.inra.fr>

Hello i send earlier the following message but it appears some details
are needed.

*****************
Message :

Hello, i've got a pattern matching trouble in a perl script, here is an
piece of the code dealing with the pattern matching :

open (MUTSUB,tkkkout) or print "cant open tkkkout";
while (<MUTSUB>){
    ($mutation,$reste) = split / /,$_,2;
    if ($kksub{$mutation} !~ /$reste/){
        $kksub{$mutation} .= $reste;
    }
}

here is an example of data found in 'tkkkout' file :
bunfa-acche_M70Y+K285D
<TR><TH><PRE>Acetylthiocholine</TH><TD><PRE>95.3&nbsp;&&nbsp;5.9&nbsp;uM</TD><TD><PRE>-</TD><TD><PRE>
T25C IS 50 mM phosphate</TD><TD><PRE><A
href=/chol.cgi-bin/webace?db=achedb&class=Paper&object=
Cousin_1996_J.Biol.Chem_271_15099>
Cousin_1996_J.Biol.Chem_271_15099</A></TD></TR>

*****************
Details :
In the input file 'tkkkout' i can have this kind of lines (simplified):


bunfa-acche_M70Y+K285D description
bunfa-acche_M70Y+K285D other_description
bunfa-acche_M70Y+K285D description

 ...

I want only one element of each kind :
bunfa-acche_M70Y+K285D description
bunfa-acche_M70Y+K285D other_description

What i don't understand is that using the above scripts i i don't
suppress doublets, i have :

bunfa-acche_M70Y+K285D description
bunfa-acche_M70Y+K285D other_description
bunfa-acche_M70Y+K285D description

description is a long line ending with a \n and $kksub{$mutation}
contained several of these elements -> has several lines. May be is this
the problem.


Xavier
-- 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Xavier Cousin                     cousin@ensam.inra.fr

    INRA - DCC                        tel. (33) 04 99 61 28 14
    2, place Pierre Viala             fax  (33) 04 67 54 56 94
    34060 Montpellier Cedex 1

    ESTHER URL http://www.ensam.inra.fr/cholinesterase/


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

Date: Thu, 21 Jan 1999 17:01:57 +0100
From: Stefan Nonneman <stefan.nonneman@cec.be>
Subject: Problems installing the Time::HiRes module !!!
Message-Id: <36A74F45.517CD415@cec.be>

Dear All,

Some time ago this newsgroups pointed me to a high-resolution timer
module.
I downloaded this module and I tried to install it.

Everything was OK up to the "dmake" command.
During the execution of this command I got an error message I
interpreted as that the script looked for bcc32 and couldn't find it. If
bcc32 is the Borland 32-bit C-compiler then it is normal because I never
installed it.

Can I find anywhere a pre-compiled version of the Time::HiRes module for
Windows NT 4.0 ????

I would be very grateful for any suggestion!!!

Thanks,

Stefan



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

Date: 21 Jan 1999 16:52:03 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: Problems installing the Time::HiRes module !!!
Message-Id: <slrn7aenbo.p21.randy@theory.uwinnipeg.ca>

On Thu, 21 Jan 1999 17:01:57 +0100, 
	Stefan Nonneman <stefan.nonneman@cec.be> wrote:
>Some time ago this newsgroups pointed me to a high-resolution timer
>module. I downloaded this module and I tried to install it.
>Everything was OK up to the "dmake" command.
>During the execution of this command I got an error message I
>interpreted as that the script looked for bcc32 and couldn't find it. If
>bcc32 is the Borland 32-bit C-compiler then it is normal because I never
>installed it.
>Can I find anywhere a pre-compiled version of the Time::HiRes module for
>Windows NT 4.0 ????

Hi,
   That's true that you need a C compiler, either Borland or
VC++, to build this package. If you're using the ActiveState 
perl binary, there's a list of modules that they make available 
through their Perl package Manager (ppm) at
	http://www.activestate.com/packages/zips/
However, the Time-HiRes package isn't among them. I'm not sure
how receptive ActiveState is to requests for packages - perhaps
if enough people asked, they would supply a particular module.

-- 
		Best regards,
		Randy Kobes

Physics Department		Phone: 	   (204) 786-9399
University of Winnipeg		Fax: 	   (204) 774-4134
Winnipeg, Manitoba R3B 2E9	e-mail:	   randy@theory.uwinnipeg.ca
Canada				http://theory.uwinnipeg.ca/


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

Date: Thu, 21 Jan 1999 07:44:36 -0800
From: Neil Jones <njones@firstquadrant.com>
Subject: Re: Script for Alpha Pager Notification
Message-Id: <36A74B63.2DBDAE2A@firstquadrant.com>

LWP.pm would be more appropriate.

Assuming that you submit a URL to a web server and it pages based on the URL,

you would probably want:
$url = "http://<etc>/PIN=$PINo&<etc>";
Then use LWP to request the URL.

 ..Neil


>
> $appath = "D:\\Program Files\\Plus!\\Microsoft Internet\\IEXPLORE.EXE";
> $webpath = "http://www.mobilecomm.com/cgi-bin/wwwpage.exe";

> open (APAGE,"| $appath $webpath");
>

What in sam hill is that??  It's pretty much unheard of for a windows
application
to read from stdin, especially one built my microsoft.





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

Date: Thu, 21 Jan 1999 11:00:55 -0600
From: rnimz@onramp.net (Richard Nimz)
Subject: Re: Script for Alpha Pager Notification
Message-Id: <MPG.1111193faf42f42e989681@news.onramp.net>

In article <MPG.1110fc947763aa13989680@news.onramp.net>, rnimz@onramp.net 
says...
> I suspect I'm hung up on a syntactical problem - I tend to use perl in 
> bursts, so I don't keep very sharp on syntax.
>	....

Two things I neglected to mention in the preceding post:

1. I'm running this in a PC environment, specifically on NT 4.0 - both 
workstation and server;
2. The point at which it chokes it the open command.  The message that 
comes back is:

	The name specified is not recognized as an internal or external 
command, operable program or batch file.

Thanks again,

Richard Nimz
rnimz@onramp.net



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

Date: Thu, 21 Jan 1999 11:49:52 -0500 (EST)
From: KernelKlink@webtv.net
Subject: Re: Seeking a Book on (MS) SQL w/ perl
Message-Id: <19134-36A75AB0-8@newsd-101.iap.bryant.webtv.net>

Naba Barkakati, author of "Discover Perl 5" is coming out with a book on
Perl w/ Databases. You can read his online interview at
http://www.talkcity.com/idgbooks/trans/discoverperl5.html



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

Date: 21 Jan 1999 17:45:08 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Simple CGI with Perl
Message-Id: <83n23c8tij.fsf@vcpc.univie.ac.at>

Re: Simple CGI with Perl, Chris
<C.N.Yeates@cs.cf.ac.uk> said:

Chris> I am just embarking on a project to produce
Chris> web pages with multiple choice tests at the
Chris> end of each section. Does anybody know how I
Chris> can write a CGI script to mark the tests and
Chris> prevent access to the next section to those
Chris> failing to achieve a high enough mark. ie 8
Chris> out of 10.

The Subject line looked promising, but there's
nothing here to do with perl is there?

-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Thu, 21 Jan 1999 11:19:05 -0600
From: "d.k. henderson" <javaprogrammer@Mindspring.com>
Subject: Re: Simple CGI with Perl
Message-Id: <787nkj$som$1@camel21.mindspring.com>

Its called a fork :), you have one group of users go to the unsuccessful
html and another group go to the successful html.






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

Date: Thu, 21 Jan 1999 08:12:50 -0800
From: Michael Peppler <mpeppler@mbay.net>
Subject: Re: Sybase module for perl from CPAN
Message-Id: <36A75202.2943B982@mbay.net>

"Christian M. Aranda" wrote:
> 
> Folks -
> 
> I'm looking for the Sybase module for perl on CPAN but can't seem to
> come up with it.

It's in CPAN/authors/Michael_Peppler/

> 
> I don't use CPAN as much as I should, and hence don't know how to find
> such things on CPAN.

If you go to http://www.perl.com/CPAN/modules/00modlist.long.html you will 
find what you need when you need it...

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@mbay.net       -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com


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

Date: Thu, 21 Jan 1999 16:47:24 GMT
From: tumppi@icon.fi (Tuomas Angervuori)
Subject: Y2K?
Message-Id: <Un3NuHgI1diW-pn2-YtK140duKMbY@atte.dyn.icon.fi>

I have a script which compares two dates.
-Clip-
    ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = 
localtime(time);
#if current date is newer than the one mared in data files, update...
        if (($year == $year_data) and ($mon >= $mon_data)) {
            if ($mday > $mday_data) {
                &update;
            }
        }
        if ($year > $year_data) {
            &update;
        }
-Clip-

$year_data, etc, are found from the data files.

As you might have noticed, this isn't year 2000 compatible. The 
question is, how can I make year 2000 compatible date comparisition? 
I'm sure there is a much better way to do this but this was all I 
managed to do with my current programming skills.

Thanks in advance,

	-Tumppi


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

Date: 21 Jan 1999 17:20:53 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: Y2K?
Message-Id: <916939250.95553@elaine.drink.com>

[alt.perl removed, as it doesn't exist]
In article <Un3NuHgI1diW-pn2-YtK140duKMbY@atte.dyn.icon.fi>,
Tuomas Angervuori <tumppi@icon.fi> wrote:
>I have a script which compares two dates.
>-Clip-
>    ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = 
>localtime(time);
>#if current date is newer than the one mared in data files, update...
$year += 1900;

#Line x goes here.
>        if (($year == $year_data) and ($mon >= $mon_data)) {
>            if ($mday > $mday_data) {
>                &update;
>            }
>        }
>        if ($year > $year_data) {
>            &update;
>        }
>-Clip-
>
>$year_data, etc, are found from the data files.


Line x really depends on the format in your data files.

If they currently contain '99' and will contain '100' next year,
then you want

$year_data += 1900;


If they currently contain '99' and will contain '00' next year, then
you want something like

if($year_data < 37 ) {
	$year_data += 2000;
} else {
	$year_data += 1900;
}

Of course, the year 37 is up to you.

If they currently contain '1999' and will contain '2000' next year, then
no change to $year_data is required.

Howerver, even when you fix that, you still have a bug.  If today is
April 10, and your data file contains March 19, then update() will not
be called. Is that what you want? I don't think it is.

You should look at one of the Date:: Modules, eg Date::Manip, in
order to get a unified date structure which you can compare in one
if() statement.


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4711
**************************************

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