[13454] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 864 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 21 10:08:16 1999

Date: Tue, 21 Sep 1999 07:05:13 -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: <937922713-v9-i864@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 21 Sep 1999     Volume: 9 Number: 864

Today's topics:
    Re:  How to capture STDERR from the perl binary (Ben Franklin VI)
        Accessing SCSI-Devices from Perl? (Stephan Budach)
    Re: Accessing SCSI-Devices from Perl? <gellyfish@gellyfish.com>
    Re: answers (Greg Bacon)
        Attachment with sendmail in cgi-script <wiwa@sbox.tu-graz.ac.at>
    Re: Attachment with sendmail in cgi-script <gellyfish@gellyfish.com>
    Re: Case insensitive SQL query (Mark W. Schumann)
        cgi servers <biadeNOopSPAM@hotmail.com>
    Re: Combining variables - newbie <Allan@due.net>
        Fork / Pipe Problem <fhusmann@gmt.nl>
    Re: how can I use perl to convert each paragraph to one <mike@crusaders.no>
    Re: how can I use perl to convert each paragraph to one (Abigail)
    Re: How to get the underlying thingy <rhomberg@ife.ee.ethz.ch>
    Re: I could use perldoc perlipctut (Norman Gaywood)
    Re: I don't want to extract data from an HTML page. (Matthew Bafford)
    Re: I don't want to extract data from an HTML page. <rhomberg@ife.ee.ethz.ch>
        intermittent probs with www.perl.com <mark@artdigital.co.uk>
        newbie (2) : form to html (H.P. Stroebel)
    Re: Perl : Excel OLE Automation <mattking@techie.com>
    Re: Perl and Win32 API <jbtech@mpinet.net>
    Re: Perl and WIN32 GUI <jbtech@mpinet.net>
        Perl Programming Position Available (Brendan McKenna)
        Problem with LWP::UserAgent <sspringett@cwe2.com>
    Re: range of array indexes <picaza@chsi.com>
        Replacer Script Question robblake@my-deja.com
    Re: s///  conditional substitution <picaza@chsi.com>
    Re: s///  conditional substitution <picaza@chsi.com>
    Re: slip dialer in perl? <blazer@mail.nevalink.ru>
    Re: Stock quote URL strings <vwilding@digizen.net>
        String Splitting <o.cook@etoncollege.org.uk>
        Thank you <tech@tburg.net>
    Re: Thank you (Matthew Bafford)
    Re: Web Mail (Abigail)
    Re: Web Mail <madebeer@igc.apc.org>
    Re: Which are the best books for learning Perl for use  <camerond@mail.uca.edu>
        Which are the best books for learning Perl for use in a <NoSpam@NoSpam.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 21 Sep 1999 10:11:32 GMT
From: f8anklin@aol.com (Ben Franklin VI)
Subject: Re:  How to capture STDERR from the perl binary
Message-Id: <19990921061132.03112.00000580@ng-fz1.aol.com>


I have the following simple program called test.pl
#!/usr/local/bin/per  while(1) {       sleep(10);

Ploink, ploink,  tossed away, bye bye ranmondj

Note the cancellations below and the temper and mouth of raymondj

From:         raymondj@NOSPAM.raleigh.ibm.com   1999/09/14
Message-ID:   <37de7e0d.762265@mdnews.btv.ibm.com>

Raymond writes :
              Go Fuck yourself ASSHOLE!

Ben quotes:
All wrong recoils upon the doer, and the man who makes wrong statements about
others is himself to be pitied, not the man he vilifies.  ELBERT HUBBARD, The
Roycroft Dictionary and Book of Epigrams.  1923

Ploink, ploink, ploink  bye bye raymondj
How long will it be until raymondj's hot head and filthy mouth gets him tosed?


Subject:      cmsg cancel <37e86633.9962171@mdnews.btv.ibm.com>
From:         raymondj@NOSPAM.raleigh.ibm.com
Date:         1999/09/20
Message-ID:   <72d30231.3753533@mdnews.btv.ibm.com>
Newsgroups:   rec.autos.makers.saturn 
[More Headers]
This message was cancelled from within Mozilla.
=================================
Subject:      cmsg cancel <37e743b1.1128562@mdnews.btv.ibm.com>
From:         raymondj@NOSPAM.raleigh.ibm.com
Date:         1999/09/20
Message-ID:   <08c726d6.4280205@mdnews.btv.ibm.com>
Newsgroups:   rec.autos.makers.saturn 
[More Headers]
This is cancel message.
==========================
Subject:      cmsg cancel <37e641c0.631406@mdnews.btv.ibm.com>
From:         raymondj@NOSPAM.raleigh.ibm.com
Date:         1999/09/20
Message-ID:   <68a652e0.020430@mdnews.btv.ibm.com>
Newsgroups:   rec.autos.makers.saturn 
[More Headers]
This is cancel message.
========================================
cmsg cancel <37e86633.9962171@mdnews.btv.ibm.com>
cmsg cancel <37e743b1.1128562@mdnews.btv.ibm.com>
cmsg cancel <37e641c0.631406@mdnews.btv.ibm.com>

<72d30231.3753533@mdnews.btv.ibm.com>
<08c726d6.4280205@mdnews.btv.ibm.com>
<68a652e0.020430@mdnews.btv.ibm.com>





Subject:      How to capture STDERR from the perl binary
From:         raymondj@NOSPAM.raleigh.ibm.com
Date:         1999/09/09
Message-ID:   <37e21846.20182328@mdnews.btv.ibm.com>
Newsgroups:   comp.lang.perl.misc 
[More Headers]
I have the following simple program called test.pl

#!/usr/local/bin/perl

while(1) {
    sleep(10);
}



If I run this from the prompt using the following command:

test.pl >out 2>&1

and then I issue a sigkill via kill -9 (pid of the perl process) I get
a text message of "Killed" from the perl binary but I want to capture
this text in the file "out" as described above.

Seondly, how can the perl binary catch the sigkill interrupt in order
to print the "Killed" message in the first place?

Thanks for your help.

 .
 .
"He that falls in love with himself will have no rivals." 
(Franklin 1706-1790)

My way or the Highway!   --- Ben ---


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

Date: Tue, 21 Sep 1999 15:17:20 +0200
From: stephan.budach@knsk-bbdo.de (Stephan Budach)
Subject: Accessing SCSI-Devices from Perl?
Message-Id: <stephan.budach-2109991517200001@budach-stephan.intern.knsk-bbdo.de>

Hi,

i know, it sounds a bit weird, but has anyone successfully accessed a
SCSI-Device from within Perl? I guess, this is going to be a hard one for
me.

Stephan Budach


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

Date: 21 Sep 1999 14:40:40 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Accessing SCSI-Devices from Perl?
Message-Id: <37e78ad8_2@newsread3.dircon.co.uk>

Stephan Budach <stephan.budach@knsk-bbdo.de> wrote:
> Hi,
> 
> i know, it sounds a bit weird, but has anyone successfully accessed a
> SCSI-Device from within Perl? I guess, this is going to be a hard one for
> me.
> 

Er, yes otherwise open() wouldnt work on a machine with SCSI disks ...

/J\
-- 
"Pat was wondering if he could put his massive tool in my box" - Mrs
Doyle, Father Ted


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

Date: 21 Sep 1999 13:45:29 GMT
From: gbacon@ruby.itsc.uah.edu (Greg Bacon)
Subject: Re: answers
Message-Id: <7s825p$raa$1@info2.uah.edu>

In article <37e6d543@derwent.nt.tas.gov.au>,
	"Andrew" <casino@start.com.au> writes:

: love the way people say...
: 'not a perl question'
: or
: 'read some doco'
: 
: is this because you are so arrogant or just don't know?

Hmmm...

    Newsgroups: sci.med
    From: gbacon@cs.uah.edu
    Subject: answers

    You people are so unhelpful.  I just want to earn an honest living
    by performing a few cosmetic surgeries on the side, but you're such
    a bunch of elitists.  You just don't want me to break into your
    Inner Circle.  "Go to med school", you say.  "What medical training
    do you have?", you ask.

    Why won't anyone give me a decent answer?  Is it because you're so
    arrogant or because you just don't know?

Get a fucking clue, but, please, find somewhere else to do it.

Greg
-- 
A lot of people mistake a short memory for a clear conscience. 
    -- Doug Larson


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

Date: Tue, 21 Sep 1999 13:40:56 +0200
From: "Walter Winter" <wiwa@sbox.tu-graz.ac.at>
Subject: Attachment with sendmail in cgi-script
Message-Id: <7s7qpl$su8@fstgal00.tu-graz.ac.at>

Hi there,
I want send a file via e-mail (sendmail) with an Cgi-perl script
I have this pice of script

my($mailprog) = "/usr/bin/sendmail";
open (MAIL,"|$mailprog -t");
print MAIL "To:my\@here.net\n";
print MAIL "From: To:your\@there.net\n";
print MAIL "Subject: karl \n\n";

Does anyone know how to attach a file within this script
Thank´s
walter
mailto:winter@dayside.net
--
 Walter Winter





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

Date: 21 Sep 1999 13:39:43 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Attachment with sendmail in cgi-script
Message-Id: <37e77c8f_2@newsread3.dircon.co.uk>

Walter Winter <wiwa@sbox.tu-graz.ac.at> wrote:
> Hi there,
> I want send a file via e-mail (sendmail) with an Cgi-perl script
> I have this pice of script
> 
> my($mailprog) = "/usr/bin/sendmail";
> open (MAIL,"|$mailprog -t");
> print MAIL "To:my\@here.net\n";
> print MAIL "From: To:your\@there.net\n";
> print MAIL "Subject: karl \n\n";
> 

Yes but I think that you want to use the module MIME::Lite available
from CPAN ...

/J\
-- 
"Over the years I've always had Max Factor in my box" - Tina Earnshaw,
Chief Make-Up Artist, Titanic


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

Date: 21 Sep 1999 09:19:29 -0400
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Case insensitive SQL query
Message-Id: <7s80l1$25@junior.apk.net>

In article <7s6afm$52p$1@nnrp1.deja.com>,  <mrbog@my-deja.com> wrote:
>No, the goal isn't to solve people's perl problems, it's to solve their
>problems!

No, it's to help people solve their own Perl problems.

At this it performs amazingly well considering the obstacles that
people like you insist on providing.



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

Date: Tue, 21 Sep 1999 03:53:53 -0700
From: nath <biadeNOopSPAM@hotmail.com>
Subject: cgi servers
Message-Id: <20c2f050.e04e8640@usw-ex0102-014.remarq.com>

what does common gate way interface do ?

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Tue, 21 Sep 1999 09:30:33 -0400
From: "Allan M. Due" <Allan@due.net>
Subject: Re: Combining variables - newbie
Message-Id: <7s81fc$njd$1@nntp2.atl.mindspring.net>

Uri Guttman wrote in message ...
:>>>>> "GWB" == Graham W Boyes <me@toao.net> writes:
:
:  GWB> I have two variables, $var1 and $var2 which I'd like to combine
:  GWB> into a single variable $var3 with a space in between.
:  GWB> I grant that sounds really, REALLY stupid.
:
:yes. have you even read ANY docs or books on perl? this is too
:fundamental to be just given a plain answer.
:
:there are probably a zillion ways to do it. here are some dumber ones:
[snip]
:i leave it as an exercise for the group to find more dumb ways. lets
see
:how many we can come up with. the dumber the better.

$var3 = "$var1 a space $var2";

AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--random quote --
Empiricism is dead, it seems...
 - Sean McAfee (responding in cplm to a classic what would happen if...
question)





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

Date: Tue, 21 Sep 1999 15:26:18 +0200
From: Frank Husmann <fhusmann@gmt.nl>
Subject: Fork / Pipe Problem
Message-Id: <37E7877A.F7E1B099@IHATESPAM.gmt.nl>

Hello,

I am writing a program that searches a directory and searches a
database. The searching is no problem but i want to do it paralel using
fork instead of doing it sequentially.
I use the following code but I think something is wrong in the frame
work. Can anyone help me?

Frank

#!/usr/bin/perl -w

use Socket;
use IO::Handle;     

CHILD->autoflush(1);
PARENT->autoflush(1);

sub startChild($)
{
	socketpair(CHILD, PARENT, AF_UNIX, SOCK_STREAM, PF_UNSPEC)
                        or  die "socketpair: $!";

	$pid=fork();
	if ($pid) {
		# this is the parent process that only initiates all childs
		return $pid;
	} else {
		# this is the child process which will search the site for me
		die "cannot fork: $!" unless defined $pid;
		if ($i == 0) {
			#Will be search function 0
			print PARENT "Child $i Pid $$ is sending ZERO!\n";
		}
		else {
			#Will be search the other function 
			print PARENT "Child $i Pid $$ is sending NOT ZERO\n";
		}
		exit;
	}
}


for ($i=0;$i<=1;$i++)
{
  # MAIN
  	$child=startChild $i;
  	print ($i." ".$child."\n");
  	$pidChild[$i] = $child;
}

#Here I want to read everything that has been send to the parent in a
loop to collect all data
chomp($line = <CHILD>);
print "Parent Pid $$ just read this: '$line'\n";


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

Date: Tue, 21 Sep 1999 12:44:31 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: how can I use perl to convert each paragraph to one long sentence?
Message-Id: <SkJF3.1379$1s6.19221@news1.online.no>


Dan and/or Shelly <wedeking@msa.attmil.ne.jp> wrote in message
news:7s7kdu$73r$1@news.misawa.attmil.ne.jp...
> I want to convert the paragraphs in a file which are separated by
blank
> lines into
> one long line for each paragraph by removing the newline characters
from the
> ends of

This will do the trick:
 perl -i -pe 'BEGIN{$/=""};chomp;s/\n/ /g;s/$/\n/;' filename

if you don't want to modify the original file, just remove the -i
switch.
 perl -pe 'BEGIN{$/=""};chomp;s/\n/ /g;s/$/\n/;' filename > outfile

> I'll have to use win32 perl and not the unix perl because my computer
> doesn't have
> regular perl and my boss won't let me install it.  They don't like
people
> putting non-y2k
> programs on the computers at work.

Does your boss have pointy hair?

--
Trond Michelsen




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

Date: 21 Sep 1999 05:49:57 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: how can I use perl to convert each paragraph to one long sentence?
Message-Id: <slrn7ueorf.bj0.abigail@alexandra.delanet.com>

Dan and/or Shelly (wedeking@msa.attmil.ne.jp) wrote on MMCCXII September
MCMXCIII in <URL:news:7s7kdu$73r$1@news.misawa.attmil.ne.jp>:
 .. I want to convert the paragraphs in a file which are separated by blank
 .. lines into
 .. one long line for each paragraph by removing the newline characters from the
 .. ends of
 .. the lines.

Your newsreader inserts random newlines. Please fix that.

perl -00 -wlpe 's/\n//g' infile > outfile

 .. I'll have to use win32 perl and not the unix perl because my computer
 .. doesn't have
 .. regular perl and my boss won't let me install it.  They don't like people
 .. putting non-y2k
 .. programs on the computers at work.


Well, I can imagine that someone thinks Perl contains y2k bugs (it doesn't
though) but why on earth would they think those bugs aren't present in
the windows variant?



Abigail
-- 
perl  -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
          for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
          print chr 0x$& and q
          qq}*excess********}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 21 Sep 1999 14:56:35 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: How to get the underlying thingy
Message-Id: <37E78083.660573DF@ife.ee.ethz.ch>

Kragen Sitaker wrote:
> 
> In article <37E6DC18.1337AB05@amd.com>, Stacy Doss  <stacy.doss@amd.com> wrote:
> >       if ($r =~ /(HASH|ARRAY|CODE|REF|GLOB|SCALAR)/)) {
> >               print "reference is built-in $r\n";
> 
> FWIW, this breaks the first time someone defines a class called HASHmaker.

How about calling a class HASH??
perl -Mstrict -wle '$_ = bless [],"HASH";print $_->isa("HASH"), " ",
$_->isa("ARRAY")'
1 1
$_ is both an ARRAY and a HASH
maybe the use of one of the predefined ref names should give a warning
under -w

- Alex


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

Date: 21 Sep 1999 21:54:35 +1000
From: norm@turing.une.edu.au (Norman Gaywood)
Subject: Re: I could use perldoc perlipctut
Message-Id: <7s7rlr$is0@turing.une.edu.au>

moseley@best.com (Bill Moseley) writes:

>1) Could someone give an example on how to spawn off a few children, 
>wait for them to all finish and collect all the data back?  I'm unclear 
>on how to manage a bunch of kids all at once.  The goal is to split up 
>some work.

tchrist@mox.perl.com sent you a very nice program to do something like
this. I am in the process of writing something like this also.
Following is the shell of my version of a solution. As you can see, it
is intended to be a script for dumping multiple filesytems to multiple
tape drives.  This is development code, so beware.


#!/usr/bin/perl -w

use strict;

my @filesys   = qw( fs1 fs2 fs3 fs4 fs5 fs6 fs7 );
my @freetapes = qw( td1 td2 td3 );
my %usedtapes = ();
my $waitpid;
my $pid;

while (@filesys || %usedtapes){
  if (@freetapes && @filesys){
    defined($pid = fork) || die "Can't fork ($!)\n";
    if ($pid){
      shift @filesys;
      $usedtapes{$pid} = shift @freetapes;
    } else {
      dumper( $freetapes[0], $filesys[0] );
      exit 0;
    }
  } else {
    $waitpid = wait;
    defined $usedtapes{$waitpid} || die "Unknown pid $waitpid\n";
    push @freetapes, delete $usedtapes{$waitpid};
  }
}

sub dumper{
  printf "Tape %s has filesystem %s (%d sec)\n", @_[0..1], sleep rand 4;
}

-- 
Norman Gaywood -- School of Mathematical and Computer Sciences
University of New England, Armidale, NSW 2351, Australia
norm@turing.une.edu.au     http://turing.une.edu.au/~norm
Phone: +61 2 6773 2412     Fax: +61 2 6773 3312


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

Date: Tue, 21 Sep 1999 11:40:56 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: I don't want to extract data from an HTML page.
Message-Id: <slrn7uepl3.at2.*@dragons.duesouth.net>

Jody:
: I would like to use "real html" files as templates.  Would like to know
: [snip]

Since your specification was fairly vague, I'll just have to guess.

Here's what I use for a rather large tree of html files I manage:

    #!/usr/bin/perl -w
    use strict;
    
    my $body = '/body_base.html';
    
    my $data;
    my %fields;
    my $field;
    
    open DATA, $ARGV[0] or die "open($ARGV[0]): $!\n";
    
    while(<DATA>) {
        if ( /^=(\w+)\s*(.+)?\s*$/ ) {
            $fields{$field = lc $1}  = $2;
        } else {
            $fields{$field        } .= $_;
        }
    }
    
    open BODY, $body or die "open($body): $!\n";
    
    while(<BODY>) {
        s/<!--#([^#]+)#-->/$fields{lc $1} || ""/eg;
        print;
    }

I don't claim it's bug free, efficient, or even safe.  I've been using it
for quite a while now and have had no problems, but YMMV.

: Jody

--Matthew


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

Date: Tue, 21 Sep 1999 15:13:20 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: I don't want to extract data from an HTML page.
Message-Id: <37E78470.7926C520@ife.ee.ethz.ch>

[courtesy cc sent]

Jody Fedor wrote:
> 
> After searching Deja for an hour I beg a bone from the masters:
> 
> I would like to use "real html" files as templates.  Would like to know
> if anyone has a collection of regexes that might process the html
> file to be able to print it via the slurp the $html variable style. ie:
> 
> open (TEMPLATE, "inkjet.htm") || die "Can't open inkjet.htm:  $!";
> while (<TEMPLATE>) {$html .= $_}
> close(TEMPLATE) || die "Can't close inkjet.htm: $!";
> 
>  $HTML =~ s/***/***/g;  #<--  Some super fancy regexes here.

Here is the template replacer I used in my CGI scripts.
It works like this: write a plain HTML template with placeholders:
The template can be written in any good HTML composer (e.g. emacs, vi)

<HTML>
some...html
PLACE_TABLE_HERE
some..more..html
</HTML>

then call the sub:

substtmpl( TMPL_FILE => template.html,
	   PLACE_TABLE_HERE=>$generated_table,
	   ANOTHER_PLACEHOLDER => $some_more_text);

Make sure that the placeholder only appears where you want it replaced.

the sub that worked fine for me: (better error handling needed)

sub substtmpl {
  my %repl = @_;
  local $/;
  undef $/;
  open(TEMPLATE, $repl{'TMPL_FILE'}) or die "ouch $!";
  $_ = <TEMPLATE>;
  delete $repl{'TMPL_FILE'};
  while (($key, $subst) = each(%repl)) {
    s/$key/$subst/g;
  }
  print;
  close(TEMPLATE);
}

HTH
- Alex


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

Date: Tue, 21 Sep 1999 15:00:05 +0100
From: "Mark Hamlin" <mark@artdigital.co.uk>
Subject: intermittent probs with www.perl.com
Message-Id: <7s831m$44v$1@pheidippides.axion.bt.co.uk>

Has anyone notices intermittent problems with these sites?  Is the problem
local?

http://www.perl.com - 208.201.239.50
http://language.perl.com/   -    208.201.239.50

http://www.w3j.com/     -    208.201.239.44 (I'm told this was discontinued
and may have been shut down.

+ does anyone know if & where the ppt project is mirrored?

Mark Hamlin






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

Date: Tue, 21 Sep 1999 13:00:33 GMT
From: hpstr@operamail.com (H.P. Stroebel)
Subject: newbie (2) : form to html
Message-Id: <1103_937922980@default>

hi again !

is there a script that can to write the user`s html form input into a html
file (the name of which is one variable of the form) in a defined directory ?

(to create a simple static homepage for users that want one, based on the
data they entered in the form)

thank you

regards

h.p. stroebel
hpstr@operamail.com


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

Date: Tue, 21 Sep 1999 14:42:07 +0200
From: "Matt King" <mattking@techie.com>
Subject: Re: Perl : Excel OLE Automation
Message-Id: <7s7sfh$8qa$1@news.uk.ibm.com>

No luck, I get the following error on three different PC's:
Died at test2.pl line 6.

Do I have to install Excel on the PC running the script? Does the OS matter?
(The OS is 98).

(This is mainly for info).
With the other other script, the PC with Excel had this error:
Undefined subroutine &Win32::OLECreateObject called at
D:/web/banking/perl/lib/OLE.pm line 104.

And the PC without Excel (97) had:
Can't call method "Workbooks" on unblessed reference at test.pl line 16.

Matt
pjd <duraipPLEEASE__REMOVE_THIIS@extendsys.com> wrote in message
news:7s6n5j$fk7
> ## Start
>
> use Win32::OLE;
>
> $xlfile ="c:\\tmp\\book1.xls";
>
> # Create OLE object - Excel Application Pointer
> $xl_app = Win32::OLE->new('Excel.Application') or  die $!;
>
> # Set Application Visibility
> # 0 = Not Visible
> # 1 = Visible
> $xl_app->{'Visible'} = 0;
>
> # Open Excel File
> $workbook = $xl_app->Workbooks->Open($xlfile);
>
> # setup active worksheet
> $worksheet = $workbook->Worksheets(1);
>
> # retrieve value from worksheet
> $cellA1 = $worksheet->Range("A1")->{'Value'};
> $cellB1 = $worksheet->Range("B1")->{'Value'};
>
> print $cellA1 , "\n";
> print $cellB1 , "\n";
>
> # Close It Up
> $xl_app->ActiveWorkbook->Close(0);
> $xl_app->Quit();
>
> ## End
>
> Hope that helps
> pj





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

Date: Tue, 21 Sep 1999 06:26:20 -0400
From: "Jon Banquer" <jbtech@mpinet.net>
Subject: Re: Perl and Win32 API
Message-Id: <ruen823plg786@corp.supernews.com>

What is Activestate distribution ?

jon






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

Date: Tue, 21 Sep 1999 06:22:40 -0400
From: "Jon Banquer" <jbtech@mpinet.net>
Subject: Re: Perl and WIN32 GUI
Message-Id: <ruen7vdrlg737@corp.supernews.com>

>I am trying to find out if there is sufficient interest in this stuff before
>contributing it and this depends on how many people use, or would like to
>use, perl as a tool in Windows programming.

I might be, if an easy tool for interfacing with the Windows API was
available and if the documentation was Laura Lemay like.

jon






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

Date: 21 Sep 1999 11:17:20 GMT
From: brendan@brendan.w3s.ie (Brendan McKenna)
Subject: Perl Programming Position Available
Message-Id: <7s7pg1$7ea$1@ezekiel.eunet.ie>

Hi,

	I appologise if this post is inappropriate for this newsgroup, however
we have one, possibly two programming positions open here.  We'd require someone
with Perl experience, as well as experience in C or C++ and databases
(particularly PostgreSQL, Sybase/MS SQL-Server, and Oracle -- or some combination
thereof).  Positions would also require previous CGI programming experience.  The
environment is Linux/Solaris, the salary is commensurate with experience.

	Please email a CV and some code samples to me.


						Thanks,
						Brendan

-- 
Brendan McKenna	
Technical Director			Phone: +353-(0)61-338177 x4143
W3 Services Ltd.			  Fax: +353-(0)61-338065
Innovation Centre			Email: brendan@w3s.ie
National Technological Park
Limerick
Ireland


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

Date: Tue, 21 Sep 1999 07:36:19 -0500
From: "Steve Springett" <sspringett@cwe2.com>
Subject: Problem with LWP::UserAgent
Message-Id: <7s7tua$tc3$1@nntp2.atl.mindspring.net>

I'm composing a script on a SSL enabled web server which looks to remote web
servers (non encrypted) to retrieve various images.  The images are randomly
created each time the page is accessed.

The types of information I'm trying to provide is maps and graphical weather
forcasts on our Intranet.

The problem is this.  Every time the script is run, it returns a
'Internal-Icon-Insecure'  message to the browser and does not display the
image.  I'm new to using LWP::UserAgent and attached is a simple script that
does not retrieve the images from a website. Although this same script WILL
retrieve the images if ran from a non-encrypted (port 80) web server.

Any suggestions would be GREATLY appreciated.
-----
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

my $req = HTTP::Request->new(GET => 'http://www.somewhere.com'/');
$req->header(Accept => 'text/html');

# send request to server and get response back
my $res = $ua->request($req);

# check the outcome
if ($res->is_success) {
  print $res->content;  # for instance
} else {
  print "Error: " . $res->status_line . "\n";
}
exit;
-----





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

Date: Tue, 21 Sep 1999 08:20:26 -0400
From: "Peter Icaza" <picaza@chsi.com>
Subject: Re: range of array indexes
Message-Id: <7s7t5b$1rme$1@pike.uhc.com>


yes, yes, yes! thats what i want!  i just knew it had to be there some
place.  i also like the
"Now is the time for all good men to read their documentation very
thoroughly".

i did look at slices.  i got the impression only enumeration of elements
would work. but no, there it is on page 48 of llama.
splice also looks good.

thanks to all,
peter




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

Date: Tue, 21 Sep 1999 12:46:51 GMT
From: robblake@my-deja.com
Subject: Replacer Script Question
Message-Id: <7s7unn$8jm$1@nnrp1.deja.com>

I'm trying to use the replacer script found at
www.greenthing.com/replacer/
Which looks though text files for a string and
replaces it with another.

It works really well apart from I would like it
to go though multiple directories.

Does anyone know how I could modify it, or is
there a script out there that does this already ?

Please respond via email

rob@hotelcalifornia.co.uk


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 21 Sep 1999 07:13:42 -0400
From: "Peter Icaza" <picaza@chsi.com>
Subject: Re: s///  conditional substitution
Message-Id: <7s7p88$19ci$1@pike.uhc.com>


> one uses the . operator to concatenate strings. Just postpending a string
> surrounded by parens is never going to work.

yes the dot is probably what i was looking for, but i need the ()'s in
(_RC$Ctr = '1' $4) in the output.
my question has been answered twice,  once by answering the  original and
next by showing me a better way, (the hash)
data to uri follows...

peter
>





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

Date: Tue, 21 Sep 1999 07:56:32 -0400
From: "Peter Icaza" <picaza@chsi.com>
Subject: Re: s///  conditional substitution
Message-Id: <7s7roh$1sc2$1@pike.uhc.com>

thanks for you help.  this is beyond my request, but i try to always learn a
better way...

when i try /x i get:
Uncaught exception from user code:
                                                                /(.*)
+(in|ex)clude +'?(.*)\b'?\s+(.*)/: regexp *+ operand could be empty at
/app/scripts/ReadPFile.pl line 248.

(which brings up another problem.  my newlines dont seem always to provide
me with a <cr>, mmmm. forget it for now)
aaahhhh!  i changed the (.*) to (.+) and the warning resolves.  i was just
trying to get passed my original concern and i had ignored this.  improved,
(slightly),  regex with comments:
     if ($subsetCriteria[$X] =~  s{(.+)                # whatever starts the
line
                                    \s+(in|ex)clude\s+  # include/exclude
surrounded by 1+ spaces
                                    '?(.+)\b'?          # a filename which
may have tick around it
                                    \s+(.+)             # followed by 1+
spaces and whatever ends the line
                                   }
                                   {$in_exclude{$2}(_RC$Ctr = '1') $4}x)


some input data:
 ...
((((PEBTFST  == '9'  ||
PEBTFST  == '2' ) &&
AGEIND   == 1 ) &&
PEBTFDS  == '6'  &&
SUMPOS   include outp.inc  &&
PRCONE   exclude 'zlab10.inc' ))
 ...


output:
((((PEBTFST  == '9'  ||
PEBTFST  == '2' ) &&
AGEIND   == 1 ) &&
PEBTFDS  == '6'  &&
(_RC1 = '1') &&
(_RC2 = '2')  ))

which later becomes:
((((PEBTFST  == '9'  || PEBTFST  == '2' ) & AGEIND   == 1 ) & PEBTFDS  ==
'6'  & (_RC1 = '1') && ^(_RC2 = '2')  ))
and get presented to sas for processing


i would like to see a better mousetrap.
peter




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

Date: Tue, 21 Sep 1999 17:17:29 +0400
From: Mike Blazer <blazer@mail.nevalink.ru>
To: fheitka@ibm.net
Subject: Re: slip dialer in perl?
Message-Id: <37E78569.21739A2E@mail.nevalink.ru>

fheitka@ibm.net wrote:
> 
> I was wondering if anyone has written a dialer
> script to connect to an ISP (dynamic) using
> say perl and slattach?

If on Win32 - then yes. You can check old Win32::DUN on my site and new 100K Win32::RASE (RAS entry mansgement/dialing) later this month, I hope.
-- 
==================================
Mike Blazer
blazer@mail.nevalink.ru
http://www.dux.ru/guest/fno/perl/
==================================


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

Date: Tue, 21 Sep 1999 13:05:19 GMT
From: Vince Wilding <vwilding@digizen.net>
Subject: Re: Stock quote URL strings
Message-Id: <37E7828F.2B39085C@digizen.net>

I disagree!  I have been looking for just such a goober, to write a
script around

Larry Rosler wrote:
> 
 .
 .
 .
> Why did you bother, when the question is off-topic?
> 
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com

-- 
Vince Wilding, Web Wrangler, MetaData Maven, Perl Hacker Wannabe
USGS/BRD/OBIO   Voice: 703-648-4220  Fax: 703-648-4224
El Jefe di CASA --- http://www.wdn.com/casa
mailto:vince_wilding@usgs.gov  http://biology.usgs.gov/~vwilding/
I'm out of my mind right now, please feel free to leave a message.


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

Date: Tue, 21 Sep 1999 13:51:20 GMT
From: Ollie Cook <o.cook@etoncollege.org.uk>
Subject: String Splitting
Message-Id: <7s82gj$ba4$1@nnrp1.deja.com>

I am trying to write a perl script which will analyse
my /var/log/maillog file, so that I can discover how much traffic each
domain's email is using.

A sample line would be (all on one line):

Sep 21 14:53:19 s108 sendmail[18811]: OAA18811:
from=<user@etoncollege.org.uk>, size=1895, class=0, pri=31895,
nrcpts=1,
msgid=<A76C57705916D211B3400020480E101789C8D9@nts5.school.etoncollege.or
g.uk>, proto=ESMTP, relay=nts5.school.etoncollege.org.uk
[195.195.166.146]

I am having trouble splitting the string up (I don't know where to
start!!). I've read chapter 7, regular expressions, in Learning Perl by
O'Reilly, but I couldn't see how to use it. [isbn: 1-56592-284-0]

I would like to be able to ascertain the 'from' field and the 'size'
field. That's to say I would like to store 'user@etoncollege.org.uk' in
one variable, and '1895' in another variable, for the example above.

Would someone be kind enough to point me in the right direction?

Regards,
Ollie

 ------------------------------
Ollie Cook: these thoughts, no
matter how stupid, are my own!
 ------------------------------


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 21 Sep 1999 08:14:55 -0400
From: "Robert W. Byrd" <tech@tburg.net>
Subject: Thank you
Message-Id: <37E776BF.733E3B6F@tburg.net>

Is this on-topic? Don't know... it is about Perl though...

At the risk of having a herd a camel lovers torch me for using
up bandwidth in their newsgroup, I present the following:

I have been reading this newsgroup for about three weeks now
and have seen all manner of questions, answers, and other
remarks. Some good, some not.

Perl is a remarkable language. The work started by Larry and
continued by rather large handful of others (you know who you
are... I'm not going to list names for fear of forgetting
someone) is somewhat awe inspiring.

The fact there are so many books dealing with Perl is also a
testament to it's fame and popularity (and I have purchased
nearly all of them!)

Very seldom does an end user have the opportunity to communicate
with the people who have worked on and enhanced a language like
we are able to in this newsgroup.

So... to all of you who have contributed not only to perl, but
also to this newsgroup, I offer my thanks. Without you, this place
would be nothing but a slim shadow.

"Kudos to you all!"

Respectfully,

 .rob.

p.s. -- This is a repost, as it would appear that the original
post never got posted. It looks like about 50% of my postings
to this group disappear into the bit bucket.

-- 
Robert W. Byrd | Completely Computer Friendly
tech@tburg.net | 67-B Oxford St., Tillsonburg, ON CA N4G 2G3
------------------------------------------------------------


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

Date: Tue, 21 Sep 1999 13:40:54 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Thank you
Message-Id: <slrn7uf1vi.b71.*@dragons.duesouth.net>

Tue, 21 Sep 1999 08:14:55 -0400, a great smashing of the head occured
against Robert W. Byrd" <tech@tburg.net>'s keyboard, causing
comp.lang.perl.misc to receive this: 
: Respectfully,

42

: p.s. -- This is a repost, as it would appear that the original
: post never got posted. It looks like about 50% of my postings
: to this group disappear into the bit bucket.

I saw the original.

: .rob.

--Matthew


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

Date: 21 Sep 1999 05:11:58 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Web Mail
Message-Id: <slrn7uemk8.bj0.abigail@alexandra.delanet.com>

Jason Petrillo (jasonp@yta.attmil.ne.jp) wrote on MMCCXII September
MCMXCIII in <URL:news:7s6rhq$94k$1@news.yokota.attmil.ne.jp>:
__ Anyone out there have a suggestion for setting up Web Mail with Perl.

I would buy some books about managing mail. No, wait. I would hire some
people who know what they are doing.

__                                                                        This
__ would be from an existing customer base.


Oh. Does that make a difference?



Abigail
-- 
package Z;use overload'""'=>sub{$b++?Hacker:Another};
sub TIESCALAR{bless\my$y=>Z}sub FETCH{$a++?Perl:Just}
$,=$";my$x=tie+my$y=>Z;print$y,$x,$y,$x,"\n";#Abigail


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 21 Sep 1999 00:31:01 -0700 (PDT)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: Web Mail
Message-Id: <APC&1'0'50775db6'7c1@igc.apc.org>

Look in http://www.freshmeat.net/appindex/web/applications.html

-Mike



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

Date: Tue, 21 Sep 1999 08:35:50 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: Which are the best books for learning Perl for use in a Web  environment?
Message-Id: <37E789B6.DB0D81AC@mail.uca.edu>

Paul wrote:
> 
> Hi,
> 
> I wish to learn Perl for use in a Web environment.  The following books
> seem to come recommended by many people are they relevant for Web
> programming?
> 
> Learning Perl, Programming Perl, Perl Cookbook

Your headers imply that you use Windows, so I would suggest the
following in this order:

Learning Perl on Win32 Systems (an adaptation of Learning Perl)

The Official Guide to CGI.pm

Perl Cookbook

-> Important! Don't start one until you have finished (or almost
finished) the previous one. <-

And, if you are going to go heavily into web stuff, you might want to
look into:

Web Design in a Nutshell

Information Architecture for the World Wide Web

All of the aforementioned books are published by O'Reilly, except "The
Official Guide..." which is published by Wiley. You might note a subtle
pattern here. Not to say that there aren't other good books out there,
but always look in one of these two places:

1.	Books published by O'Reilly.

2.	Books authored by (or recommended by) a frequent poster on the
c.l.p.* newsgroups or one of the ActiveState mailing lists - NB: I mean
a frequent (and correct) *answerer* of questions, not an asker. You will
get to know of whom I speak quickly reading these newsgroups.

> TIA

YW. Fix that mailing address, and you would have gotten this advice
sooner.

> Paul.


Cameron

-- 
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu


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

Date: Tue, 21 Sep 1999 11:52:55 +0100
From: "Paul" <NoSpam@NoSpam.com>
Subject: Which are the best books for learning Perl for use in a Web environment?
Message-Id: <37e762f8_2@newsread3.dircon.co.uk>

Hi,

I wish to learn Perl for use in a Web environment.  The following books
seem to come recommended by many people are they relevant for Web
programming?

Learning Perl, Programming Perl, Perl Cookbook

TIA

Paul.






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

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


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