[24883] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7135 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 14 14:07:04 2004

Date: Tue, 14 Sep 2004 11:05:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 14 Sep 2004     Volume: 10 Number: 7135

Today's topics:
    Re: $| (undocumented) magic? <ron.parker@povray.org>
    Re: $| (undocumented) magic? (Anno Siegel)
    Re: another try (Darius)
    Re: Help with globbing (Mr. Land)
    Re: hv_iterinit has side effects - who cares about PL t (Ozgun Erdogan)
        move 7500 files to various directories (Greg DePasse)
    Re: move 7500 files to various directories <peter@semantico.com>
    Re: move 7500 files to various directories (Anno Siegel)
    Re: Perl opting for double-byte chars? <http://joecosby.com/code/mail.pl>
        Perltray  <joericochuyt@msn.com>
        preserving back references (ie $1, $2...) (rob)
        Running as a Service <alder.bw@forces.gc.ca>
        SSI executing Perl <ken@NOSPAMkenkast.com>
    Re: SSI executing Perl <tore@aursand.no>
    Re: SSI executing Perl <noreply@gunnar.cc>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 14 Sep 2004 10:23:30 -0500
From: Ron Parker <ron.parker@povray.org>
Subject: Re: $| (undocumented) magic?
Message-Id: <slrncke37i.4hk.ron.parker@mail.parkrrrr.com>

On 14 Sep 2004 07:40:16 -0700, J. Romano wrote:
> Unfortunately, in order to use '==' for boolean comparisons you have
> to know which variables behave like booleans and which don't.

if (!$a == !$b) {...}

-- 
#local R=<7084844682857967,0787982,826975826580>;#macro L(P)concat(#while(P)chr(
mod(P,100)),#local P=P/100;#end"")#end background{rgb 1}text{ttf L(R.x)L(R.y)0,0
translate<-.8,0,-1>}text{ttf L(R.x)L(R.z)0,0translate<-1.6,-.75,-1>}sphere{z/9e3
4/26/2001finish{reflection 1}}//ron.parker@povray.org My opinions, nobody else's


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

Date: 14 Sep 2004 15:41:16 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: $| (undocumented) magic?
Message-Id: <ci73es$b63$1@mamenchi.zrz.TU-Berlin.DE>

J. Romano <jl_post@hotmail.com> wrote in comp.lang.perl.misc:
> > On Fri, 10 Sep 2004 00:57:20 -0400, Jeff 'japhy' Pinyan
> > <pinyaj@rpi.edu> wrote:
> > 
> > >The C code implementing $| basically says "if the value
> > >assigned to $| is true, have $| return 1, otherwise have
> > >it return 0".  This leads to the
> 
> Michele Dondi <bik.mido@tiscalinet.it> wrote in message
> news:<un74k0t9g74s1askdo1meu4uad0eucmr6q@4ax.com>...
> > 
> > (Having not seen the actual code, and not being to) I
> > *think* that basically it should say "if the result of
> > an assignment is true then actually store 1 in it,
> > otherwise store 0 in it". Isn't this closer?
> 
> 
>    Forgive me for bringing this up one more time, Michele.  I've been
> thinking about this, and it seems to me that $| may have been
> implemented to return 1 (if true) in order to behave like a boolean
> variable.

Well, it *is* a boolean variable.  The state of a filehandle is either
auto-flushing or not, so it wouldn't make much sense to have $| return
values other that 0 and 1.

>           This would be an advantage when comparing to boolean
> variables, like in this example:
> 
>    Say that both $| and $a are booleans.  $| was set to 5, and $a was
> set to 1.  If you compare them with the == operator, should it
> evaluate to true or false?  In other words, should the following code
> print "True"?:
> 
>       $| = 5;
>       $a = 1;
>       print "True"  if $| == $a;
> 
>    If you're comparing their boolean states (whether they are both
> true or both false), then yes, it should print true.  But if you're
> comparing actual numerical values, then they should print false.  In
> this case, it prints "True" because of that quirk you found with $|,
> which may have been deliberately put in to make $| behave as if it
> only had true/false states.  If it weren't for this feature, you could
> compare $| and $a's boolean states another way with "not" and "xor,"
> like this:
> 
>       print "True"  if not ($| xor $a);
> 
> I happen to think that the '==' operator is more readable. 
> Unfortunately, in order to use '==' for boolean comparisons you have
> to know which variables behave like booleans and which don't.

Comparison of boolean variables is rare.  The only case that comes up
with some regularity is the newbie mistake of writing "if ( $x == 1 )"
for "if ( $x )" and "if ( $x == 0 )" for "if ( not $x )".  It is a
mistake because it brings in all the difficulties of boolean comparison
that you have correctly analyzed.

Otherwise, it just doesn't happen all that often that you want to do
one thing if both $a and $b are true, and the same thing when they
are both false, but something else if one is true and the other isn't.
If it happens, I'll try to bring in negation at one point, which
normalizes the value of booleans, so comparison with "==" is valid.

Anno


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

Date: 14 Sep 2004 09:51:20 -0700
From: dmedhora@yahoo.com (Darius)
Subject: Re: another try
Message-Id: <26a5971.0409140851.2d53994c@posting.google.com>

> 
>     s/="[^=]*?Gotta/="Somethings Gotta/g;
> 
> does the right thing with your examples.
> 
> The problem is that it is an unreliable ad-hoc solution that works
> in this case, but may not in reasonably similar cases.
> 
> Anno

Yes this works just fine for the example string i supplied.
Thanks very much for that. At first I couldn't make head or tail of
what
it meant but I now know that it means this:-

Example string:
<word_word1 string="start" date="2004-09-02 07:33:22" id="2033878"
word_id="2000589" get_id="8647" ><word name="MOVIE"><film
title="S"things Gotta Give" the_number="531780"
/></word></word_word1><film title="S'&quote Gotta Give"
the_number="531780" />

s/="[^=]*?Gotta/="Somethings Gotta/g;

look for =" 
then anything other than '=' 
then Gotta

In this exact sequence. 

So everytime it comes across the spurious '='s in the beginning of the
string the sequence is broken. And the search starts again from there
on. Until the sequence is met resulting in a match!

Thanks and Much appreciated.
sorry for the inconvenience
-D


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

Date: 14 Sep 2004 08:59:43 -0700
From: graftonfot@yahoo.com (Mr. Land)
Subject: Re: Help with globbing
Message-Id: <3a81cd7b.0409140759.1aee5e6f@posting.google.com>

Thanks, Mike.

Actually, I have read the docs you've mentioned.  Right now I have
something that looks like:

$baseString = "Something with spaces in it";
opendir(DIR, ".");
@fileList = grep { /$baseString.*[gG].*4$/ } readdir(DIR);
closedir(DIR);

($baseString isn't hard-coded like this, it's being loaded with unique
basenames.)

 ...this seems to work OK, until my $baseString variable gets filled
with something like:
                   "It's a beautiful day"

Then things go awry.  Could it be the single apostrophe?  Should I be
quoting $baseString when I use it in grep's regular expression?

Thanks again.


Michael Slass <miknrene@drizzle.com> wrote in message news:<m38ybeauoq.fsf@eric.rossnet.com>...
> graftonfot@yahoo.com (Mr. Land) writes:
> 
> >Hello.
> >
> >I've read what I could find on filename globbing and can't seem to get
> >an answer for the following:
> >
> >I have  directory containing files like:
> >
> >	File One.red
> >	File One.blue
> >	File One.green3
> >	File One.Green4
> >	File One.Gray4
> >	SecondFile.red
> >	SecondFile.blue
> >	SecondFile.green4
> >
> >I have built an array containing the "basenames" (everything up to but
> >not including the last ".") of
> >all files in the directory.  For my example above, my array would
> >contain 2 elements:
> >
> >	"File One"
> >	"SecondFile"
> >
> >Now, for each such array entry I am trying to get an array of
> >filenames which match a certain pattern,
> >that pattern being based on the entry.  For example to get a list of
> >all files having the basename
> >and having an extension that begins with either "g" or "G" and ends in
> >"4":
> >
> >foreach $basename (@TheArray) {
> >	
> >	@fileList = <$basename*[gG]*4>;
> >
> >This worked as shown for "SecondFile" but failed with "File One" due
> >to the embedded space.  I tried
> >various forms of quoting, such as:
> >
> >	@fileList = <'$basename'*[gG]*4>;
> >
> >	@fileList = <'$basename*[gG]*4'>;
> >
> >	@fileList = <"$basename*[gG]*4">;
> >
> >but none of these seem to handle BOTH cases (with and without embedded
> >spaces in the basename).
> >
> >Is there at least one way to do this and what would that look like?
> >
> >Thanks.
> 
> I think you'd have more success using perl's full regular expressions
> than with globbing, which is designed to be like the UNIX shells' *
> operator, and is a fairly blunt tool.
> 
> The canonical perl way to do this is by opening a directory handle,
> and then iterating over the files in the directory, processing each
> one.
> 
> ------------------------------ cut here ------------------------------
> #!/bin/perl/bin/perl -w
> use strict;
> 
> my $fileName;
> opendir(DIR, "/path/to/directory");
> 
> foreach $fileName (readdir DIR)
> {
>   # match File One.[gG]<anything>4
>   if ( $fileName =~ m/File One\.[gG].*4/ ) {
>     # do something, like add it to a list for later processing
>     # push @someListVar, $fileName
>     ;
>  # match SecondFile.[bB]
>   } elsif ( $fileName =~ m/SecondFile\.[bB]/ ) {
>  # do something with this file anem
>   }
>  # and so on
> }
> 
> closedir(ETC);
> ------------------------------ cut here ------------------------------
> 
> You should read about dirhandles and regular expressions in the perl
> docs:
> 
> perldoc -f opendir
> perldoc -f readdir
> perldoc -f closedir
> 
> perldoc perlre
> (this last one is the page for how perl regular expressions work, and
> it's big)


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

Date: 14 Sep 2004 11:01:11 -0700
From: ozgune@gmail.com (Ozgun Erdogan)
Subject: Re: hv_iterinit has side effects - who cares about PL theory
Message-Id: <48b43181.0409141001.3ad2775a@posting.google.com>

Inlined.

> > T2
> > ----
> > grab_read_lock(hash1);
> > hv_iterinit(hash1);
> > while (not_endof_hash(hash1));
> > {
> >   hv_iternext(hash1);
 ....
> I haven't tried. However, perl is thread-safe and hashes are used with
> threads. So far I haven't yet heard any complains about this particular
> aspect.

yes, probably because Perl gets you a write (or an exclusive) lock
regardless of the fact that you want to do a read. This means you need
to lock the whole hash structure even if you're doing a hash lookup.


> >> You aren't modifying a hash's values when iterating over it. You are
> >> however modifying the internal state of the iterator. There is no other
> >> way to do it in any language.
 ...
> That's because you create each iterator object manually. If you do:

Yup, I know. You said "there is no other way to do it in any
language", and I said - by default - C/C++ do it the other way. To me,
it makes more sense to separate the iterator from the hash structure.

> It still is a read. The fact that you do not have to create iterators
> yourself in Perl is a feature, and a good one IMO.

It depends. It's a good feature until it bites you. You have a data
structure X. X contains Y and Z. To read Y (or X therefore), you need
to change the value of Z. To me, it's not so intuitive.
 
> The fact that that's the way Perl hashes behave is well known. The

It may be well known by folks who tried to write OS or DB code in
Perl. I don't think other users of Perl are really aware of the
implications of this 'feature'.

> module of this particular module appears to neglect it if his module
> falls into infinite recursion. In order to avoid it he has to save the
> iterators value somewhere and restore it later when he wants to continue
> where he left off.

That argument I do buy. That's what I'm doing in my own code.


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

Date: 14 Sep 2004 08:23:36 -0700
From: greg.depasse@gmail.com (Greg DePasse)
Subject: move 7500 files to various directories
Message-Id: <a7927fe3.0409140723.3d6f8a6@posting.google.com>

Let me say up front that this is my first software writing experience.
 As of a week ago, I had no knowledge of perl or any other language. 
Over the past weekend, I've done a ton of searching and reading.  I
believe my problem is simple, but the solution isn't quite as easy for
me to write.

My problem:

I have 7500 pictures in a directory that need to move to roughly 40
different directories.  I have a text file that lists the names of
7500 files (digital pictures) and the corresponding directory they
need to be moved to.  All the files are currently in a single
directory, c:\photos. The filenames do not contain spaces, but the
directory names do.  I'm also working in windows XP with activestate
installed. If needed I could transfer everything to a linux machine.

Sample from album.txt:
picture1.jpg c:\album\2002-12 christmas at home
picture2.jpg c:\album\2002-07 july 4th in DC

From what I gather, my path forward is to read the keys and values
from the text file into a hash, and then for each key/value combo
issue a rename.  I've pulled samples from the net and my Learning Perl
book to come up with the code listed below.

Could someone look over what I have so far and point out what's wrong
(I haven't tried it yet, but I'm guessing that something is wrong -
like the split command picking up the spaces in the directory names,
and my command for renaming using the keys and values).  A corrected
version would very much appreciated.

Thanks for your help,
Greg

#
# This script moves pictures from a flat directory 
# to various directory locations
#

use strict;
use warnings;

# album.txt is 7500 lines of filename.jpg [space] c:\dirname\
$album_list = "C:/photos/album.txt"; 
open LISTING, $album_list or die "can't read $album_list: $!";

###
### Read data from txt file into hash
###

# read file into hash
chomp(my %hash = map { split / / } <LISTING>);

# verify
print map { "$_ => $hash{$_}\n" } keys %hash;

###
### Move files
###

while ( ($key, $value) = each %hash) {
    rename $key , $value . $key;
};


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

Date: Tue, 14 Sep 2004 16:57:11 +0100
From: Peter Hickman <peter@semantico.com>
Subject: Re: move 7500 files to various directories
Message-Id: <414714db$0$26742$afc38c87@news.easynet.co.uk>

Well it is good that you used strict and warnings but it is a pity that you did 
not run your own code. It does not compile as $album_list, $key and $value have 
not been declared.

You really need to present working code otherwise people will just ignore you.

Putting in the mys and running it we get.

Odd number of elements in hash assignment at x1 line 18, <LISTING> line 2.
Use of uninitialized value in concatenation (.) or string at x1 line 21, 
<LISTING> line 2.
DC
  =>
home
  => picture2.jpg
4th => in
picture1.jpg => c:\album\2002-12
c:\album\2002-07 => july
christmas => at

The problem is the split. It is splitting up the line on every space, thus the 
line "picture1.jpg c:\album\2002-12 christmas at home" has five elements with 
the keys "picture1.jpg", "christmas" and "home".

What you really need is:

chomp( my %hash = map { split(/ /, $_, 2) } <LISTING> );

This splits the line into two parts and we get

picture2.jpg => c:\album\2002-07 july 4th in DC
picture1.jpg => c:\album\2002-12 christmas at home

However the

rename $key, $value . $key;

also has a problem. What you really want it

rename $key, "$value\\$key";

Assuming that $value is the name of a directory and $key the file name. You code 
would try and create a file called:

"c:\album\2002-07 july 4th in DCpicture2.jpg".

Otherwise your code looks good and you have clearly got a good grasp of the perl 
way. Keep it up.


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

Date: 14 Sep 2004 16:25:30 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: move 7500 files to various directories
Message-Id: <ci761q$dgj$1@mamenchi.zrz.TU-Berlin.DE>

Greg DePasse <greg.depasse@gmail.com> wrote in comp.lang.perl.misc:
> Let me say up front that this is my first software writing experience.
>  As of a week ago, I had no knowledge of perl or any other language. 
> Over the past weekend, I've done a ton of searching and reading.  I
> believe my problem is simple, but the solution isn't quite as easy for
> me to write.
> 
> My problem:
> 
> I have 7500 pictures in a directory that need to move to roughly 40
> different directories.  I have a text file that lists the names of
> 7500 files (digital pictures) and the corresponding directory they
> need to be moved to.  All the files are currently in a single
> directory, c:\photos. The filenames do not contain spaces, but the
> directory names do.  I'm also working in windows XP with activestate
> installed. If needed I could transfer everything to a linux machine.

That won't be necessary.

> Sample from album.txt:
> picture1.jpg c:\album\2002-12 christmas at home
> picture2.jpg c:\album\2002-07 july 4th in DC
> 
> From what I gather, my path forward is to read the keys and values
> from the text file into a hash, and then for each key/value combo
> issue a rename.

The hash isn't strictly necessary.  You could read each line from the
album file and process it as it comes.

If you wanted to make preliminary checks (Do the image files exist on disk?
Are the target directories already created?) the hash may be a good idea,
but your code doesn't do that.

>                  I've pulled samples from the net and my Learning Perl
> book to come up with the code listed below.
> 
> Could someone look over what I have so far and point out what's wrong
> (I haven't tried it yet,

You should, normally.  You may be able to iron out some wrinkles
before presenting the code to the group.  Test runs can also bring
up specific questions you might not have thought of otherwise.

>                          but I'm guessing that something is wrong -
> like the split command picking up the spaces in the directory names,

That's repairable.

> and my command for renaming using the keys and values).  A corrected

The command looks fine, but like every external command the result
should be checked and errors reported.

> version would very much appreciated.
>
> Thanks for your help,
> Greg
> 
> #
> # This script moves pictures from a flat directory 
> # to various directory locations
> #
> 
> use strict;
> use warnings;

Strict and warnings.  Good.

> # album.txt is 7500 lines of filename.jpg [space] c:\dirname\
> $album_list = "C:/photos/album.txt"; 
> open LISTING, $album_list or die "can't read $album_list: $!";
> 
> ###
> ### Read data from txt file into hash
> ###
> 
> # read file into hash
> chomp(my %hash = map { split / / } <LISTING>);

As you anticipated, "split / /" would split the directory names that
contain blanks, which would royally mess up the structure of the
hash list.  Give split() a limit of 2.

Also, the chomp won't work as intended (or maybe it will, but for the
wrong reason).  You can chomp the values.

    my %hash = map { split ' ', $_, 2 } <LISTING>;
    chomp values %hash;

> # verify
> print map { "$_ => $hash{$_}\n" } keys %hash;

Well, that prints it out, but doesn't give you a chance to do anything
if you find something is wrong.  It's hard to see what it's good
for in the finished program, but a preliminary version should certainly
do this at some point.

> ###
> ### Move files
> ###
> 
> while ( ($key, $value) = each %hash) {
>     rename $key , $value . $key;
> };

"$key" and "$value" don't tell the reader anything about the purpose
of the variables.  "$file" and "$target_dir" would be more specific,
"$photo" and "$album" still more.  You forgot to declare the variables
(necessary under strict).  You'll need a directory separator between
the file and the directory name, just concatenation won't do. Further,
rename() should be checked for errors:

    while ( my ( $photo, $album) = each %hash ) {
        rename $photo, $album . '/' . $photo or
            warn "Can't move $photo to $album: $!";
    }

There's probably more, I haven't run the program either.  In any case,
before you run it on actual data, be sure you can restore the original
state.  If it runs wild, recovering from the mess can be hard.  "rename"
can even lose data.

Anno


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

Date: Tue, 14 Sep 2004 08:57:28 -0700
From: Joe Cosby <http://joecosby.com/code/mail.pl>
Subject: Re: Perl opting for double-byte chars?
Message-Id: <6o4ek0l6jktr8np9294hs3cs6vsqr5p27n@4ax.com>

Thanks again for all the help, I was able to pin down the problem in
my code.

Sorry if the problem as I presented it was confusing, I haven't done
much with Unicode before.

This has led me to a further problem, maybe some of you here would
know how to fix this:

Pages coming through to my CGI system might be either ISO-8859-1 or
UTF-8 encoded.  That sucks, but I'm stuck with it.

The encoding is indicated in the page with an HTML meta tag, ie

<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

(or charset=utf-8)

Apache sends the request object to Perl, but in the header for the
request I just get

Content-Type: application/x-www-form-urlencoded

I am definitely not either an Apache or mod perl expert ... does
anybody know if there is a way to tell Apache to send the content type
as it was indicated in the meta tag?

I might be missing the point completely ... when the page POSTs, I am
assuming that it should post with the content-type as specified in the
meta tag, but I am not sure if that is the case.  It's displaying as
specified in the meta tag, but I don't know if meta tags are a special
case, or what.

Anyway, sorry if I am missing an obvious point, thanks for any help.




-- 
Joe Cosby
http://joecosby.com/ 
Does this dress make me look fat?
Well, you do look fat, but it's not exactly the dress that's causing it. The dress is doing its best to hold it all in.
 


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

Date: Tue, 14 Sep 2004 13:53:05 -0400
From: "yusufdestina" <joericochuyt@msn.com>
Subject: Perltray 
Message-Id: <5de0ca3e7185510a26844b29b89f8dba@localhost.talkaboutprogramming.com>

I have a small perltray app. and another big Perl/Tk appl.
From the tray app. I can run the Perl/Tk app.
Question: is it possible to send some arguments from the perltay app to
the Perl/Tk appl and backwards? Both are .exe files.
 ..
sub PopupMenu {
    return [["App 1", "Execute 'perlTk.pl'"],#sending some arg??
	    ["--------"],
	    ["Exit", "exit"],
	   ];
}
 ..
-----------------------------------------------------------



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

Date: 14 Sep 2004 08:29:39 -0700
From: robert_parks@csgsystems.com (rob)
Subject: preserving back references (ie $1, $2...)
Message-Id: <9129c854.0409140729.41e3d115@posting.google.com>

When you perform regular expressions with capturing Perl creates back
references into the original string such that you can access parts of
the string using $1, $2, etc. My testing shows that using the back
reference directly is MUCH faster than copying it to a variable and
then using it.

For example, these two pieces of code have identical output, but the
first on will be faster than the second.

my $string='a,b;c,d;e,f';
if ( $string=~/([a-z,]+);([a-z,]+);([a-z,]+)/ ){
  print "START_1\n";
  print "[",$1,"]\n";
  print "[",$2,"]\n";
  print "[",$3,"]\n";
  print "END_1\n";
}

my( $one, $two, $three)= $string=~/([a-z,]+);([a-z,]+);([a-z,]+)/;
print "START_2\n";
print "[",$one,"]\n";
print "[",$two,"]\n";
print "[",$three,"]\n";
print "END_2\n";

Output:

START_1
[a,b]
[c,d]
[e,f]
END_1
START_2
[a,b]
[c,d]
[e,f]
END_2

Note, I chose a simple example for this post; my testing was on a
larger volume of data and I ruled out i/o being a factor. I just
wanted to show that the code is equivalent.

Since using back references is much faster than accessing the data
though named scalar vars, I would like to use them in my application.
The problem with back references is that they get overwritten each
time you do a regular expression. For example:

my $string='a,b;c,d;e,f';
if ( $string=~/([a-z,]+);([a-z,]+);([a-z,]+)/ ){
  print "START_3\n";
  print $1,"\n";
  if($1=~/(\w+),(\w+)/){
    print "START_3_inner\n";
    print "[",$1,"]\n";
    print "[",$2,"]\n";
    print "END_3_inner\n";
  }
  print "[",$2,"]\n";
  print "[",$3,"]\n";
  print "END_3\n";
}

The output is:
START_3
a,b
START_3_inner
[a]
[b]
END_3_inner
[b]
[]
END_3

Notice that $2 has been overwritten and that $3 is now undefined. 

Does anyone know of a way to preserve that back reference so you can
continue to access parts of a sting with out having to parse them out
into separate scalar variables?

Thanks,
Rob


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

Date: Tue, 14 Sep 2004 11:43:35 -0400
From: "Barry_Alder" <alder.bw@forces.gc.ca>
Subject: Running as a Service
Message-Id: <77c9249e04f203948ea7938f5baf34c5@localhost.talkaboutprogramming.com>

I have a PERL script that I want to run as a service in Windows NT4 and
2000, but it stops whenever I log off the server. While I'm logged on, it
works fine. I am using SRVANY.exe to run it. In the SRVANY documentation,
it mentions that I must be set up to ignore the CTRL_LOGOFF_EVENT.
Unfortunately, I haven't been able to find any documentation on how to do
this. Can someone point me in the right direction?

Thanks,

Barry



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

Date: Tue, 14 Sep 2004 15:56:53 GMT
From: "Ken Kast" <ken@NOSPAMkenkast.com>
Subject: SSI executing Perl
Message-Id: <9xE1d.6606$XW.1499@twister.socal.rr.com>

Using SSI I want to read a file on the server and pass the results, either 
as bytes or chars, back to a string on the web page.  Can a Perl script 
accomplish that, and what is the general technique?

Thanks. 




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

Date: Tue, 14 Sep 2004 19:06:18 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: SSI executing Perl
Message-Id: <pan.2004.09.14.17.06.17.920296@aursand.no>

On Tue, 14 Sep 2004 15:56:53 +0000, Ken Kast wrote:
> Using SSI I want to read a file on the server and pass the results,
> either as bytes or chars, back to a string on the web page.  Can a Perl
> script accomplish that [...]

Yes.

> [...] and what is the general technique?

Letting the server execute a Perl script.  Which means that this isn't
really a Perl question.


-- 
Tore Aursand <tore@aursand.no>
"The pure and simple truth is rarely pure and never simple." (Oscar
 Wilde)


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

Date: Tue, 14 Sep 2004 19:19:15 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: SSI executing Perl
Message-Id: <2qongiF12e8eiU1@uni-berlin.de>

Tore Aursand wrote:
> On Tue, 14 Sep 2004 15:56:53 +0000, Ken Kast wrote:
>> Using SSI I want to read a file on the server and pass the
>> results, either as bytes or chars, back to a string on the web
>> page.  Can a Perl script accomplish that [...]
> 
> Yes.
> 
>> [...] and what is the general technique?
> 
> Letting the server execute a Perl script.  Which means that this
> isn't really a Perl question.

True. As regards the non-Perl aspect of the problem, this page may be
useful: http://my.execpc.com/~keithp/bdlogcgi.htm

So, now all the OP need to do is writing the script. :)

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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


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