[17927] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 87 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 18 03:06:03 2001

Date: Thu, 18 Jan 2001 00:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <979805110-v10-i87@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 18 Jan 2001     Volume: 10 Number: 87

Today's topics:
        Advanced HTML/DHTML, Perl, JavaScript, VBScript, Flash, (David)
    Re: change STDIN and $/="" script to use (Honza Pazdziora)
    Re: Eval scoping problem? (Rafael Garcia-Suarez)
    Re: Fetching server's hard-disk with Perl (Honza Pazdziora)
    Re: Jumbling words (Honza Pazdziora)
    Re: Jumbling words <zigouras@mail.med.upenn.edu>
    Re: LWP Syntax help.... (Chris Fedde)
        need help with (?...) <amitk@cadence.com>
    Re: need help with (?...) (Garry Williams)
    Re: Newbie question: hash tables and dbm files; what am <nospam-abuse@[127.0.0.1]>
    Re: Newbie question: hash tables and dbm files; what am (Garry Williams)
        novice perl programmer w/ errors <khopkins3@home.com>
    Re: POD to powerpoint translator? dtbaker_dejanews@my-deja.com
        Pulling KEy out of hash <johnm@acadiacom.net>
    Re: Pulling KEy out of hash (Chris Fedde)
    Re: Pulling KEy out of hash (Garry Williams)
    Re: regular expression question. pls help (Paul Sack)
        rename function in CGI script? (Rand Simberg)
    Re: rename function in CGI script? (Garry Williams)
    Re: rename function in CGI script? (Rand Simberg)
    Re: rename function in CGI script? (Richard Zilavec)
    Re: rename function in CGI script? (Garry Williams)
    Re: Running a CGI as a USER dtbaker_dejanews@my-deja.com
    Re: Saving .htm file to disk from CGI script dtbaker_dejanews@my-deja.com
    Re: Saving .htm file to disk from CGI script (Garry Williams)
    Re: Saving .htm file to disk from CGI script (Garry Williams)
    Re: techniques for finding slow code? dtbaker_dejanews@my-deja.com
    Re: Using perl to update an ASP? <ans@_nospam_x64.net>
        Win32 distr. missing files: <a565a87@my-deja.com>
    Re: Win32 distr. missing files: (Garry Williams)
    Re: Win32-Process output <dave_at_hm@hotmail.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 18 Jan 2001 07:00:38 GMT
From: david_xia@yahoo.com (David)
Subject: Advanced HTML/DHTML, Perl, JavaScript, VBScript, Flash, ASP and XML Books For Sale
Message-Id: <Xns902CEAEDE20B1davidxiayahoocom@129.46.64.77>

Advanced HTML/DHTML, Perl, JavaScript, VBScript, Flash, ASP and XML Books 
For Sale
All books are Brand New, and I will match price from any online book store.

"HTML 4 for the World Wide Web Visual Quickstart Guide"
by Elizabeth Castro
Paperback - 384 pages 4th edition (January 15, 2000) 
Peachpit Press; ISBN: 0201354934 
Asking $10

"Platinum Edition Using HTML 4, XML, and Java 1.2"
by Eric Ladd, Jim O'Donnell
Hardcover - 1282 pages Bk&Cd Rom edition (December 1, 1998) 
MacMillan Publishing Company; ISBN: 078971759X 
Asking $30

"JavaScript Bible"
by Danny Goodman, Brendan Eich
Paperback - 1015 pages 3rd Edition edition (March 1998) 
IDG Books Worldwide; ISBN: 0764531883 
Asking $25

"Flash 4 Magic" with CD
by David J. Emberton, J. Scott Hamlin, David Emberton
Textbook Binding - 325 pages Bk&Cd Rom edition (January 2000) 
New Riders Publishing; ISBN: 0735709491 
Asking $20

"Flash 4 Creative Web Animation" with CD
by Derek Franklin, Brooks Patton
Paperback - 352 pages 1st edition (January 15, 2000) 
Peachpit Press; ISBN: 0201354705 
Asking $20

"Visual InterDev 6 Unleashed"
by Paul Thurrott, Paul Thurrott et al., Brad Jones
Paperback - 1090 pages Bk&Cd Rom edition (April 23, 1999) 
Sams; ISBN: 067231262X 
Asking $25

"Programming Web Components" with CD
by Reaz Hoque, Tarun Sharma
Paperback - 810 pages Bk&Cd Rom edition
McGraw Hill; ISBN: 0079123163
Asking $25

"Dynamic Html : The Definitive Reference"
by Danny Goodman
Paperback - 1073 pages (August 1998) 
O'Reilly & Associates; ISBN: 1565924940 
Asking $20

"Dynamic Html in Action" with CD
by Eric M. Schurman, William J. Pardi
Paperback - 497 pages 2nd Bk&cdr edition (March 1999) 
Microsoft Press; ISBN: 0735605637 
Asking $20

"Professional Active Server Pages 3.0"
by Alex Homer, David Sussman, Brian Francis, George Reilly, Esposito,
   Dino Esposito, Andrea Chiarelli, Bill Kropog, Craig McQueen, 
   Godfrey Nolan, Simon Robinson, John Schenken, Kent Tegel
Paperback - 1277 pages 3rd edition (September 1999) 
Wrox Press Inc; ISBN: 1861002610 
Asking $30

"ASP/MTS/ADSI Web Security" with CD
by Richard Harrison
Paperback - 450 pages 1 edition (March 11, 1999) 
Prentice Hall; ISBN: 0130844659 
Asking $20

"Developing ASP Components"
by Shelley Powers
Paperback - 490 pages 1st edition (July 15, 1999) 
O'Reilly & Associates; ISBN: 1565924460 
Asking $15

"ASP in a Nutshell: A Desktop Quick Reference"
by A. Keyton Weissinger
Paperback; O'Reilly & Associates
Asking $10

"ADO 2.1 Programmer's Reference"
by David Sussman, Alex Homer
Mass Market Paperback - 607 pages 2 edition (June 1999) 
Wrox Press Inc; ISBN: 1861002688 
Asking $15

"Professional ADO 2.5 RDS Programming with ASP 3.0"
by John Papa
Mass Market Paperback - 819 pages 2nd edition (February 2000) 
Wrox Press Inc; ISBN: 1861003242
Asking $25

"XML Bible" with CD
by Elliotte Rusty Harold
Paperback - 1015 pages Bk&Cd Rom edition (July 1999) 
IDG Books Worldwide; ISBN: 0764532367 
Asking $25

"Building Professional Web Sites with the Right Tools: Build It With Visual 
Studio 6, FrontPage, Active Server Pages, VBScript, JavaScript, ADO, Paint 
Shop Pro, and Image Composer"
by Jeff Greenberg, J. R. Lakeland
Paperback - 576 pages 1 edition (August 10, 1999) 
Prentice Hall; ISBN: 0130843172 
Asking $20

"Administering IIS4"
by Mitch Tulloch
Paperback - 608 pages (May 29, 1998) 
Computing McGraw-Hill; ISBN: 0070655367 
Asking $20

"Learning Vbscript" with CD
by Paul Lomax, Ronald Petrusha (Editor)
Paperback - 640 pages Bk&Cd-Rom edition (October 1997) 
O'Reilly & Associates; ISBN: 1565922476 
Asking $20

"Learning Perl"
by Randal L. Schwartz, Tom Christiansen, Larry Wall (Foreword)
Paperback - 302 pages 2nd edition (July 1997) 
O'Reilly & Associates; ISBN: 1565922840 
Asking $10

"Programming Perl"
by Larry Wall, Tom Christiansen, Randal L. Schwartz, Stephen Potter
Paperback - 645 pages 2nd edition (October 1996) 
O'Reilly & Associates; ISBN: 1565921496 
Asking $15

"Perl Cookbook"
by Tom Christiansen, Nathan Torkington, Larry Wall
Paperback - 794 pages 1 Ed edition (August 1998) 
O'Reilly & Associates; ISBN: 1565922433 
Asking $20

"Programming the Perl DBI"
by Alligator Descartes, Tim Bunce
Paperback - 346 pages (February 2000) 
O'Reilly & Associates; ISBN: 1565926994 
Asking $15


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

Date: Tue, 16 Jan 2001 16:12:54 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: change STDIN and $/="" script to use
Message-Id: <G79JpI.JpH@news.muni.cz>

On Tue, 16 Jan 2001 07:25:41 -0800 (PST), Michael de Beer <madebeer@igc.apc.org> wrote:
> My main difficulty is that in part D) of my code, I parse the body in
> paragraph chunks.  If I detect with regexp that the chunk I've just
> 'eaten' has a 'From this@seperator date' line, that chunk will have the
> whole of the headers for the next message.
> 
> Any suggestions?

Check CPAN for mailbox handling modules that will allow you to access
emails in mbox file in a reasonable way.

[ I didn't look at your code because it would take me longer than three
minutes to read it. ]

Yours,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
   .project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
Petition for a Software Patent Free Europe http://petition.eurolinux.org
------------------------------------------------------------------------


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

Date: Thu, 18 Jan 2001 08:01:54 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Eval scoping problem?
Message-Id: <slrn96d8o7.hut.rgarciasuarez@rafael.kazibao.net>

Andrew Cragg wrote in comp.lang.perl.misc:
> Hello,
> 
> I have an odd problem where I'm writing to a text file using Data::Dumper
> then reading it back using eval.  The data in eval is "declared" as a
> sort-of global variable.  It seems that when I read from the text file using
> eval the global variable is not set unless I use the variable in some way
> (assignment to another variable for instance).
> 
> Is this a scoping problem?
> 
> Here is the code :
> 
> << This is a_package.pm >>
> 
> #! /usr/bin/perl -w
> use strict;
> package a_package;
> use Data::Dumper;
> 
> my $DataStructure = {};

Make this variable global :
  use vars qw/$DataStructure/;
  $DataStructure = {};
so it belongs to the package a_package. my() variables don't belong to
any package; hence the behavior you was getting.

You can also test that, if you put the a_package definition and the
main.pl code into the same file (you must then put "package main;"
before the main.pl code), and if you keep the my() declaration for
$DataStructure, the code will work. Read perlsub for clarifications
(esp. the section "Private Variables via my()").

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: Tue, 16 Jan 2001 16:10:44 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Fetching server's hard-disk with Perl
Message-Id: <G79JLw.J6J@news.muni.cz>

On Tue, 16 Jan 2001 15:25:23 GMT, -nancy-@libero.it <-nancy-@libero.it> wrote:
> 
> I'm trying to write a perl script
> who indexes the content of a web server's hard disk
> simply by typing an URL.
> 
> The script has to list all the files on the server's hard disk
> on which that URL is hosted.
> 
> Is it possible to do so ? If so, do I have to use LWP ?

Content of the same machine where the script runs? You can access
local files by simply opening them, and find them using for example
File::Find. You can use LWP with 'file:' requests. But you don't have
to.

Content of some other web server? Hopefully the server is configured
in such a way it won't let you to access all its files. To access
URL's on foreign server, using LWP is one way to go. But you don't
have to.

Hope this helps,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
   .project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
Petition for a Software Patent Free Europe http://petition.eurolinux.org
------------------------------------------------------------------------


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

Date: Tue, 16 Jan 2001 16:19:01 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Jumbling words
Message-Id: <G79Jzp.M85@news.muni.cz>

On Tue, 16 Jan 2001 11:00:47 -0500, Lou Moran <lmoran@wtsg.com> wrote:
> 
> --I don't know what that process is called so finding it in the Docs
> is fairing poorly.

Check perlfaq4 for permuting.

Yours,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
   .project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
Petition for a Software Patent Free Europe http://petition.eurolinux.org
------------------------------------------------------------------------


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

Date: Thu, 18 Jan 2001 00:47:05 -0500
From: Nico F Zigouras <zigouras@mail.med.upenn.edu>
Subject: Re: Jumbling words
Message-Id: <Pine.OSF.4.10.10101180044090.9390-100000@dolphin.upenn.edu>

I just dealt with this myself.  There is a recipe in the Perl Cookbook.
It is called mjd_permute and can be found at (among other places):
http://kancer.978.org/perl/cookbook.examples/ch04/mjd_permute

I modified it slightly to take in one word and scramble the letters rather
than one sentence and scramble the words.  It works quite well.

Good luck.


On Tue, 16 Jan 2001, Lou Moran wrote:

>--I have been reading the "Code Breaking" thread (which deals with
>replacing letters with "something") and it got me to thinking about
>jumbling words.
>
>--How could I take BAR and turn it into a list of all of the possible
>versions of that word?  (meaning:
>
>BAR
>BRA
>ARB
>ABR
>RBA
>RAB)
>
>--I don't know what that process is called so finding it in the Docs
>is fairing poorly.
>
>--please shove me in the right direction.
>
>
>
>lmoran@wtsgSPAM.com
>print "\x{263a}"
>
>



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

Date: Thu, 18 Jan 2001 07:12:09 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: LWP Syntax help....
Message-Id: <dHw96.1070$B9.192641536@news.frii.net>

In article <IFu96.26938$ED.968285@news1.rdc1.bc.home.com>,
cam <cam@home.com> wrote:
>Hi:
>
>I'm looking for a simple dictionary of perl syntax for parsing URL's using
>LWP:Simple;
>
>I know how to get a URL, but can't find a guide to the syntax used to
>grab/edit it's content.
>
>For example, what is the syntax for looking for links etc.....
>
>Thanks.
>

LWP::Simple will fetch the document that the URL points it does
not parse HTML text.  For that you need something else.  Maybe this
will give you something to think about:

#!/usr/bin/perl -w
#
# getlinks
# return links from listed urls
#

use LWP::UserAgent;
use HTML::LinkExtor;
use URI::URL;
use strict;

my @anchors = ();

while (my $url = shift @ARGV){
    my $ua = new LWP::UserAgent;
    $ua->env_proxy();

    # Make the parser.  Unfortunately, we don't know the url base yet
    # (it might be diffent from $url)
    my $p = HTML::LinkExtor->new(\&callback);

    # Request document and parse it as it arrives
    my $res = $ua->request(HTTP::Request->new(GET => $url),
        sub {$p->parse($_[ 0])});

    # Expand all A URLs to absolute ones
    my $base = $res->base;
    @anchors = map { $_ = url($_, $base)->abs; } @anchors;

    # Print them out
    print join("\n", @anchors), "\n";
}

# Set up a callback that collects links
sub callback {
    my($tag, %attr) = @_;
    return if $tag ne 'a';  # we only look closer at <a ...>
    push(@anchors, values %attr);
}

-- 
    This space intentionally left blank


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

Date: Thu, 18 Jan 2001 13:00:31 +0531
From: Amit K Mathur <amitk@cadence.com>
Subject: need help with (?...)
Message-Id: <3A669B5B.B33A565@cadence.com>

I am trying to parse a design exchange text file.
the exact problem is:

there will be statements like this in the input file:

HIER_DELIMITER "/";
 ...
 ...
COMPONENTS 4;
 - top_box/medium_box/mybox ....;
 - big_polygon/small_box ....;
 - ....;
 - ....;
END COMPONENTS

I have to replace the hier_delimiter characters from name of a component 
by character "|". eg. the first name becomes "top_box|medium_box|mybox". 

I am doing it like this:

$hier_statement =~ m/^HIER_DELIMITER \s+ \" (.) \" \s* ;/x 
                           # (.) captures the hier_delimiter character
in $1.
$hierdel = "\\$1"; # $hierdel contains a backslash followed by 
                   # actual HIER_DELIMITER character.
 ...
 ...

$component_name =~ s/$hierdel/|/g;


Now my actual problem:
the HIER_DELIMITER character may be a metacharcter 
of regexp( \ | ( ) [ { ^ $ * + ? .) or it may not be. if it is one
of metachars, it needs to be escaped in $hierdel. if it is not, it
*should* not
be. because a non-metacharacter, if escaped, may acquire a special 
meaning (eg. a, A, b, B, n and numerous others). i can use a "switch"
statement
and selectively escape the HIER_DELIMITER, but it will be 
kind of less incorrect than present solution but still incorrect --
if another metacharacter is later added to the dirty 
dozen (set of metacharacters), the switch code will break.

so what is the solution??
is there a metasymbol of (?...) family which does what i want. i.e.
takes 
what ever is inside the bracket in place of "..." *literally*.
or is there any other *elegent* solution ....?

thank you very much.
amit.


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

Date: Thu, 18 Jan 2001 07:52:24 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: need help with (?...)
Message-Id: <Ygx96.280$032.9285@eagle.america.net>

On Thu, 18 Jan 2001 13:00:31 +0531, Amit K Mathur <amitk@cadence.com>
wrote:

[snip]

>Now my actual problem:
>the HIER_DELIMITER character may be a metacharcter 
>of regexp( \ | ( ) [ { ^ $ * + ? .) or it may not be. if it is one
>of metachars, it needs to be escaped in $hierdel. if it is not, it
>*should* not
>be. because a non-metacharacter, if escaped, may acquire a special 
>meaning (eg. a, A, b, B, n and numerous others). 

[snip]

>so what is the solution??

$hierdel = "\Q$1";

See the perlre manual page, especially the warning about `$' and `@'.  

-- 
Garry Williams


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

Date: Thu, 18 Jan 2001 01:00:15 -0500
From: "James Kauzlarich" <nospam-abuse@[127.0.0.1]>
Subject: Re: Newbie question: hash tables and dbm files; what am I doing wrong?
Message-Id: <fEv96.4434$d25.27585@newsfeed.slurp.net>

Garry Williams <garry@zvolve.com> wrote in message
news:TFa96.145$h41.7699@eagle.america.net...
> On Tue, 16 Jan 2001 20:29:17 -0500, James Kauzlarich
> <nospam-abuse@[127.0.0.1]> wrote:
>
> >I was hoping to be able to do it without relying on modules.
>
> No problem, but maybe more error-prone.  I guess that depends on your
> problem.  For simple data structures, I've implemented my own
> serializations and ignored Storable.  Your original question was how
> to store a hash as a value in a dbm file.  I guess you could choose to
> represent the hash as key-value pairs of strings separated by pipe (|)
> symbols.  Then you could retrieve the value and use split to re-vivify
> the hash.  This may be a problem, if your keys or values can include
> the pipe character.  You decide, if you don't want to or can't use
> Storable.

Thanks for going into so much detail here, my mind works better if I have a
mental picture of something and, though obvious, you kicked me into a good
path that I was about to walk away from.

Sorry I didn't say anything in my previous/parrallel post, but I hadn't had
time to give what you'd said my attention as I was reading it between phone
calls at work.  I went right to the other thing because I figured it would
get a responce ::grin::.

--
do NOT remove the nospam from the repy to address above,
instead send email to o1tech(at)skyenet(dot)net

JAPN  8_(





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

Date: Thu, 18 Jan 2001 06:21:21 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: Newbie question: hash tables and dbm files; what am I doing wrong?
Message-Id: <BXv96.270$032.9472@eagle.america.net>

On Thu, 18 Jan 2001 01:00:15 -0500, James Kauzlarich
<nospam-abuse@[127.0.0.1]> wrote:
>Garry Williams <garry@zvolve.com> wrote in message
>news:TFa96.145$h41.7699@eagle.america.net...
>> On Tue, 16 Jan 2001 20:29:17 -0500, James Kauzlarich
>> <nospam-abuse@[127.0.0.1]> wrote:
>>
>> >I was hoping to be able to do it without relying on modules.
>>
>> No problem, but maybe more error-prone.  I guess that depends on your
>> problem.  For simple data structures, I've implemented my own
>> serializations and ignored Storable.  Your original question was how

[snip]

>Thanks for going into so much detail here, my mind works better if I have a
>mental picture of something and, though obvious, you kicked me into a good
>path that I was about to walk away from.

Glad it helped!  

-- 
Garry Williams


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

Date: Thu, 18 Jan 2001 07:54:09 GMT
From: "kenneth hopkins" <khopkins3@home.com>
Subject: novice perl programmer w/ errors
Message-Id: <Bix96.150486$15.32342192@news1.rdc1.az.home.com>

Hi again all -
I have a simple program below that I have created to read in a file that
contains only 6 digit integer number per line. Approx 500 lines. Then the
number will be ran thru an informix database and then the results output to
a new file. And I am recieving "201: A syntax error has occurred." I have
lost too many of my braincell trying to figure it out and am turning to more
compenent folks such as ya'll.  Can you see my error?  It would be very
helpful if you could point it out to me and any other flaws you might see.

Thanks oodles,
kenny

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

my $num;   # client_num retrieved from text file
my $line;

open (OUT, "|isql utell >/dev/null") or die;
while(<>)
{
  chomp;
  $num = $_;

  print OUT "
    UNLOAD TO \"/home/support/khopkins/isql.out\"
    SELECT client_type, client_id, client_num, name, title,
           first_name, middle_name, last_name, address1, address2,
           city, state, zip, country, home_phone, business_phone
    FROM client_ids
    WHERE client_num = '$num' ";
}
close(OUT);




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

Date: Thu, 18 Jan 2001 05:39:04 GMT
From: dtbaker_dejanews@my-deja.com
Subject: Re: POD to powerpoint translator?
Message-Id: <945vho$cu7$1@nnrp1.deja.com>

In article <3A6640FB.8497CD74@hp.com>,
  John Benavides <john_benavides@hp.com> wrote:
> Has anyone built a POD to PowerPoint translator?
>
> I would like to display some of my module work
> in PowerPoint and wondered if someone has already
> cooked this up?
-------------

yuck.... why create monster big PPT files? there is POD to HTML, and you
should be able to show HTML on just about anything....

I'd guess you could go POD to HTML, and then import to PowerPoint if you
really wanted to.

D


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 18 Jan 2001 00:24:26 -0600
From: "John Michael" <johnm@acadiacom.net>
Subject: Pulling KEy out of hash
Message-Id: <3a668daa$1@news.acadiacom.net>

Is it possible to pull the key out of a hash array.

##I am using a routine like this to keep the key's now.

sub assign_values {
my @array = @_;
my ($name,$value);
foreach (@array) {
         chomp;
         ($name, $value) = split(/=/);
         $value =~ tr/+/ /;
         $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
         $value =~ s/<!--(.|\n)*-->//g;
         $INPUT{$name} = $value;
          push (@config_vars, $name);
}}

##Then I use the @config_vars array like so to fill in the values on
templates.

$temp_txt = &get_template('template.info');
foreach (@config_vars){
         $temp_txt =~ s/%%$_%%/$INPUT{$_}/gi;
}

print qq~$temp_txt\n~;

How do you pull the keys out so that you don't have to keep the @config_vars
array?

Thanks in advance.
--
John Michael

mY signAture & QuoTe
----------------------------------------------------------------------------
------
The Chicken or The Egg??
----------------------------------------------------------------------------
------
----------------------------------------------------------------------------
------





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

Date: Thu, 18 Jan 2001 07:03:56 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Pulling KEy out of hash
Message-Id: <wzw96.1069$B9.192918528@news.frii.net>

In article <3a668daa$1@news.acadiacom.net>,
John Michael <johnm@acadiacom.net> wrote:
>Is it possible to pull the key out of a hash array.
>
>##I am using a routine like this to keep the key's now.
>
>$temp_txt = &get_template('template.info');
>foreach (@config_vars){
>         $temp_txt =~ s/%%$_%%/$INPUT{$_}/gi;
>}
>

Let Perl do the looping:

    use warnings;
    use strict;

    my $template =
    q{
    Dear %%title%% %%lastname%%,

    I have recently seen your posting in %%publication%%.
    I find your %%noun%%  %%verb%%.

    Sincerely %%me%%
    };

    my %value = (
       title => 'Grand Puba',
       lastname => 'Flintstone',
       publication => 'Bedrock Gazette',
       noun => 'opinions',
       verb => 'worthless',
       me => 'Mr Rubble',
    ),

    my $out;
    ($out = $template) =~ s/%%(\w+)%%/$value{$1}/ge;

    print $out;

There are other examples of this in the faq and the cookbook.

good luck!
chris
-- 
    This space intentionally left blank


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

Date: Thu, 18 Jan 2001 07:11:07 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: Pulling KEy out of hash
Message-Id: <fGw96.274$032.9609@eagle.america.net>

On Thu, 18 Jan 2001 00:24:26 -0600, John Michael <johnm@acadiacom.net>
wrote:
>Is it possible to pull the key out of a hash array.
                                         ^^^^^^^^^^
It's just a hash.  An array is a different data type in Perl.  

See the keys function described in the perlfunc manual page.  

>##I am using a routine like this to keep the key's now.
>
>sub assign_values {
>my @array = @_;
>my ($name,$value);
>foreach (@array) {
>         chomp;
>         ($name, $value) = split(/=/);
>         $value =~ tr/+/ /;
>         $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>         $value =~ s/<!--(.|\n)*-->//g;

          $value =~ s/<!--.*-->//gs;

>         $INPUT{$name} = $value;
>          push (@config_vars, $name);
>}}

Is this a CGI program?  I rarely write CGI programs, but when I do, I
use the CGI module.  That way, I don't have to worry about making
mistakes converting entities and parsing keywords from a query.
That's all done correctly for you under the covers.  I'm lazy.  

As a matter of fact, the CGI module has a method (keywords()) that
will give you a list of the keywords in the query.  That may be of
interest to you here.  Maybe you're lazy, too.  :-)  

>##Then I use the @config_vars array like so to fill in the values on
>templates.
>
>$temp_txt = &get_template('template.info');
>foreach (@config_vars){
>         $temp_txt =~ s/%%$_%%/$INPUT{$_}/gi;
>}
>
>print qq~$temp_txt\n~;
>
>How do you pull the keys out so that you don't have to keep the @config_vars
>array?

Just say `keys %INPUT' instead of `@config_vars'.  

-- 
Garry Williams


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

Date: Thu, 18 Jan 2001 05:30:10 GMT
From: paul-sackun@jefe.eyep.net (Paul Sack)
Subject: Re: regular expression question. pls help
Message-Id: <4at549.sd9.ln@jefe>

In article <9454hp$mdd$1@nnrp1.deja.com>, vupt@yahoo.com wrote:
>Supposing I have the following data  :
>
><item delimiter=", " name="UPT
>PIR"><value>http://www.uptpir.com/products/index.html</value></item>
>
>There are many items but the item that I want has name attribute with
>value "UPT PIR"
>I would like to extract the content between <value></value> and so for
>the above example,
>http://www.uptpir.com/products/index.html would be the value extracted.
>
>the regular expression I am using right now is
>
>my $matchKey="UPT PIR[ .]*?<value>(.*)</value>";
>	if ($line=~/$matchKey/) {
>	     print "match $1\n";
>   } else {
>	     print "no match\n";
>   }

So what's the problem you are having?

BTW, change (.*) to (.*?).

Otherwise if you have <value>foo bar</value>...<value>....</value> it will
match everything b/w the first <value> and the last </value>.

-- 
You have an unusual magnetic personality.  Don't walk too close to
metal objects which are not fastened down.


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

Date: Thu, 18 Jan 2001 05:27:57 GMT
From: simberg.interglobal@trash.org (Rand Simberg)
Subject: rename function in CGI script?
Message-Id: <3a677d97.38578878@nntp.ix.netcom.com>

I'm trying to get the rename function to work in a script, and it
fails every time.

I'm saying:

rename("$oldfile,$newfile) || CgiDie("Failed to rename the file!");

and I always get the error message in the browser.

I know the file exists, because I do an existence check and actually
pull data out of it just before I attempt the rename.

My best guess is some kind of permissions problem.  The file is one
that was created by another CGI script, and it is owned by www.  The
permissions on it are 644.  Are the permissions needed to write the
same as those to rename?  Any ideas?

Also, how in the heck does one delete a file?  I've got an old Camel
book (vintage 1992) and it describes an rmdir command to remove a(n
empty) directory, but makes no mention of an equivalent of rm.

TIA...

************************************************************************
simberg.interglobal.org  * 310 372-7963 (CA) 307 739-1296 (Jackson Hole)  
interglobal space lines  * 307 733-1715 (Fax) http://www.interglobal.org 

"Extraordinary launch vehicles require extraordinary markets..."
Replace first . with @ and throw out the "@trash." to email me.  
Here's my email address for autospammers: postmaster@fbi.gov


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

Date: Thu, 18 Jan 2001 05:45:08 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: rename function in CGI script?
Message-Id: <Epv96.266$032.9081@eagle.america.net>

On Thu, 18 Jan 2001 05:27:57 GMT, Rand Simberg
<simberg.interglobal@trash.org> wrote:

>I'm trying to get the rename function to work in a script, and it
>fails every time.
>
>I'm saying:
>
>rename("$oldfile,$newfile) || CgiDie("Failed to rename the file!");
>
>and I always get the error message in the browser.

Here's a way to get a different error message: 

 rename("$oldfile,$newfile) || CgiDie("rename $oldfile: $!");

>Also, how in the heck does one delete a file?  

 perldoc -f unlink

-- 
Garry Williams


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

Date: Thu, 18 Jan 2001 05:56:17 GMT
From: simberg.interglobal@trash.org (Rand Simberg)
Subject: Re: rename function in CGI script?
Message-Id: <3a6884eb.40454859@nntp.ix.netcom.com>

On Thu, 18 Jan 2001 05:45:08 GMT, in a place far, far away,
garry@zvolve.com (Garry Williams) made the phosphor on my monitor glow
in such a way as to indicate that:

>Here's a way to get a different error message: 
>
> rename("$oldfile,$newfile) || CgiDie("rename $oldfile: $!");

Thanks--that was much more useful...  I was inserting the directory
name twice...

>>Also, how in the heck does one delete a file?  
>
> perldoc -f unlink

Ahhh, when I looked up unlink in the book, it actually had the syntax
for it.  

Is it supposed to be obvious that that's a file delete command?  Is
there some reason they couldn't have a mention of delete when it came
to "file" in the index of the book?  ;-)

Thank you much.

************************************************************************
simberg.interglobal.org  * 310 372-7963 (CA) 307 739-1296 (Jackson Hole)  
interglobal space lines  * 307 733-1715 (Fax) http://www.interglobal.org 

"Extraordinary launch vehicles require extraordinary markets..."
Replace first . with @ and throw out the "@trash." to email me.  
Here's my email address for autospammers: postmaster@fbi.gov


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

Date: Thu, 18 Jan 2001 08:55:38 GMT
From: rzilavec@tcn.net (Richard Zilavec)
Subject: Re: rename function in CGI script?
Message-Id: <3a68ada7.270432537@news.tcn.net>

On Thu, 18 Jan 2001 05:27:57 GMT, simberg.interglobal@trash.org (Rand
Simberg) wrote:

>My best guess is some kind of permissions problem.  The file is one
>that was created by another CGI script, and it is owned by www.  The
>permissions on it are 644.  Are the permissions needed to write the
>same as those to rename?  Any ideas?

Make sure www has write permissions in the directory that contains the
file you want to rename.  Check the error code:

rename($this,$that) || die "Can't rename $this: $!";

>Also, how in the heck does one delete a file?  I've got an old Camel

perldoc -f unlink

--
 Richard Zilavec
 rzilavec@tcn.net


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

Date: Thu, 18 Jan 2001 06:08:53 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: rename function in CGI script?
Message-Id: <VLv96.269$032.9472@eagle.america.net>

On Thu, 18 Jan 2001 05:56:17 GMT, Rand Simberg
<simberg.interglobal@trash.org> wrote:
>On Thu, 18 Jan 2001 05:45:08 GMT, in a place far, far away,
>garry@zvolve.com (Garry Williams) made the phosphor on my monitor glow
>in such a way as to indicate that:
>
>>>Also, how in the heck does one delete a file?  
>>
>> perldoc -f unlink
>
>Ahhh, when I looked up unlink in the book, it actually had the syntax
>for it.  
>
>Is it supposed to be obvious that that's a file delete command?  

Only if you grew up with Unix.  

>Is
>there some reason they couldn't have a mention of delete when it came
>to "file" in the index of the book?  ;-)

I haven't checked the third edition of the Camel (it's at work and I'm
not), but since this is so in-grained, it's entirely possible that
unlink() still isn't indexed under file.  Oh well, it's due to Perl's
roots.  Just embrace it.  :-)  

-- 
Garry Williams


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

Date: Thu, 18 Jan 2001 05:50:37 GMT
From: dtbaker_dejanews@my-deja.com
Subject: Re: Running a CGI as a USER
Message-Id: <94607c$de5$1@nnrp1.deja.com>

well this is NOT a perl issue, so you might want to remove the
crosspost to that group.

In article <3A664D23.16EB8C8B@chartermi.net>,
  "Brian E. Seppanen" <seppanen@chartermi.net> wrote:
> Hello:
>
> I've been given the task of setting up a user guestbook on a
multi-user
> webserver running linux and apache 1.3.14.  The criteria I have been
> given is that I need to setuid the program and run the program as the
> user.
 ---------
I dont think you want to do it quite that way.... if you keep changing
the uid of the cgi "user" you will have to open up the privs on the file
and it will get really confusing. I dont think you want to have the
ownership of the guestbook file flipping around to the last user. You
want it to be either "nobody" or "you" so that you can edit/delete it as
an administrator. It depends on whether your webserver is setup to run
scripts as "nobody" or the account owner.

If you are trying to restrict access to the guestbook to registered
users or somesuch, then just put the interface form under .htaccess
protection. If your cgi dir is also under the .htaccess then you can
check for a valid REMOTE_USER from the script. Most other ENV like
HTTP_REFERER and others can all be spoofed.

D


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 18 Jan 2001 05:30:19 GMT
From: dtbaker_dejanews@my-deja.com
Subject: Re: Saving .htm file to disk from CGI script
Message-Id: <945v1c$cho$1@nnrp1.deja.com>

In article <KFo96.19242$_B2.1564577@typhoon.kc.rr.com>,
  "Trees for Life" <nomail@spam.com> wrote:
> I'm using Perl for CGI scripting. I want the script to generate an
HTML
> file, but instead of printing it to STDOUT, to create a .htm file on
my hard
> drive. Can this be done?
---------
yes it certainly can.
However, this may not be the best group to ask cgi questions. try
comp.infosystems.www.authoring.cgi in the future.



Following is my test code. Instead of
creating an
> .htm file, it printed the Hello World to screen.
-------
odd.... how did you execute the script?
did you fire it up with a GET or POST action from a webpage FORM running
on a webserver?

BTW, you probably dont need the flock() unless there is a chance of
multiple users requesting the file as you write it?
or the explicit \n when using the "here" doc style of printing.
You also may not want to write the file into the cgi-bin dir, because
it is most likely that no one will be able to get to it.
You also have a space between the > and the rest of the filename when
opening the filehandle...


D

> -------------------------- Cut here --------------------------
>
> open (HTMLFILE, "> cgi-bin/savehtmtolocal.htm") or die "Could not open
> file.";
> flock (HTMLFILE, 2) or die "Could not lock file.";
>
> print HTMLFILE <<LIST_ITEM;
> <HTML>\n
> <HEAD>\n
> <TITLE>Hello World<TITLE>\n
> </HEAD>\n
> <BODY>\n
> <H1>Hello World!</H1>\n
> </BODY>\n
> </HTML>
> LIST_ITEM
>
> flock (HTMLFILE, 8);
> close HTMLFILE;
>
>


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 18 Jan 2001 06:37:58 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: Saving .htm file to disk from CGI script
Message-Id: <abw96.271$032.9472@eagle.america.net>

On Thu, 18 Jan 2001 05:30:19 GMT, dtbaker_dejanews@my-deja.com
<dtbaker_dejanews@my-deja.com> wrote:
>In article <KFo96.19242$_B2.1564577@typhoon.kc.rr.com>,
>  "Trees for Life" <nomail@spam.com> wrote:

>BTW, you probably dont need the flock() unless there is a chance of
>multiple users requesting the file as you write it?

What about multiple users running _this_ script?  

>You also may not want to write the file into the cgi-bin dir, because
>it is most likely that no one will be able to get to it.

This is good advice.  

>> open (HTMLFILE, "> cgi-bin/savehtmtolocal.htm") or die "Could not open
>> file.";

>You also have a space between the > and the rest of the filename when
>opening the filehandle...

This is a red herring, according to the manual (perldoc -f open): 

     open FILEHANDLE,MODE,LIST

     open FILEHANDLE,EXPR

     open FILEHANDLE
             Opens the file whose filename is given by EXPR, and
     ...
             If MODE is `'<'' or nothing, the file is opened for
             input.  If MODE is `'>'', the file is truncated and
             opened for output, being created if necessary.  
     ...
             In the 2-arguments (and 1-argument) form of the call
             the mode and filename should be concatenated (in
             this order), possibly separated by spaces.  
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

-- 
Garry Williams


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

Date: Thu, 18 Jan 2001 06:41:56 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: Saving .htm file to disk from CGI script
Message-Id: <Uew96.272$032.9472@eagle.america.net>

On Thu, 18 Jan 2001 03:54:00 GMT, Tad McClellan <tadmc@augustmail.com> wrote:
>Garry Williams <garry@zvolve.com> wrote:
>
>> #!/usr/local/bin/perl -wT
>                          ^
>                          ^
>
>While that is nearly always an extremely Good Idea for CGI programs
>(perhaps such a good idea that you should get used to using it
>even when you don't need it), it is not required for the program
>posted. That program does not take any user input, so there
>won't be any data for tainting to mark :-)

Good point; it's not cargo-cult just a habit.  :-)  

-- 
Garry Williams


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

Date: Thu, 18 Jan 2001 05:02:03 GMT
From: dtbaker_dejanews@my-deja.com
Subject: Re: techniques for finding slow code?
Message-Id: <945tc9$b9d$1@nnrp1.deja.com>

In article <3A65F9BE.908A9396@home.com>,
  Michael Carman <mjcarman@home.com> wrote:

>
> You didn't read closely enough. :) If you had you would have seen part
> about the Devel::DProf module. Benchmark is meant to test alternative
> ways of doing the same thing, not for profiling entire programs. Use
> Devel::DProf for that.
>
--------------

sorry, i did miss that the first time thru! It does look like it might
have some interesting info. I am a little concerned if it will
install/run in ActivePerl, but I guess if it is available thru the ppm
install, it *should* be ok.

I am hoping there is a little more documentation in the module readme? I
took a look at the CPAN docs, and it is a little unclear where the
profile output file will pop out. From the docs I read so far it looks
like all you have to do is add a -d:DProf to fire it up. I am hoping
that this switch will be "seen" if I put it in the #!/usr/bin/perl line
since the script is being fired up by a webserver.

Lastly, it sounded like the granularity will be only as fine as my
non-built-in subs... which will help me to a point, but then within one
sub in particular i know there is some significant REGX and looping, and
it will be a pain to figure out which of these is killing me unless I
can edit and isolate them out into separate subroutines of their own.

D


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 18 Jan 2001 05:55:30 GMT
From: "Anson Parker" <ans@_nospam_x64.net>
Subject: Re: Using perl to update an ASP?
Message-Id: <mzv96.68002$xW4.528837@news-server.bigpond.net.au>


duckdba <scorkery@my-deja.com> wrote in message
news:945r13$9ja$1@nnrp1.deja.com...
> My employer recently starting requiring it's employees "clock-in" by
> logining in to a web-page.  This page is tied to our vacation days and
> if we forget to "clock-in", one day is docked from our total number of
> vaction days.  I am looking for a way to automate this "clocking-in"
> process, so that I can put it in a cron job, so I don't have to worry
> about losing vacation days.


dunno if cron would really be appropriate - how will you deal with the
days when you are actually on vacation? won't it look a little suspicous
if you "clock-in" at exactly the same time every day? you probably
want some kind of bounded randomness to keep you right in the middle
of the bell curve. I'm sure your company must be running all sorts of
graphs on employee productivity and metrics on just how small they
can get those cubicles.

I guess punch-cards are back in with this burst tech bubble and all...

ans.




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

Date: Thu, 18 Jan 2001 07:05:53 GMT
From: Rob <a565a87@my-deja.com>
Subject: Win32 distr. missing files:
Message-Id: <9464kg$gdj$1@nnrp1.deja.com>

Hi Everyone,

At the top of http://perl.apache.org/dist/ it warns:

     Please note!
     mod_perl-1.24_01.tar.gz or later is required for Apache >= 1.3.14.


As I happen to have downloaded the binary Win32 installer version of
1.3.14 (which seems pretty new) I thought I'd head the advice above.
To that end, I've downloaded mod_perl-1.24_01 and would like to build
it from source on MSVC 6.0, but my compiler stops dead in its tracks
because it cannot locate the following files:

     apache.c
     connection.c
     constants.c
     file.c
     log.c
     mod_perl_version.h
     perlxsi.c
     server.c
     table.c
     URI.c

This seems odd to me because one would naively think a distr. would
contain these files.  I've never found them, on my machine or anywhere
else on the WWW for that matter.  Would any of you kind ladies and
gentlemen know where these files can be obtained?  I've looked just
everywhere.

Compounding the problem is:  I'm new at the perl environment, so maybe
I'm missing some knowledge in general that you more experienced users
have about these distributions.  In any event, thank you for the help
that you can provide in guiding me beyond this stage.

-Robert


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 18 Jan 2001 07:36:49 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: Win32 distr. missing files:
Message-Id: <l2x96.279$032.9285@eagle.america.net>

On Thu, 18 Jan 2001 07:05:53 GMT, Rob <a565a87@my-deja.com> wrote:
>Hi Everyone,
>
>At the top of http://perl.apache.org/dist/ it warns:
>
>     Please note!
>     mod_perl-1.24_01.tar.gz or later is required for Apache >= 1.3.14.
>
>
>As I happen to have downloaded the binary Win32 installer version of
>1.3.14 (which seems pretty new) I thought I'd head the advice above.
>To that end, I've downloaded mod_perl-1.24_01 and would like to build
>it from source on MSVC 6.0, but my compiler stops dead in its tracks
>because it cannot locate the following files:
>
>     apache.c
>     connection.c
>     constants.c
>     file.c
>     log.c
>     mod_perl_version.h
>     perlxsi.c
>     server.c
>     table.c
>     URI.c
>
>This seems odd to me because one would naively think a distr. would
>contain these files.  I've never found them, on my machine or anywhere
>else on the WWW for that matter.  Would any of you kind ladies and
>gentlemen know where these files can be obtained?  I've looked just
>everywhere.
>
>Compounding the problem is:  I'm new at the perl environment, so maybe
>I'm missing some knowledge in general that you more experienced users
>have about these distributions.  In any event, thank you for the help
>that you can provide in guiding me beyond this stage.

I suppose the missing files would be included with an Apache
distribution.  

But what on earth is your Perl question?  Why are you posting here?  

-- 
Garry Williams


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

Date: Wed, 17 Jan 2001 21:55:52 -0800
From: Dave E <dave_at_hm@hotmail.com>
Subject: Re: Win32-Process output
Message-Id: <3A668568.1642EFC5@hotmail.com>

Hi John,

Wow, thanks -- I think -- I'm still trying to figure out what this actually does
:)  I've not used IO::Handle or POSIX  yet (not that I'm afraid to learn new
stuff).

I'm going to chew on this for a while and read up on the modules it uses.
Hopefully, in a little bit, I'll be able to formulate some intelligent questions
about what it's doing.  Meanwhile, if you have the time, an example of how to
actually use this sub would really help.

Thank you;

    David...


John J Green wrote:

> Dave E wrote:
>
> > Hi,
> >
> > Anyone know how to pipe the output of a process started via
> > Win32-Process back into Perl?  Willing to tell me??  ('cause I can't
> > figure it out)
> >
> > I want to do this:
> >
> >     open(PLIST, "pulist |");
> >     while (<PLIST>) {
> >         print $_;    # okay, I want to do more here but this is a good
> > test
> >     }
> >     close(PLIST);
> >
> > EXCEPT --  I want to be able to timeout pulist (an NT resource kit
> > utility) if it hangs (which it has a habbit of doing)
> >
> > so, I'm trying to use Win32::Process to start pulist because I can
> > timeout and kill it if it misbehaves.  But, the docs don't show any way
> > to get the output of the process back into Perl.
> >
> > Is there anyway to pipe the results of processes started with
> > win32-process back into the initiatiing program?  Even a way to redirect
> > the output to a file that I could later read would be okay (not perfect
> > but okay...)
> >
> > Is there another way to deal with misbehaving external apps called from
> > within a Perl script on an NT box?
> >
> > I'm really stuck here - everything works in my script except for pulist
> > hanging once in a while - and I've spent days running around is circles,
> > reading docs until my head spins, trying to figure this out.
> >
> >     David...
> >
> > just a post-newbie crawling and scratching my way to guru  --  When I
> > get there, I'll have a real tag line. ;)
>
> I believe this code works, though its been a while since I've used it.  The
>
> disadvantage is that any changes to environment variables are not visible
> to the new process.
>
> --- Code ---
> use strict;
> # Turn off strict refs, because file handles might
> # have been passed in like '<&STDIN' or '>&STDOUT'
> no strict 'refs';
>
> # Core and CPAN modules
> use IO::Handle;
> use POSIX ();
> use Symbol qw(gensym qualify);
> use Win32::Process qw(INFINITE);
>
> #---------------------------------------------------------------------------
>
> #  _spawn_with_handles
> #      Create a new process with read and write handles.
> #  Params:
> #      $fds - Reference to array of hashes containing information
> #             on files to open.
> #      @cmd - Command and arguments to execute.
> #  Return values:
> #      Win3::Process object or exits.
> #---------------------------------------------------------------------------
>
> sub _spawn_with_handles
> {
>     my $fds = shift;  # Fields: handle, mode, open_as
>     my @cmd = @_; # Remaining arguments are the command to execute
>     my ($fd, $pid, @saved_fh, $saved, %saved, @errors);
>
>     foreach $fd (@$fds) {
>  $fd->{tmp_copy} = IO::Handle->new_from_fd($fd->{handle}, $fd->{mode});
>  $saved{fileno $fd->{handle}} = $fd->{tmp_copy};
>     }
>     foreach $fd (@$fds) {
>  bless $fd->{handle}, 'IO::Handle'
>      unless eval { $fd->{handle}->isa('IO::Handle') } ;
>  # If some of handles to redirect-to coincide with handles to
>  # redirect, we need to use saved variants:
>  $fd->{handle}->fdopen($saved{fileno $fd->{open_as}} || $fd->{open_as},
>          $fd->{mode});
>     }
>
>     unless (@errors) {
>         my $cmd_path = _find_path($cmd[0]);
>  my $rc = Win32::Process::Create($pid, # Process object
>                                         $cmd_path, # Full path to command
>                                         join(' ', @cmd), # Command line
>                                         1, # Inherit,
>                                         0, # Create flags
>                                         "." # Initial directory
>                                        );
>  push @errors, Win32::FormatMessage(Win32::GetLastError()) unless $rc;
>     }
>
>     foreach $fd (@$fds) {
>  $fd->{handle}->fdopen($fd->{tmp_copy}, $fd->{mode});
>  $fd->{tmp_copy}->close or
>             push @errors, "Can't close: $!";
>     }
>     c_io::fatal(join "\n", @errors) if @errors;
>     return $pid;
>
> }



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

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 V10 Issue 87
*************************************


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