[23498] in Perl-Users-Digest
Perl-Users Digest, Issue: 5708 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 24 18:06:04 2003
Date: Fri, 24 Oct 2003 15:05:09 -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 Fri, 24 Oct 2003 Volume: 10 Number: 5708
Today's topics:
/o regex question <smackdab1@hotmail.com>
Re: /o regex question <glex_nospam@qwest.invalid>
Re: /o regex question <REMOVEsdnCAPS@comcast.net>
About Expect. <elp@pnsihq.com>
Accessing C struct members via T_PTROBJ <mshelor@comcast.removeme.net>
Awk commands in perl rmurthy60@hotmail.com
Re: Awk commands in perl <nobull@mail.com>
Re: Awk commands in perl <jurgenex@hotmail.com>
Re: Balanced Text?? <michael.p.broida@boeing_oops.com>
Compile perl with GDBM_File? (Ryan)
Re: Compile perl with GDBM_File? <mhunter@uclink.berkeley.edu>
Re: file redirect within back ticks not working <HelgiBriem_1@hotmail.com>
Re: Fill up HD fastest way (Roy Johnson)
getting security certificate expiration dates (Roy Johnson)
HTML::Table v2.00-beta released <a.peacock@chime.ucl.ac.uk>
Re: Increment a string and write it to a file after eac (john brown)
Re: matching ?? <glex_nospam@qwest.invalid>
Re: matching ?? <mchase@centellax.com>
Re: My Forking Server works in windows but not linux <jgibson@mail.arc.nasa.gov>
Re: Perl and IIS - script runs but 'The page cannot be <HelgiBriem_1@hotmail.com>
Re: Perl and IIS - script runs but 'The page cannot be <HelgiBriem_1@hotmail.com>
Re: Perl and IIS - script runs but 'The page cannot be <ebohlman@earthlink.net>
Re: Problem using Archive::Zip ! <ustsurge@mailcan.com_NOSPAM>
Re: Regex Help <ebohlman@earthlink.net>
Re: Regular Expression newbie help/question <REMOVEsdnCAPS@comcast.net>
Re: Regular Expression newbie help/question <HelgiBriem_1@hotmail.com>
Re: Simulating case sensitivity for win32 files (M&M)
Re: Simulating case sensitivity for win32 files (M&M)
Re: Taint - having some real trouble here, taint/perl e <HelgiBriem_1@hotmail.com>
Re: Taint - having some real trouble here, taint/perl e <kuujinbo@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 24 Oct 2003 11:02:01 -0700
From: "smackdab" <smackdab1@hotmail.com>
Subject: /o regex question
Message-Id: <PKdmb.42112$hp5.25973@fed1read04>
If I use the /o on a regex, is it available package wide for the
duration of the program or is it bound by some other scope???
I want to optimize a loop that parses lines from a file...
------------------------------
Date: Fri, 24 Oct 2003 14:29:17 -0500
From: "J. Gleixner" <glex_nospam@qwest.invalid>
Subject: Re: /o regex question
Message-Id: <h1fmb.836$jt6.29270@news.uswest.net>
smackdab wrote:
> If I use the /o on a regex, is it available package wide for the
> duration of the program or is it bound by some other scope???
>
> I want to optimize a loop that parses lines from a file...
Ya might want to look at using qr instead.
------------------------------
Date: Fri, 24 Oct 2003 15:26:43 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: /o regex question
Message-Id: <Xns941EA738295D4sdn.comcast@216.196.97.136>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
"smackdab" <smackdab1@hotmail.com> wrote in news:PKdmb.42112$hp5.25973
@fed1read04:
> If I use the /o on a regex, is it available package wide for the
> duration of the program or is it bound by some other scope???
>
> I want to optimize a loop that parses lines from a file...
/o means that the regex gets compiled once, and never again until the
program exits. There is no scope associated with it.
Internally, when a regular expression with the /o modifier is encountered,
the perl RE engine first compiles the regular expression, then patches the
OP tree so that the pattern does not get examined again (it's as if the
pattern is a constant string at that point).
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBP5mKz2PeouIeTNHoEQI3awCg5Ls01aDG1eaOpjdpwrzqSHXESQMAoOoN
YtBjtyEY9O0lE55cBybFO6sV
=feTi
-----END PGP SIGNATURE-----
------------------------------
Date: Fri, 24 Oct 2003 21:03:25 GMT
From: "Dr. Pastor" <elp@pnsihq.com>
Subject: About Expect.
Message-Id: <xsgmb.851$RQ1.638@newsread3.news.pas.earthlink.net>
Is there any published report about successful usage of Expect?
Thanks for any help!
------------------------------
Date: Fri, 24 Oct 2003 14:17:53 -0700
From: Mark Shelor <mshelor@comcast.removeme.net>
Subject: Accessing C struct members via T_PTROBJ
Message-Id: <JbidnaZOluCZCgSiRVn-jA@comcast.com>
I recently wrote a Perl extension in which h2xs pretty much handled all
the XS details for me. I now need to go back and access C struct
members from within Perl if possible.
The typemap file indicates that my struct pointer (SHA *) got mapped as
a T_PTROBJ. Is there any way I can use this info to do reads and writes
on the various struct members? Or, do I need to go back and write
accessor routines in C?
TIA, Mark
------------------------------
Date: 24 Oct 2003 10:08:11 -0700
From: rmurthy60@hotmail.com
Subject: Awk commands in perl
Message-Id: <4da2b83e.0310240908.797cd24f@posting.google.com>
How do i write awk commands in perl.
Can i do something like this system("awk '{print $3}'"); for example
or do i have to use qx or something else. I am not able to use any awk
commands.
Thanks
Raghu
------------------------------
Date: 24 Oct 2003 18:31:23 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Awk commands in perl
Message-Id: <u9he1y35lg.fsf@wcl-l.bham.ac.uk>
rmurthy60@hotmail.com writes:
> How do i write awk commands in perl.
a2p
Oh, sorry that's not the question you were asking. But come to think
of it, it probably is at least part of the answer to the question you
_should_ have been asking.
> Can i do something like this system("awk '{print $3}'"); for example
Well, obviously you'd have to remember that $ is meta in perl
double-qouted strings.
system("awk '{print \$3}'");
OR
system('awk','{print $3}');
But you could only do this if you wanted awk's STDIN and STDOUT to be
simply connected to the current process's STDIN and STDOUT and for the
current process to wait for the subprocess to finish.
This is an untterly improbable thing to want to do. The again piping
to or from the above script in Perl is an equally improbable thing to
want to do as it's trivial to do the same in thing directly in Perl.
> or do i have to use qx or something else.
If you want to redirect the STDIN and/or STDOUT of a child process in
Perl the you need something other than system(). This, of course, has
nothing to do with awk.
Have you considered reading the manual at all?
> I am not able to use any awk commands.
Why? What happens when you try? Do your hands rebel and refuse to
type the commands? It could be that your subcouncious knows you
should use Perl so is paralysing your hands.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 24 Oct 2003 17:37:36 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Awk commands in perl
Message-Id: <Ardmb.199$%e3.195@nwrddc03.gnilink.net>
rmurthy60@hotmail.com wrote:
> How do i write awk commands in perl.
>
> Can i do something like this system("awk '{print $3}'"); for example
> or do i have to use qx or something else. I am not able to use any awk
> commands.
Sure you can, why not?
But why not do the processing directly in Perl instead of shelling out an
external process to awk?
In any case, I have a certain feeling that maybe you don't understand what
$3 is. You are stringifying the argument to system.
Are you sure you want the third group that was matched in the last
successfull regular expression as an argument to the print statement for
awk? I.e. if your last successful RE was /(foo)(bar)(match)/ then your
system command would call
awk 'print{match}'
If you don't want stringification, then don't use it. Use e.g. single quotes
instead.
For further details please see "perldoc perlop", section "Quotes and
quotelike expressions"
See also "perldoc -q quote": "What's wrong with always quoting "$vars"?"
jue
------------------------------
Date: Fri, 24 Oct 2003 20:04:16 GMT
From: MPBroida <michael.p.broida@boeing_oops.com>
Subject: Re: Balanced Text??
Message-Id: <3F9985C0.78DC2F20@boeing_oops.com>
Tad McClellan wrote:
>
> MPBroida <michael.p.broida@boeing_oops.com> wrote:
>
> > I've seen this mentioned here before, but I can't find
> > the specific messages. It's not directly in the FAQ,
> > either,
>
> Yes it is.
Don't see it anywhere.
> > But I don't recall whether the package/module is:
> > Text::Balanced
> > or:
> > Balanced::Text
>
> perldoc -q Balanced
>
> Can I use Perl regular expressions to match balanced text?
But that perldoc section does NOT refer to either
"Balanced::Text" or "Text::Balanced", and that's
what I was hunting for: the real name of that module/
package/whatever it is.
Mike
------------------------------
Date: 24 Oct 2003 11:34:57 -0700
From: ryan_grace@yahoo.com (Ryan)
Subject: Compile perl with GDBM_File?
Message-Id: <ccc8e6c0.0310241034.6c0b94dc@posting.google.com>
My version of Perl, 5.8.1, doesn't seem to have GDBM_File installed,
even though GDBM_File can only be retrieved from CPAN by downloading
perl 5.8.0 or perl 5.8.1. I believe it is not installed, though GDBM
is installed on my machine and was available during the compile. I'm
wondering if there are specific flags I need to pass to configure.gnu
to make sure GDBM support is compiled in. Anyone know?
Thanks in advance,
Ryan
------------------------------
Date: Fri, 24 Oct 2003 20:18:38 +0000 (UTC)
From: Mike Hunter <mhunter@uclink.berkeley.edu>
Subject: Re: Compile perl with GDBM_File?
Message-Id: <slrnbpj25b.15r.mhunter@celeste.net.berkeley.edu>
On 24 Oct 2003 11:34:57 -0700, Ryan wrote:
> My version of Perl, 5.8.1, doesn't seem to have GDBM_File installed,
> even though GDBM_File can only be retrieved from CPAN by downloading
> perl 5.8.0 or perl 5.8.1. I believe it is not installed, though GDBM
> is installed on my machine and was available during the compile. I'm
> wondering if there are specific flags I need to pass to configure.gnu
> to make sure GDBM support is compiled in. Anyone know?
I went through a lot of crap with this also. If you're using freebsd, export
WITH_GDBM when you do a make in /usr/ports.
Why does freebsd exclude this by default? Is it some kind of licensing
problem?
Mike
------------------------------
Date: Fri, 24 Oct 2003 12:47:05 +0000
From: Helgi Briem <HelgiBriem_1@hotmail.com>
Subject: Re: file redirect within back ticks not working
Message-Id: <gc7ipvsvtf0096uqn213i2sq8s04ca61km@4ax.com>
On Thu, 23 Oct 2003 15:19:59 GMT, ktom <abc@nowhere.com> wrote:
>Tony Curtis wrote:
>> Is this a "stealth" CGI question?
>nope, nothing stealth about it..
>just plain old, where's the magic type question.
>
What Tony means is, "are you trying to run this
Perl script under CGI and not telling us about it?"
That's a "stealth CGI question".
CGI has a lot of special issues associated with it,
including permissions. CGI scripts run as a special
user (often named 'httpd', 'apache' or 'nobody')
with restricted privileges and an empty path
variable.
`sed -e 1,14d $file >> /tmp/junk`;
should be replaced by
system ("sed -e 1,14d $file >> /tmp/junk")
== 0 or die "Cannot run sed -e 1,14d $file >> /tmp/junk:$?";
(Why are you running sed to do something perl can
do easily?)
It is most likely that:
a) sed is not in path for httpd (give full path to sed)
b) httpd does not have permission to write to /tmp
c) httpd does not have permission to run sed. (chmod)
d) Your web server is misconfigured and you're not
running the script at all.
------------------------------
Date: 24 Oct 2003 12:29:41 -0700
From: rjohnson@shell.com (Roy Johnson)
Subject: Re: Fill up HD fastest way
Message-Id: <3ee08638.0310241129.3ecb4654@posting.google.com>
rjohnson@shell.com (Roy Johnson) wrote in message news:<3ee08638.0310231359.7b555097@posting.google.com>...
A bit less random, a lot faster:
## Adjust numbers to taste.
my $preroll=pack('C17000', map(int(rand(256)), 1..17000));
print substr($preroll, rand(16000), 1000) while 1;
------------------------------
Date: 24 Oct 2003 12:00:43 -0700
From: rjohnson@shell.com (Roy Johnson)
Subject: getting security certificate expiration dates
Message-Id: <3ee08638.0310241100.766b56fb@posting.google.com>
Ok, one posting eaten. Trying again:
My task is to check the expiration dates of security certificates, so
we'll know when we need to renew them. I'm not terribly SSL savvy, but
this should be really basic, right?
Web searches pointed me to Net::SSLeay, which I'm wading through
without getting a great understanding of what's important. I've built
some code by example, and would appreciate some input from those with
expertise, regarding:
- am I using the right module?
- am I using it appropriately (or, more likely, how far off-track am
I)?
Code:
use strict;
use warnings;
use Net::SSLeay qw(die_now die_if_ssl_error);
Net::SSLeay::load_error_strings();
Net::SSLeay::SSLeay_add_ssl_algorithms(); # Important!
Net::SSLeay::randomize();
my $cert_path = '/path/to/cert.pem';
my $key_path = '/path/to/notacakeynopass.pem';
my $ctx = Net::SSLeay::new_x_ctx() or die("Failed to create CTX $!");
Net::SSLeay::set_cert_and_key($ctx, $cert_path, $key_path);
my $ssl = Net::SSLeay::new($ctx) or die("Failed to create SSL $!");
my $cert = Net::SSLeay::dump_peer_certificate($ssl);
## Presumably, the expiration will be in here somewhere
print "Cert is ", length($cert), "bytes\n";
print $cert, "\n";
------------------------------
Date: Fri, 24 Oct 2003 11:53:54 GMT
From: Anthony Peacock <a.peacock@chime.ucl.ac.uk>
Subject: HTML::Table v2.00-beta released
Message-Id: <HnA54C.tHo@zorch.sf-bay.org>
***** Beta version (2.00-beta) released - 24 October 2003 *****
When I inherited this module, I didn't have the time or desire to
undertake a major rewrite. I mainly added features and fixed bugs
within the original design. Over the years of maintaining the module I
have often thought that the data representation used could be more
neat and logical. Some recent requests for features have led me to
rethink how the data in stored, and this beta version is the first
release with the new structure. I do not think that the changes will
affect the functionality of the module at all, but they will make
maintenance much easier. I have tested this version with all of my
tests and programs and have not found any problems, but I would be
grateful for as many people as possible to test the module with their
code and let me have any comments before I recommend it for production
use.
This module is available on CPAN and its mirrors
Beta test version (2003-10-24): 2.00-beta
http://cpan.perl.org/modules/by-authors/id/A/AJ/AJPEACOCK/HTML-Table-2.00-beta.tar.gz
Latest production version (2003-10-23): 1.20 (recomended for all
production environments)
http://cpan.perl.org/modules/by-authors/id/A/AJ/AJPEACOCK/HTML-Table-1.20.tar.gz
*** From the Readme ***
HTML::Table is used to generate HTML tables for CGI scripts. By using
the methods provided fairly complex tables can be created,
manipulated, then printed from Perl scripts. The module also greatly
simplifies creating tables within tables from Perl. It is possible to
create an entire table using the methods provided and never use an
HTML tag.
HTML::Table also allows for creating dynamically sized tables via its
addRow and addCol methods. These methods automatically resize the
table if passed more cell values than will fit in the current table
grid.
Methods are provided for nearly all valid table, row, and cell tags
specified for HTML 3.0.
------------------------------
Date: 24 Oct 2003 03:43:38 -0700
From: cglobal25@hotmail.com (john brown)
Subject: Re: Increment a string and write it to a file after each result.
Message-Id: <543320e0.0310240243.6e199001@posting.google.com>
"J. Gleixner" <glex_nospam@qwest.net> wrote in message news:<QgTlb.1589$4V5.16565@news.uswest.net>...
> john brown wrote:
> > This script receives input from the command line. I put in for
> > example "www.musicdownload.com/song1.mp3". The script looks for the
> > ".mp3" extension and increments the preceeding number to 10. This
> > works fine, printing the result to the screen. As you can see, I
> > would like to write the results to a file called "wget_input". Wget
> > reads from this file and the songs are retrieved. The problem I have
> > is with writing all of the results to the file, in this
> > case/www.musicdownload.com/song10.mp3" gets written to the file only.
> > I know it must be incremented and written after each result, but I
> > don't know how to go about constructing the loop. Any ideas?
> >
> >
> >
> > #! /usr/bin/perl -w
> > #
> > # mp3_search
> > #
> >
> > print "Input path to video archive\n";
> > $stdinput = <STDIN> ;
> > chomp ($stdinput);
> > $path = "$stdinput";
> >
> > $count = substr ($path, rindex ($path, ".mp3") - 1, 1);
> >
> > for ($count .. 10)
> > { substr ($path, rindex ($path, ".") - 1, 1, $count++); print
> > "$path\n"; }
> >
> > open (OUTPUTFILE,">wget_input")|| die "Failed to open
> > wget_input\n";
> >
> > printf OUTPUTFILE "$path";
> >
> > close OUTPUTFILE;
>
> In place of printing it to the screen, print it to your OUTPUTFILE in
> your loop. Using your code, that'd be something like:
>
> open (OUTPUTFILE,">wget_input")|| die "Failed to open wget_input: $!\n";
> #include reason
> for ($count .. 10)
> {
> substr ($path, rindex ($path, ".") - 1, 1, $count++);
> print OUTPUTFILE "$path\n";
> }
> close (OUTPUTFILE);
>
> I'd probably get the path, up to the integer, and then just print it and
> forget about the multiple calls to substr, or do the index once, and
> store it before the for loop.
>
> for ($count .. 10)
> {
> print OUTPUTFILE $new_path, $count++, ".mp3\n";
> }
Thanks for the help. Works like a charm.
------------------------------
Date: Fri, 24 Oct 2003 09:50:35 -0500
From: "J. Gleixner" <glex_nospam@qwest.invalid>
Subject: Re: matching ??
Message-Id: <0Yamb.805$jt6.14501@news.uswest.net>
Bernard El-Hagin wrote:
> tvn007@hotmail.com (Tim) wrote in news:21724be2.0310240043.3fdf1120
> @posting.google.com:
>
>
>>data: s1 s2 s3 0.900 0.890 0.588
>>data2: s1 s2 s3 2.900F 1.890F 0.888
>>data3: s1 s2 s3 1.900F 6.890F 0.388F
>>
>>My ReqX:
>>I would like to store the data in @name using the expression below:
>>@name = m/(\d+\.\d+)/g;
>>however, It does not ALWAYS work because for this case
>>
>>data2: s1 s2 s3 2.900F 1.890F 0.888
>>$name[0] = 2.900 but I want $name[0] = 2.900F
>>$name[1] = 1.890 but I want $name[1] = 1.890F
>>$name[2] = 0.888
>>
>>Please help.
Since it appears you want to capture the value in the columns 4-6, why
not use split?
$_ = '1 s2 s3 1.900F 6.890F 0.388F';
my (@name) = (split)[3,4,5];
print "@name\n";
1.900F 6.890F 0.388F
------------------------------
Date: Fri, 24 Oct 2003 18:16:13 GMT
From: mike <mchase@centellax.com>
Subject: Re: matching ??
Message-Id: <N%dmb.3125$746.2539@newssvr14.news.prodigy.com>
Bernard El-Hagin wrote:
> tvn007@hotmail.com (Tim) wrote in news:21724be2.0310240043.3fdf1120
> @posting.google.com:
>
>
>>data: s1 s2 s3 0.900 0.890 0.588
>>data2: s1 s2 s3 2.900F 1.890F 0.888
>>data3: s1 s2 s3 1.900F 6.890F 0.388F
>>
>>My ReqX:
>>I would like to store the data in @name using the expression below:
>>@name = m/(\d+\.\d+)/g;
>>however, It does not ALWAYS work because for this case
>>
>>data2: s1 s2 s3 2.900F 1.890F 0.888
>>$name[0] = 2.900 but I want $name[0] = 2.900F
>>$name[1] = 1.890 but I want $name[1] = 1.890F
>>$name[2] = 0.888
>>
>>Please help.
>
>
>
> So just add the possibility of F appearing after the number:
>
>
> @name = m/(\d+\.\d+F?)/g;
>
>
> If it's not always F you'll have to modify that depending on what can
> appear after the number.
>
>
> Cheers,
> Bernard
If it is not always F but just a single word char that may
or may not be there then
@name = m/(\d+\.\d+\w?)/g;
better yet you could just use:
@name = m/(\d+\.\w+)/g;
because \w matches word characters which include numerics
cheers
mike
PS the message with the split command is a good idea as well.
------------------------------
Date: Fri, 24 Oct 2003 10:05:45 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: My Forking Server works in windows but not linux
Message-Id: <241020031005454852%jgibson@mail.arc.nasa.gov>
In article <bn9kfm$rtr$1@news1.usf.edu>, bob Smith
<bobsmith(nospam)@bobsmith.com> wrote:
> I stole this example from a book and it works in windows but on Linux it
> shutdowns occasionally after the client connects. Any help would be
> appreciated.
> Linux OP Sys is Redhat ES 3.0:
>
> Here is the server:
>
> #!/usr/bin/perl -w
> # Forking server
>
> use IO::Socket;
> $SIG{CHLD} = sub {wait ()};
> $main_sock = new IO::Socket::INET (LocalHost => '0.0.0.0',
> LocalPort => 5150,
> Listen => 5,
> Proto => 'tcp',
> Reuse => 1,
> );
> die "Socket could not be created. Reason: $!\n" unless ($main_sock);
> while ($new_sock = $main_sock->accept()) {
> $pid = fork();
> die "Cannot fork: $!" unless defined($pid);
> if ($pid == 0) {
> # Child process
> while (defined ($buf = <$new_sock>)) {
> # do something with $buf ....
> print $new_sock "You said: $buf\n";
> }
> $new_sock->shutdown(0);
> $new_sock->send("000065TCP FEDI
> HELLO");
> $new_sock->shutdown(2);
> exit(0); # Child process exits when it is done.
> } # else 'tis the parent process, which goes back to accept()
> }
> close ($main_sock);
>
> Here is the client:
>
> #!/usr/bin/perl -w
> use IO::Socket;
> $sock = new IO::Socket::INET (PeerAddr => 'localhost',
> PeerPort => 5150,
> Proto => 'tcp'
> );
> die "Socket could not be created. Reason: $!\n" unless $sock;
> foreach (1 .. 10) {
> print "Hello $_: \n";
> print $sock "Msg $_: How are you?\n";
> #$sock->flush();
> }
> $sock->shutdown(1);
> $sock->flush();
> my $line;
> while (defined($line = <$sock>)) {
> print $line;
> }
> close ($sock);
>
Your server program should be able to accept a null return from the
accept call and keep going. Since you are handling and not ignoring
child signals, the accept statement will be interrupted and return a
null socket when a child signal is received. This is normal unix
behaviour. Your process should just re-execute the accept.
Try this as the server loop:
while (1) {
$new_sock = $main_sock->accept();
if( $new_sock ) {
$pid = fork();
die "Cannot fork: $!" unless defined($pid);
if ($pid == 0) {
# Child process
while (defined ( my $buf = <$new_sock>)) {
# do something with $buf ....
print $new_sock "You said: $buf\n";
}
$new_sock->shutdown(0);
$new_sock->send("000065TCP FEDI HELLO");
$new_sock->shutdown(2);
exit(0); # Child process exits when it is done.
} # else 'tis the parent process, which goes back to accept()
}else{
print "Null return from accept: $!";
}
}
------------------------------
Date: Fri, 24 Oct 2003 11:51:01 +0000
From: Helgi Briem <HelgiBriem_1@hotmail.com>
Subject: Re: Perl and IIS - script runs but 'The page cannot be displayed'
Message-Id: <rc4ipvcfiq321n59bn804h6merb8ha62qh@4ax.com>
On Thu, 23 Oct 2003 16:24:19 GMT, "Jürgen Exner"
<jurgenex@hotmail.com> wrote:
>Well, once you've installed ActivePerl you may want to check
>"perldoc -q 500". It might be an eye opener.
Finally somebody put the poor sod out of his misery
and threw him a titbit that will actually help.
I think this "off-topic newbie baiting" sometimes
gets a little out of hand.
At least start with "perldoc -q 500" when one of these
clueless people arrives here each week. I mean, he
shouldn't have to read 30 posts before he gets told
to RTFM.
------------------------------
Date: Fri, 24 Oct 2003 11:53:33 +0000
From: Helgi Briem <HelgiBriem_1@hotmail.com>
Subject: Re: Perl and IIS - script runs but 'The page cannot be displayed'
Message-Id: <fk4ipv433atv5obpfanj1alnlb6b7rmtd5@4ax.com>
On 23 Oct 2003 02:22:26 -0700, stewart@webslave.dircon.co.uk (stew
dean) wrote:
>> > I've never run a perl script at the command line.
>>
>> Why not?
>
>Because I've never had to. Why would I want to?
I've been hovering over whether to killfile you for
cluelessness or not. You have removed all doubt.
<PLONK>
------------------------------
Date: 24 Oct 2003 19:58:12 GMT
From: Eric Bohlman <ebohlman@earthlink.net>
Subject: Re: Perl and IIS - script runs but 'The page cannot be displayed'
Message-Id: <Xns941E9A45111B0ebohlmanomsdevcom@130.133.1.4>
stewart@webslave.dircon.co.uk (stew dean) wrote in
news:2b68957a.0310230122.5e72c4f4@posting.google.com:
>> Hum ... are you outputing the correct HTTP header?
>
> Yes.
Are you sure about that? Have you actually *seen* the correct HTTP header
being output? Or do you mean "I've written the code to output the correct
HTTP header"? Between those two concepts lies a space that's often
inhabited by a guy named Murphy.
------------------------------
Date: Fri, 24 Oct 2003 14:40:01 GMT
From: Ej <ustsurge@mailcan.com_NOSPAM>
Subject: Re: Problem using Archive::Zip !
Message-Id: <61a8bde58a3ae71a347da52a73009cb8@news.bubbanews.com>
"J. Gleixner" <glex_nospam@qwest.invalid> wrote in
news:99Wlb.2251$4V5.29115@news.uswest.net:
> Ej wrote:
>> This does not work, Why?
>>
>> @fla=('/root/name/dir1','/root/name/dir2');
>>
>> foreach $ia (@fla){
>>
>> print "adding $ia<br>";
>> $status=$zip->addTree( "$ia","$ia" );
>> $status->desiredCompressionMethod( COMPRESSION_DEFLATED );
>> $status->desiredCompressionLevel(5);
>>
>> }
>>
>> I get this message:
>> Can't call method "desiredCompressionMethod" without a package or
>> object reference at zp1.pl line 38.
>>
>>
>> however, this does work,
>>
>> foreach $ia (@fla){
>>
>> print "adding $ia<br>";
>> $status=$zip->addTree( "$ia","$ia" );
>> }
>>
>> how can I fix the first code?
>
> What's $status???.. hint.. it's not an object, which is what the error
> is telling you. It's what addTree returns, which, according to the
> documentation, is "AZ_OK". Use the Archive::Zip object, which, since
> you didn't show it's creation in your posted code, I assume is $zip.
>
> $zip->desiredCompressionMethod(...);
>
Hi, I tried that as well as other things but get the same error,
can someone PLEASE post an example code using $zip->addTree('','')
that works or maybe this is a bug in Archive::Zip, that does not work.
thank you.
------------------------------
Date: 24 Oct 2003 21:31:50 GMT
From: Eric Bohlman <ebohlman@earthlink.net>
Subject: Re: Regex Help
Message-Id: <Xns941EAA254BA02ebohlmanomsdevcom@130.133.1.4>
rmurthy60@hotmail.com wrote in
news:4da2b83e.0310230545.27f025a4@posting.google.com:
> next if s?\([ /]\)\./?\1?g;
You're forgetting that in Perl, unlike sed, unescaped parentheses are
capture/grouping metacharacters and escaped parentheses match literal
parentheses. Your regex doesn't capture anything.
Whoever came up with the idea of using escaped parentheses as
metacharacters should be required to read Gerald Weinberg's _The Psychology
of Computer Programming_, particularly the section on "Programming as an
Individual Activity." It works against, rather than with, the mind's
ability to generalize. "Everything matches literally expect for these
metacharacters: ..., and you can force any of them to be treated literally
by escaping them" is a nice general rule (Larry Wall obviously felt that
way). Making escaping behave one way for every metacharacter except
parentheses and the exact opposite way for parentheses simply increases the
cognitive load of writing a regex.
------------------------------
Date: Fri, 24 Oct 2003 08:46:37 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Regular Expression newbie help/question
Message-Id: <Xns941E6364B1604sdn.comcast@216.196.97.136>
sventore@gmx.net (Sven) wrote in news:ad7279fb.0310231202.3fcc779
@posting.google.com:
> Hi,
> I need some assistance on a search and replace issue with a
> commaseparated file.
> I need to replace all commas(,) on every lines EXCEPT those that occur
> within doublequotes (",")
Please read the FAQ before posting. Thanks.
--
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
------------------------------
Date: Fri, 24 Oct 2003 14:15:48 +0000
From: Helgi Briem <HelgiBriem_1@hotmail.com>
Subject: Re: Regular Expression newbie help/question
Message-Id: <6jcipvciu1hl80l2jm26k6f0ldcagpipo3@4ax.com>
On Fri, 24 Oct 2003 08:46:37 -0500, "Eric J. Roode"
<REMOVEsdnCAPS@comcast.net> wrote:
>sventore@gmx.net (Sven) wrote in news:ad7279fb.0310231202.3fcc779
>@posting.google.com:
>
>> Hi,
>> I need some assistance on a search and replace issue with a
>> commaseparated file.
>> I need to replace all commas(,) on every lines EXCEPT those that occur
>> within doublequotes (",")
>
>Please read the FAQ before posting. Thanks.
While I will usually be the first one to recommend
reading the documentation, the least you could do
is point the OP to the relevant bit of documentation
as it is far from easy to find.
"How can I split a [character] delimited string except
when inside [character]?"
The relevant section is in perlfaq4 and can be read
either by browsing through that document:
perldoc perlfaq4
or, searching for it within the perlfaq documents:
perldoc -q split
or
perldoc -q delimited
------------------------------
Date: 24 Oct 2003 10:12:28 -0700
From: mm-24@pobox.com (M&M)
Subject: Re: Simulating case sensitivity for win32 files
Message-Id: <19372e8e.0310240912.2f23179a@posting.google.com>
rjohnson@shell.com (Roy Johnson) wrote in message news:<3ee08638.0310231330.43ba0be8@posting.google.com>...
I appreciate the comments, but this isn't really what I'm after. I'm
looking for a case sensitive "-f" option so I can do something like
this:
if (-f "/Very/Long/Path/To/file.htm")...
Or at least use a function to retrieve the native pathname from the
os:
print realname("c:/very/long/path/to/file.htm");
yeilding
C:/Very/Long/Path/To/file.htm
I searched all the win32 modules on cpan, but I found nothing that
seems to do this. I posted the sample code merely as a proof of
concept that it is theoretically possible though highly inefficient
and impractical - nor does it handle case sensitivity of directories.
Using my method, I would need to read /, /Very, /Very/Long,
/Very/Long/Path.... It quickly becomes obvious that reading each
directory is not the solution. (I hope!)
And caching really isn't an option for me because it assumes that
files will not change. Even if the script handled the complexity of
maintaining the cache as it changed files, it doesn't take into
account multiple threads/processes or file changes by external
processes.
Marco Moreno
------------------------------
Date: 24 Oct 2003 13:37:14 -0700
From: mm-24@pobox.com (M&M)
Subject: Re: Simulating case sensitivity for win32 files
Message-Id: <19372e8e.0310241237.671c9fa@posting.google.com>
Ahhh!!! I found Win32::GetLongPathName() that returns the actual
path! I didn't realize this was in the Win32 core module.
Marco
------------------------------
Date: Fri, 24 Oct 2003 11:58:39 +0000
From: Helgi Briem <HelgiBriem_1@hotmail.com>
Subject: Re: Taint - having some real trouble here, taint/perl experts, please help
Message-Id: <mt4ipvs1baaq2fv8h96pjgdkkufqqclj8v@4ax.com>
On 22 Oct 2003 10:39:43 -0700, 2stormts@nemontel.net (Ben) wrote:
>"A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu> wrote in message news:<Xns941BA67685B38asu1cornelledu@132.236.56.8>...
>
>> What is the error message?
>
>There is no error message. system() returns zero, and $! is empty.
Error messages from programs run under system are not
returned in $!. They are in $?.
system ($cmd) = 0 or die "Cannot run $cmd:$?\n";
------------------------------
Date: Fri, 24 Oct 2003 21:22:56 +0900
From: ko <kuujinbo@hotmail.com>
Subject: Re: Taint - having some real trouble here, taint/perl experts, please help
Message-Id: <bnb5je$svq$1@pin3.tky.plala.or.jp>
Helgi Briem wrote:
> On 22 Oct 2003 10:39:43 -0700, 2stormts@nemontel.net (Ben) wrote:
>
>
>>"A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu> wrote in message news:<Xns941BA67685B38asu1cornelledu@132.236.56.8>...
>>
>>
>>>What is the error message?
>>
>>There is no error message. system() returns zero, and $! is empty.
>
>
> Error messages from programs run under system are not
> returned in $!. They are in $?.
>
> system ($cmd) = 0 or die "Cannot run $cmd:$?\n";
^^^
i think you forgot a '=' :)
system ($cmd) == 0 or die "Cannot run $cmd:$?\n";
keith
------------------------------
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.
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 5708
***************************************