[11852] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5451 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 22 11:13:41 1999

Date: Thu, 22 Apr 99 08:00:31 -0700
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, 22 Apr 1999     Volume: 8 Number: 5451

Today's topics:
    Re: "unterminated character constant"? (Neil Cherry)
    Re: \s+ and ' ' in split <jdf@pobox.com>
        C superior to Perl in DB2 programming? <tzadikv@my-dejanews.com>
        Can a DNS lookup be performed from within perl ? (Uri Raz)
    Re: Can a DNS lookup be performed from within perl ? <tchrist@mox.perl.com>
    Re: Can a DNS lookup be performed from within perl ? (I R A Aggie)
    Re: Can a DNS lookup be performed from within perl ? <tchrist@mox.perl.com>
    Re: CGI programmer wanted (Tad McClellan)
    Re: CGI programmer wanted (I R A Aggie)
        Connecting to FTP server <tapsifules@hotmail.com>
    Re: Connecting to FTP server <dimitrio@fantom.com>
    Re: Database Converter <webdude@mcminn.net>
    Re: Database Converter (Rob Greenbank)
    Re: date & time modules? (I R A Aggie)
    Re: FAQ 4.15: How do I find yesterday's date? <Philip.Newton@datenrevision.de>
    Re: Generating a unique string for order number <Philip.Newton@datenrevision.de>
        HELP: opening files in perl and streaming them to web p <stats123@my-dejanews.com>
    Re: How to change an array to a list? yong321@yahoo.com
        How to check for Null input or spaced input <gebhardt@erinet.com>
    Re: How to check for Null input or spaced input <tchrist@mox.perl.com>
        if/elsif statement andrew338@my-dejanews.com
    Re: if/elsif statement <yfang@gte.com>
    Re: Is there a shorter way? (Larry Rosler)
    Re: list range operator (..) problem <jdf@pobox.com>
    Re: loading a html file in perl (Sam Curren)
        Mofiying excel with Perl <olivier.maas@at-lci.com>
        NT/Processes/IDs <banshee@zedat.fu-berlin.de>
        Perl Win32::OLE doc? <olivier.maas@at-lci.com>
    Re: Perl Win32::OLE doc? <gellyfish@gellyfish.com>
    Re: Personal Web Server and Perl ccharbeneau@lear.com
    Re: Problem with Expect.pm and 'sudden death' (Clinton Pierce)
    Re: Problem with Expect.pm and 'sudden death' <roland.giersig@bigfoot.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 22 Apr 1999 12:43:42 GMT
From: njc@dmc.uucp (Neil Cherry)
Subject: Re: "unterminated character constant"?
Message-Id: <slrn7hu6hj.4pu.njc@dmc.uucp>

On Thu, 22 Apr 1999 01:19:55 -0400, Ronald J Kimball wrote:
>Neil Cherry <njc@dmc.uucp> wrote:
>
>> I'm getting the following:
>> 
>> :13: unterminated character constant
>> 
>> I have only one 13 in an array reference (that doesn't make sense) and
>> I have no ^M's (unix). So what is this and how can I find this.
>
>I don't believe that that is a Perl error message.  How are you
>attempting to execute your script?

Perl -P -w hcs.pl

Your right, I'm using the cpp option. Thanks, that was driving me
nuts. Now I'll see where cpp is complaining.

-- 
Linux Home Automation           Neil Cherry             ncherry@home.net
http://members.home.net/ncherry                         (Text only)
http://meltingpot.fortunecity.com/lightsey/52           (Graphics GB)
http://www2.cybercities.com/~linuxha/			( DOWN )


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

Date: 22 Apr 1999 10:51:14 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: Kin Cho <kin@symmetrycomm.com>
Subject: Re: \s+ and ' ' in split
Message-Id: <m34sm8ogil.fsf@joshua.panix.com>

Kin Cho <kin@symmetrycomm.com> writes:

> What's the difference between ' ' and \s+ when used in split?

Perhaps the documentation for split() will tell you!

  perldoc -f split

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Thu, 22 Apr 1999 13:41:41 GMT
From: Tzadik Vanderhoof <tzadikv@my-dejanews.com>
Subject: C superior to Perl in DB2 programming?
Message-Id: <7fn8uk$dpn$1@nnrp1.dejanews.com>

Is there any way I can distribute my Perl script that uses DBD::DB2 to
machines that do not have the DB2 SDK installed?

I know that the DB2 SDK is necessary to *build* DBD::DB2 but question why it
should be necessary for simply *running* a script that *uses* DBD::DB2.

One irritating aspect of this problem is that apparently a C program that
uses DB2 does not suffer from this problem.  You just "bind" the C program
with the DB2 database (on a machine that has the DB2 SDK) and then you can
distribute the compiled and "bound" C program to a machine that does *not*
have the SDK. Thus if this is true, programming DB2 apps in C has a distinct
advantage over programming them in Perl, which rubs me the wrong way.

One problem with this issue is how to copy a DBD::DB2 module from one machine
to the other (without building it on the second machine).  I tried doing such
a copy recently by simply using "tar" to package up the relavant directorys
in /usr/local/lib/perl5, but I could not run my script on the second machine.
 I would get:

Can't load '/usr/local/lib/perl5/site_perl/5.005/aix/auto/DBD/DB2/DB2.so' for
mo dule DBD::DB2: dlopen:
/usr/local/lib/perl5/site_perl/5.005/aix/auto/DBD/DB2/DB2 .so: A file or
directory in the path name does not exist. at /usr/local/lib/perl
5/5.00502/aix/DynaLoader.pm line 168.

(I posted about this problem at the time but got no response.  The "DB2.so"
file it claims does not exist actually does exist...the problem seems to be
something that is called from "DB2.so".  The only way I could come up with to
solve this problem was to install the DB2 SDK on the second machine and
rebuild DBD::DB2 there.)

--
Thanks,

Tzadik

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 22 Apr 1999 07:01:56 GMT
From: uraz@iil.intel.com (Uri Raz)
Subject: Can a DNS lookup be performed from within perl ?
Message-Id: <7fmhh4$ahm$1@scnews.sc.intel.com>

 I'm working on a perl script that analyses a web server's log file.

 As part of the script I want to translate an IP address into a host's
 name, using (reverse) DNS lookup.

 Is there a way to do this from within perl, as a function and not by
 calling a shell to perform nslookup ?

-- 
 +---------+---------------------------+---------------------------------+
 | Uri Raz | mailto:uraz@iil.intel.com | I speak for myself, not Intel.  |
 | Work is what employees do while managers lay down the work plans. ;-) | 
 | My home page <URL:http://www.private.org.il>                          |
 +-----------------------------------------------------------------------+


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

Date: 22 Apr 1999 08:10:32 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Can a DNS lookup be performed from within perl ?
Message-Id: <371f2dd8@cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, uraz@iil.intel.com (Uri Raz) writes:
: I'm working on a perl script that analyses a web server's log file.
: As part of the script I want to translate an IP address into a host's
: name, using (reverse) DNS lookup.
: Is there a way to do this from within perl, as a function and not by
: calling a shell to perform nslookup ?

Which man pages did you read?  It looks perlfunc, perlipc, and 
perlfaq9 somehow escaped your greppage.  Better regrep and try again.

--tom
-- 
    "I can only bend the rules so much before it starts looking like I'm breaking
    the rules." --Larry Wall


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

Date: 22 Apr 1999 14:21:29 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Can a DNS lookup be performed from within perl ?
Message-Id: <slrn7huc86.n23.fl_aggie@stat.fsu.edu>

On 22 Apr 1999 07:01:56 GMT, Uri Raz
<uraz@iil.intel.com>, in <7fmhh4$ahm$1@scnews.sc.intel.com> wrote:

+  As part of the script I want to translate an IP address into a host's
+  name, using (reverse) DNS lookup.

You mean like:

address2name 143.185.96.126
Name: iil.intel.com
Aliases: 
Address type: 2
Length: 4
Addresses: 143.185.96.126

Here's the code (I got it from usenet a while back):

#!/usr/bin/perl
 
#usage:
#$ address2name 199.232.46.114

#the next two lines do all the work
 
$bobo = pack("C4", (shift =~ /(\d+).(\d+).(\d+).(\d+)/));
($name, $aliases, $addrtype, $length, @addrs) = gethostbyaddr($bobo, 2);
 
print "Name: $name\n";
print "Aliases: $aliases\n";
print "Address type: $addrtype\n";
print "Length: $length\n";
print 'Addresses: '; 
 
foreach (@addrs) { print join('.', unpack('C4', $_)); }
print "\n";

End code segment.

James


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

Date: 22 Apr 1999 08:53:32 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Can a DNS lookup be performed from within perl ?
Message-Id: <371f37ec@cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    fl_aggie@thepentagon.com writes:
:Here's the code (I got it from usenet a while back):
:#the next two lines do all the work
:$bobo = pack("C4", (shift =~ /(\d+).(\d+).(\d+).(\d+)/));
:($name, $aliases, $addrtype, $length, @addrs) = gethostbyaddr($bobo, 2);

For a lot of reasons, that's wrong,  Seqor Bobo. :-)  
Please grep the perl documentation for why.

--tom
-- 
Sockets are the X windows of IO interfaces.  --Rob Pike


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

Date: Thu, 22 Apr 1999 03:42:49 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: CGI programmer wanted
Message-Id: <ptjmf7.247.ln@magna.metronet.com>

Uri Guttman (uri@sysarch.com) wrote:

: i'd rather have a bottle in front of me than a frontal lobotomy!


   Was that Groucho Marx or W. C. Fields?


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


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

Date: 22 Apr 1999 14:26:21 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: CGI programmer wanted
Message-Id: <slrn7huch9.n23.fl_aggie@stat.fsu.edu>

On Thu, 22 Apr 1999 05:09:02 GMT, Tom Mornini
<tmornini@netcom.com>, in <tmorniniFAKrn2.8Fx@netcom.com> wrote:

+ : James - and was she given an invitation to visit the Oval Office?
+ I think she's more Lincoln Bedroom material, don't you think?

Does she have that much money to "donate"?

James


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

Date: 22 Apr 1999 14:24:40 GMT
From: "Zoli" <tapsifules@hotmail.com>
Subject: Connecting to FTP server
Message-Id: <01be8ccb$dec11c80$937be2c1@cpa02.agora.ro>

Hello!

I try to connect to the ftp server from Win'95 machine, using socket. User,
password accepted, but after that, the server receive my commands sended by
 the
script in uppercase, and of course return "command not understood". What's
the solution ?

Thanks
	Zoli


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

Date: Thu, 22 Apr 1999 14:33:26 GMT
From: Dimitri Ostapenko <dimitrio@fantom.com>
Subject: Re: Connecting to FTP server
Message-Id: <371F332C.41EE4680@fantom.com>

Zoli wrote:
> 
> Hello!
> 
> I try to connect to the ftp server from Win'95 machine, using socket. User,
> password accepted, but after that, the server receive my commands sended by
>  the
> script in uppercase, and of course return "command not understood". What's
> the solution ?
> 
> Thanks
>         Zoli


use Net::FTP; see example @ www.perlnow.com
_______________________
Dimitri Ostapenko,
CAD Designer/Sys.Admin.
Fantom Technologies Inc.


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

Date: Thu, 22 Apr 1999 13:37:30 GMT
From: "JJ" <webdude@mcminn.net>
Subject: Re: Database Converter
Message-Id: <uCFT2.2426$94.1029054@news1.usit.net>

Got it with regular expressions
$field[0] =~ s/\^DJI/Dow Jones/;
utilizing the substiution operator





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

Date: Thu, 22 Apr 1999 13:51:12 GMT
From: rob@frii.com (Rob Greenbank)
Subject: Re: Database Converter
Message-Id: <371f2724.143478656@news.frii.com>

>................. A harder question would be to find a language where
>it would take more than 10 lines (except for the translation data) to
>code this.

Us old-timers can name one rather quickly -- COBOL.  If "properly"
documented, you had twenty lines of program just getting to the code. 
Does anyone know how to translate "IDENTIFICATION DIVISION" to perl?

(fortunately my tour of duty was short enough I don't have the "Cobol
Vetran's Syndrome" problems that other's have experienced :^)

	Rob



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

Date: 22 Apr 1999 14:31:47 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: date & time modules?
Message-Id: <slrn7hucrg.n23.fl_aggie@stat.fsu.edu>

On Wed, 21 Apr 1999 20:27:39 GMT, djones@walcoff.com
<djones@walcoff.com>, in <7flcbl$on3$1@nnrp1.dejanews.com> wrote:

+ date and time modules and found a bunch of them but none of them had readme
+ files that explained the functionality.  I didn't want to download them all
+ only to find out it wasn't what I was looking for.  Any suggestions

You really owe it to yourself to install the CPAN module. Then you
can do something like:

perl -MCPAN -e shell

It will put you into an interactive cpan shell, and one of the
features is:

readme                    display the README file

Sounds like a winner...

James


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

Date: Thu, 22 Apr 1999 14:12:47 +0200
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: FAQ 4.15: How do I find yesterday's date?
Message-Id: <371F123F.F6825421@datenrevision.de>

Tom Christiansen wrote:
> 
> (This excerpt from perlfaq4 - Data Manipulation
>     ($Revision: 1.46 $, $Date: 1999/04/20 18:59:53 $)
> part of the standard set of documentation included with every
> valid Perl distribution, like the one on your system.
> See also http://language.perl.com/newdocs/pod/perlfaq4.html
> if your negligent system adminstrator has been remiss in his duties.)
> 
>   How do I find yesterday's date?
> 
>     The `time()' function returns the current time in seconds since the
>     epoch. Take one day off that:
> 
>         $yesterday = time() - ( 24 * 60 * 60 );

Not daylight saving time safe, if I understand it correctly. At the
transition to and from DST, days are 23 and 25 hours long.

So you might, possibly, get today's date or the-day-before-yesterday's
date out of this function.

Cheers,
Philip


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

Date: Thu, 22 Apr 1999 14:08:35 +0200
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Generating a unique string for order number
Message-Id: <371F1143.69BFAEB9@datenrevision.de>

Ronald J Kimball wrote:
> 
> What's wrong with a simple counter?  Implement it just like a CGI
> counter, with file locking.  You won't get repeating numbers if you
> simply increment.  :)

Hmm, but with integers, he'll have a problem after 2^32 orders, and with
floats, he'll get funny order numbers like 2.132e24 after a (long)
while...

Cheers,
Philip


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

Date: Thu, 22 Apr 1999 14:12:04 GMT
From: Matt Evans <stats123@my-dejanews.com>
Subject: HELP: opening files in perl and streaming them to web pages
Message-Id: <7fnang$fht$1@nnrp1.dejanews.com>

Hi,

I'm trying to open files in perl which are outside the web tree being served,
and stream themstraight to a web page in the hope it will pop up a "save as"
box and people will be able to download these files.
I have sort of got it working but it's very buggy.
I'm running apache on Win95 with active state perl.
Heres the code I have written:

#!C:/perl/bin/perl.exe

open(DFILE, "C:\\My Documents\\webmaster\\stds_down\\files.txt")||&errprn
("Couldn't open Download file: $dfile");

print "Content-type: application/octet-stream\n\n";
while ($line = <DFILE>)
 	{
		print $line;
   	}
close(DFILE);


this seems to work but if I change the file to open from a text file to a jpg
say, and I change the Content-type to image/jpeg te whole thing stops working.

Please someone help me.

Cheers,

Matt

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 22 Apr 1999 14:13:33 GMT
From: yong321@yahoo.com
Subject: Re: How to change an array to a list?
Message-Id: <7fnaq7$fiq$1@nnrp1.dejanews.com>


> >       if ($email =~ / /)
> >        { @email = split / /,$email;
> >          $smtp->to(@email); #doesn't seem to work
>
> How does it not seem to work?  What does @email contain at this point?

Excuse me. It was my fault. I passed the original $email, that is, "a@b.com
c@d.com" to the mail() method: $smtp->mail($email). In this case, I should say

$smtp->mail($email[0])

after @email is created by the split. Sorry.

Yong

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 22 Apr 1999 14:30:48 GMT
From: JG <gebhardt@erinet.com>
Subject: How to check for Null input or spaced input
Message-Id: <371F31C6.9DE02671@erinet.com>

I am struggling to find a way to ensure when a user is prompted for
input that the input is not just a bunch of spaces or null input. The
tricky part is that valid input can contain spaces. Any suggestions?

JG



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

Date: 22 Apr 1999 08:56:13 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to check for Null input or spaced input
Message-Id: <371f388d@cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, JG <gebhardt@erinet.com> writes:
:I am struggling to find a way to ensure when a user is prompted for
:input that the input is not just a bunch of spaces or null input. The
:tricky part is that valid input can contain spaces. Any suggestions?

Why yes.  Check whether the input is not just a bunch of spaces,
of course.  Just read the perlre manpage for how.  The "How do I strip
blank space from the beginning/end of a string?" entry in the perlfaq4
manpage should also be inspiring.

--tom
-- 
    "Since when did you hear people talk about writing LISP or BASIC *scripts*?
     JCL and shell make command *scripts*; perl and LISP make *programs*."  --me


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

Date: Thu, 22 Apr 1999 13:07:08 GMT
From: andrew338@my-dejanews.com
Subject: if/elsif statement
Message-Id: <7fn6to$bnc$1@nnrp1.dejanews.com>

I've got a "mailer" script.  Where the form input gets sent to depends on the
value the user selects for the question "deptname".  My script isn't working,
and I believe it is b/c of the if/eslif section.  Here the (I believe)
relevant sections of the script.  Any help would be appreciated

# 	The requestor whom we are to be mailing the response.
#
local ($recipient1) = $CGI{'recipient1'};
local ($recipient2) = $CGI{'recipient2'};
local ($recipient3) = $CGI{'recipient3'};

The beginning of the script:
#	Remove any shell metacharacters in the recipients e-mail address
$recipient1 =~ s#[^\w\.\@]##g;
$recipient2 =~ s#[^\w\.\@]##g;
$recipient3 =~ s#[^\w\.\@]##g;

#	Subject on e-mail
local ($subject) = $CGI{'subject'};

#	Name of the supervisor who is submitting form
local ($supman) = $CGI{'supman'};

#	Employee's department name
local ($deptname) = $CGI{'deptname'};

The middle:
#	The following determines where the response goes
if ($deptname eq "upstream"){
	$recipient2 = "rxxxxx\@mail.xxxxxx.com";
	$recipient3 = "sxxxxxx\@mail.xxxxxx.com";
}
elsif ($deptname eq "recall"){
	$recipient2 = "rxxxxxxx\@mail.xxxxxx.com";
	$recipient3 = "xxxxxx\@mail.xxxxxx.com";
}
elsif ($deptname eq "currentpast"){
	$recipient2 = "rxxxxxxx\@mail.xxxxxx.com";
	$recipient3 = "cxxxxxx\@mail.xxxxxx.com";
}
else ($deptname eq "dsp"){
	$recipient2 = "axxxxxxx\@mail.xxxxxx.com";
	$recipient3 = "sxxxxx\@mail.xxxxxx.com";
}

The end (we use mailx):
#	Open and print the mail message to $recipient1
local (*MAIL);

open (MAIL, "| $mailx -s \"$subject\" $recipient1") ||
	die "Content-type: text/html\n\n$0: Could not open $mailx to send mail:
$!";
local ($tosend);
$tosend	=		"\nThe supervisor/manager:   $supman\n" .
			"\nSupervisor's phone#:   $sup_phone\n" .
			"\nSupervisor's CDS ID:    $sup_cds\n" .
			"\nDate of Request:    $date\n" .

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 22 Apr 1999 09:27:36 -0400
From: Yu Fang <yfang@gte.com>
Subject: Re: if/elsif statement
Message-Id: <371F23C8.ACB169D5@gte.com>

else should not be folllowed by (xx eq xx).

andrew338@my-dejanews.com wrote:
> 
> I've got a "mailer" script.  Where the form input gets sent to depends on the
> value the user selects for the question "deptname".  My script isn't working,
> and I believe it is b/c of the if/eslif section.  Here the (I believe)
> relevant sections of the script.  Any help would be appreciated
> 
> #       The requestor whom we are to be mailing the response.
> #
> local ($recipient1) = $CGI{'recipient1'};
> local ($recipient2) = $CGI{'recipient2'};
> local ($recipient3) = $CGI{'recipient3'};
> 
> The beginning of the script:
> #       Remove any shell metacharacters in the recipients e-mail address
> $recipient1 =~ s#[^\w\.\@]##g;
> $recipient2 =~ s#[^\w\.\@]##g;
> $recipient3 =~ s#[^\w\.\@]##g;
> 
> #       Subject on e-mail
> local ($subject) = $CGI{'subject'};
> 
> #       Name of the supervisor who is submitting form
> local ($supman) = $CGI{'supman'};
> 
> #       Employee's department name
> local ($deptname) = $CGI{'deptname'};
> 
> The middle:
> #       The following determines where the response goes
> if ($deptname eq "upstream"){
>         $recipient2 = "rxxxxx\@mail.xxxxxx.com";
>         $recipient3 = "sxxxxxx\@mail.xxxxxx.com";
> }
> elsif ($deptname eq "recall"){
>         $recipient2 = "rxxxxxxx\@mail.xxxxxx.com";
>         $recipient3 = "xxxxxx\@mail.xxxxxx.com";
> }
> elsif ($deptname eq "currentpast"){
>         $recipient2 = "rxxxxxxx\@mail.xxxxxx.com";
>         $recipient3 = "cxxxxxx\@mail.xxxxxx.com";
> }
> else ($deptname eq "dsp"){
>         $recipient2 = "axxxxxxx\@mail.xxxxxx.com";
>         $recipient3 = "sxxxxx\@mail.xxxxxx.com";
> }
> 
> The end (we use mailx):
> #       Open and print the mail message to $recipient1
> local (*MAIL);
> 
> open (MAIL, "| $mailx -s \"$subject\" $recipient1") ||
>         die "Content-type: text/html\n\n$0: Could not open $mailx to send mail:
> $!";
> local ($tosend);
> $tosend =               "\nThe supervisor/manager:   $supman\n" .
>                         "\nSupervisor's phone#:   $sup_phone\n" .
>                         "\nSupervisor's CDS ID:    $sup_cds\n" .
>                         "\nDate of Request:    $date\n" .
> 
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

-- 
Frank Yu Fang 

GTE Internetworking
40 Sylvan Road
Waltham, MA 02451-1128


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

Date: Thu, 22 Apr 1999 07:30:36 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Is there a shorter way?
Message-Id: <MPG.1188d2675bf6306598990c@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <7fmpod$o7$1@nnrp1.dejanews.com> on Thu, 22 Apr 1999 09:22:23 
GMT, pingouino@my-dejanews.com <pingouino@my-dejanews.com> says...
 ... 
> perl -e'$_=$ENV{USER};print$_."x"x(6-split//)'
> 
> Note how we are relying on USER being treated as a bareword and also
> "split" defaulting to $_ and returning an array to be evaluated in
> scalar context to mimic "length".

Why mimic "length"?  You can save one character by just using "length" 
instead of "split//".

It's faster and warningless too (not that you care :-).

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 22 Apr 1999 10:59:38 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: "Marc Esser" <esser@home.com>
Subject: Re: list range operator (..) problem
Message-Id: <m31zhcog4l.fsf@joshua.panix.com>

"Marc Esser" <esser@home.com> writes:

> @myarray[0..2] = @myarray[2..0];

> According to the definition of .. this should print the
> same thing in both cases, ie.

Hmm.  Although the documentation is just short of explicit on this
matter, the list context range operator is increment-only.  You can't
go backwards.  This is *implicit* in the sample code given in perlop,
in that the examples all show ranges in which the values increase:

           for (101 .. 200) { print; } # print $_ 100 times
           @foo = @foo[0 .. $#foo];    # an expensive no-op
           @foo = @foo[$#foo-4 .. $#foo];      # slice last 5 items

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Thu, 22 Apr 1999 06:57:36 -0700
From: samc@empirewest.com (Sam Curren)
Subject: Re: loading a html file in perl
Message-Id: <MPG.1188caae26d8c7789896ef@news.sonic.net>

Sure, just send a re-direct.

I can't remember the exact syntax (someone else chime in here) but 
instead of sending the usual header to print something to the browser ( 
Content-type: text/html ) you send a header that reads ( Location: 
http:\\www.whereever.com )

Then the browser will re-direct to that page.

HTH -Sam

In article <371DC3BD.276B32D0@xtra.co.nz>, klumsy@xtra.co.nz says...
> a quick question:
> I want my perl program to load (or redirect) to another HTML file after
> some cacluatiing
> (i don't want to display any HTML)
> currently i can produce and return HTML, process my CGI vars, but i just
> want it not to display anything but load another html file. help (i am
> new to Perl)
> if worst comes to worst i'll have my perl program create a html file
> with javascript inside to automatically redirect to where i want to go..
> but I think there must be a better way than that
> 
> could you please answer directly to me.
> Karl Prosser
> klumsy@xtra.co.nz
> 
> btw, have a good day. you deserve one.
> 
> 
> 
> 


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

Date: Thu, 22 Apr 1999 14:51:30 +0200
From: Olivier Maas <olivier.maas@at-lci.com>
Subject: Mofiying excel with Perl
Message-Id: <371F1B52.B86B967A@at-lci.com>

Hello,
I am trying to modify an excel workbook, I can retreive the data but I
cannot modify...
(in fact, I can, but as I do not know how to save the file, I cannot
close it and therefore am stuck)
NE idear??
Here under are the lines...

$application=Win32::OLE->new('Excel.Application') || warn "Impossible de
cr&eacute;er un objet OLE";


$workbook=$application->Workbooks->open("$fichier");
   $worksheet=$workbook->Worksheets(1);
   $worksheet->Range("A4")->{'Value'}=25;
   $total=$worksheet->Range("A4")->{'Value'};
   print "$_ => $total\n";
   $application->ActiveWorkbook->Save("$fichier") #this line wont
work...
   $application->ActiveWorkbook->Close(0);
   DESTROY($application);
   }
 }
 $application->Quit();




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

Date: 22 Apr 1999 14:39:48 GMT
From: Susanne Schmidt <banshee@zedat.fu-berlin.de>
Subject: NT/Processes/IDs
Message-Id: <7fncbk$574$2@fu-berlin.de>

Hello all,
i have to solve a problem under Win-NT within a perlscript: a perlscript
should be scheduled from "at" at xx o`clock - but only if the run before
is not still running. I can`t calculate the time for one script-run, so i
have to look for the running process - how to do that under NT ?! (i just
know UNIX..) Is there any module for showing running processes ? Does NT
have processes ? ;) can i get them as a list? send signals ? GET AN ID ? :)

Maybe it`s the complete wrong idea - where do i have to look ?

Thank you for any idea!

Susanne

-- 
                             Frauen sagen "ja" zu Linux!
                                   banshee@linux.de


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

Date: Thu, 22 Apr 1999 14:54:29 +0200
From: Olivier Maas <olivier.maas@at-lci.com>
Subject: Perl Win32::OLE doc?
Message-Id: <371F1C05.DA917D6E@at-lci.com>

Hello,
I am trying to find a place where to get the different properties
accepted for OLE manipulation of Excel/Access/Word files

NE help welcome...

blue skies and soft landings

olivier
please reply to maas@ensae.fr




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

Date: 22 Apr 1999 14:58:11 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl Win32::OLE doc?
Message-Id: <371f2af3@newsread3.dircon.co.uk>

Olivier Maas <olivier.maas@at-lci.com> wrote:
> Hello,
> I am trying to find a place where to get the different properties
> accepted for OLE manipulation of Excel/Access/Word files
> 

I seem to recall that the last time this came up it degenerated into
a rather nasty argument after I suggested it was not really a Perl question
because it is all to do with th Microsoft Applications Object thing
however if you look at :

<http://msdn.microsoft.com/library/officedev/office/web/toc/FULLTOC.htm>

In concert with the documentation theat comes with Activeperl then you
should be able to work it out.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: Thu, 22 Apr 1999 13:15:28 GMT
From: ccharbeneau@lear.com
Subject: Re: Personal Web Server and Perl
Message-Id: <7fn7db$c76$1@nnrp1.dejanews.com>

  "Wyzelli" <wyzelli@yahoo.com> wrote:

> This was a question about PWS Rob, not IIS

Well, actually, PWS uses IIS services.  Where PWS is used, IIS exists.


My question was about PWS 4.0, however, so the reg. changes are not
necessarily the same (in reference to the script mentioned) in the
ActiveState PRK (win-32) Perl Utilities Guide Jepson talks about the IIS
Internet Service manager as a part of the MMC.	But mine doesn't start with
that particular Snap-in, nor can I find it anywhere on my machine.

Thanks to Jepson for all the useful Info, but it doesn't do me squat of any
good, since my results and his differ.  *shrug*  Which is why I'm asking for
help.

Thanks again,

Chuck Charbeneau
ccharbeneau@lear.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 22 Apr 1999 13:48:06 GMT
From: cpierce1@ford.com (Clinton Pierce)
Subject: Re: Problem with Expect.pm and 'sudden death'
Message-Id: <3728282f.1899253261@news.ford.com>

[poster cc'd in e-mail]

On 21 Apr 1999 20:33:27 GMT, in comp.lang.perl.misc you wrote:
>In <slrn7hscav.6f2.joshua@nothing.izzy.com>,
>Joshua Burgin <joshua@purestuff.com> wrote:
>
>> I'm having a problem using Expect.pm that's really difficult for me to
>> track down.
> ...
>I inserted a sig 'catcher', that waits for any interrupt, kill, hup,
>pipe, chld, etc. signal and will print out some info about the states of
>various processes, but it's never tripped when this happens.
>
>Any ideas?

Try inserting a "die" signal hander to see if something is die'ing.

	$SIG{__DIE__}=\&mydiefunc;

Install an END{} block to catch perl scripts that just stop.

	END {
		print STDERR "How'd I get here?\n";
	}

Look for corefiles.

Check the system log.


-- 
Clinton A. Pierce       "If you rush a Miracle Man, you get rotten
clintp@geeksalad.org        Miracles."  -- Miracle Max, The Princess Bride
http://www.geeksalad.org


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

Date: Thu, 22 Apr 1999 16:46:51 +0200
From: Roland Giersig <roland.giersig@bigfoot.com>
To: joshua@purestuff.com
Subject: Re: Problem with Expect.pm and 'sudden death'
Message-Id: <371F365B.9CCD7A3B@bigfoot.com>

Joshua Burgin wrote:
> I have a perl script, which controls another applicatiation via the
> functions provided in Expect.pm, and it works perfectly fine from the
> command line.
> 
> However, when I run it as a cron job, it gets to a place where it's
> receiving lots of data from the spawned process being controlled by
> expect functions, and just _dies_.

There are subtle differences when running under cron.
First, stdin/out is not a tty.
Second, various environment variables are not set, e.g.
TERM. I once had a (TCL) expect script that used telnet
and had the same symptoms: worked like a charm from
the commandline, not working as cron job. Solution:
setting the TERM variable to `VT100' solved everything.

You might want to do some deep thinking if these differences
could be the problem.

Hope this helps,

Roland
--
Roland.Giersig@bigfoot.com


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

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

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