[8341] in Perl-Users-Digest
Perl-Users Digest, Issue: 1958 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 23 14:12:59 1998
Date: Mon, 23 Feb 98 11:00:53 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 23 Feb 1998 Volume: 8 Number: 1958
Today's topics:
Re: a beginner's question... (Jonathan Feinberg)
a match problem <wangli@nortel.ca>
Re: Beginner in trouble (Jonathan Feinberg)
Disk-Usage under NT4.0 <burkhard.kiesel@med.siemens.de>
Re: emacs??? <eriko@austin.ibm.com>
File marker position on partial reads craig@synapse-group.com
FTP files without Net::FTP? <ptbs@ping.be>
Re: Hangs with sendmail ... <friedman@uci.edu>
Re: Hangs with sendmail ... <tchrist@mox.perl.com>
Re: Hangs with sendmail ... (Jonathan Feinberg)
Re: Hangs with sendmail ... <jquinn@shell7.ba.best.com>
Re: help with global variables needed (Terry von Gease)
Help! CGI Registry Editing <sales@acceltec.com>
How to synchronize multiple writes to a file? jckwong@hotmail.com
I really need your help. <seong@cse.bridgeport.edu>
Re: if (-d $filename) in Win32 (Andrew M. Langmead)
Re: if (-d $filename) in Win32 (Andrew M. Langmead)
Re: if (-d $filename) in Win32 <bill@astro.fccj.cc.fl.us>
indirect object <stvhoof@netvision.net.il>
Re: Is the PERL 5 Year 2000 compliance ? (Abigail)
Is there a "STDOUT/PIPE not available" error ? (Patrick)
Re: Law-enforcement apps ? (Jonathan Feinberg)
Re: Mail Attachments via Perl Sendmail A REAL ANSWER! (Jonathan Feinberg)
recommend a db for Win95 for web apps <j.garcia@lmco.com>
Re: Runtime building of search expression (Jonathan Feinberg)
Re: Runtime building of search expression <friedman@uci.edu>
Send email from Perl on NT platform <rickryan@datrixnet.com>
shell expension in system function <bruno_pagis@aur.alcatel.com>
Re: shell expension in system function <tchrist@mox.perl.com>
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
The Ineffable Tom C. <rmelson@pswtech.com>
Re: Uninitialized value chunk error (Jonathan Feinberg)
Update another frame from Perl script. <rickryan@datrixnet.com>
Re: vec builtin function (Tor Iver Wilhelmsen)
why no Case statment? <stvhoof@netvision.net.il>
Re: Why not RegEx in $/? (Jonathan Feinberg)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 23 Feb 1998 10:35:25 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: a beginner's question...
Message-Id: <MPG.f5b6149f40cf72f98973a@news.concentric.net>
Christian.Khoury@inria.fr said...
: hi, is there a way to force Perl do "unsigned long" arithmetic
: operations ?
What is it you're really trying to do?
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Mon, 23 Feb 1998 11:51:04 -0500
From: "Liming Wang" <wangli@nortel.ca>
Subject: a match problem
Message-Id: <6cs9jq$d3h@nbdchc4.bnr.ca>
Hello,
#!/usr/bin/perl
$a = '/Foo$(xyz)';
$b = '/A /B /Foo$(xyz) /c';
print "ok\n" if $a =~ $b;
please point out why the match does not work. TIA
background: perl 5.004_02 on NT
------------------------------
Date: Mon, 23 Feb 1998 10:53:45 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Beginner in trouble
Message-Id: <MPG.f5b6593f8b091ec98973d@news.concentric.net>
[courtesy cc of this posting sent to cited author via email]
alberto.turon@posta.unizar.es said...
: My script has to read several files and match two strings, returning the
: number of lines that contain both strings. Why doesn4t the following
: code run?
Hola, Alberto. In the future, when you post code that doesn't work, it would
be very helpful to us if you'd include the error messages given by perl. Make
sure that the first line of your script looks something like
#!/path/to/perl -w
I notice that you're using relative paths (they contain '../..'). I wonder if
you ought to use absolute paths, instead. Better yet, maybe your program
should take the logfile path as a parameter on the command line. That will
make your program more portable.
I also noticed that you use a couple of variables that have never been
initialized ($inifile and $endfile). Maybe your code sample is incomplete; I
don't know.
Finally, when you readdir(), you'll want to discard the directory entries for
current directory and parent directory. Here's one technique for doing so:
@ls = grep {!/^\.\.?$/} readdir DIR;
Check all of these things, and maybe that will give you enough information to
solve the problem yourself. Also, learn to use the perl debugger! It's very
helpful. I hope this helps.
--
#!/usr/bin/perl -w -- Just another Perl hacker,
(open 0),$_=<0>,s,.*- +,,,chop;for(split?@*?){($$_++or$}=$_,y,y \,\
y,<STDIN>,,$$=~s\^\"sub $_ {print'$}'};7"\ee),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Mon, 23 Feb 1998 17:22:07 +0100
From: "Burkhard Kiesel" <burkhard.kiesel@med.siemens.de>
Subject: Disk-Usage under NT4.0
Message-Id: <6cs7hs$8s6$1@med-iss3.med.siemens.de>
Is there a way to calculate a Disk-Usage under NT4.0, which says there are
e.g. 66% of Partition "C:" used.
Where did I get the maximum size of the partition ?
Please answer to burkhard.kiesel@med.siemens.de
------------------------------
Date: 23 Feb 1998 09:37:31 -0600
From: Erik OShaughnessy <eriko@austin.ibm.com>
Subject: Re: emacs???
Message-Id: <uflnv2fi2s.fsf@majestic.austin.ibm.com>
Carey Evans <c.evans@clear.net.nz> writes:
>
> You also get a good idea after doing (paren-set-mode 'paren) when it
> displays in red instead of green, or in the wrong place.
>
I tried this under emacs 20.2 and the perl-mode that ships with that
distribution ( derived from the old c-mode.pl circa '87 ), and that
function wasn't to be found. I'm curious if you are using a different
(possibly better) perl-mode or you are using xemacs?
Either way, it would be nice ot know..
regards
ejo
--
Erik O'Shaughnessy:eriko at austin.ibm.com:[838|678]-2622:bldg 902/2D014
Performance Tool Development Team:Division Formerly Known As RS/6000:IBM
------------------------------
Date: Mon, 23 Feb 1998 11:42:43 -0600
From: craig@synapse-group.com
Subject: File marker position on partial reads
Message-Id: <6cscej$bnq$1@nnrp2.dejanews.com>
I'm working on a quick-and-dirty project in which I'm sysread'ing through a
file. My question is this: if I hit a partial read condition (e.g., only six
bytes of ten are written), where will the file marker end up?
Example: (X is a byte block; ^ is the file marker)
Before the read, the marker is on the first byte...
X X X X X X X X X X X X X X X
^
After reading six (of ten) bytes, is the marker on the sixth byte?
X X X X X X X X X X X X X X X
^
...Or on the seventh?
X X X X X X X X X X X X X X X
^
...Or does it skip all the way to the last byte after the last specified byte
(the eleventh, in this case)?
X X X X X X X X X X X X X X X
^
If I'm attempting to recover from a partial read, is there any need to reset
the file marker, or can I just go ahead and read (X-N) bytes, where X is the
total number of bytes to read, and N is the number of bytes actually read?
Any help is appreciated. I don't know of any way to simulate a partial read
condition, so I'm guessing my way around until then.
Thanks,
-------------
Craig Mertens
craig<at>synapse-group<dot>com
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Mon, 23 Feb 1998 17:21:42 +0100
From: PTBS <ptbs@ping.be>
Subject: FTP files without Net::FTP?
Message-Id: <34F1A216.772B75F@ping.be>
First I want to thank you for your reactions.
But my problem is't solved yet. I can't run the "make"-command, so I can't
install the Net::FTP library in my own directory. I'm running my scripts on
a UNIX server, so I think I can't use John Kelly's idea. I tried to put the
modules above my script, but the modules are one big web, so I can't make it
work.
Is now the only solution changing from provider?
Greetings,
Wouter Van Beneden
a student working on a project for PTBS as thesis.
------------------------------
Date: 23 Feb 1998 15:16:49 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: Hangs with sendmail ...
Message-Id: <6cs3t1$6ap@news.service.uci.edu>
In article <6cre8b$jmj$1@nntp1.ba.best.com>,
Greg <jquinn@shell7.ba.best.com> wrote:
<Hi,
<
<Hoping someone can help me with this; I have a simple perl
<cgi script that attempts to send an email through sendmail
<but the bloody thing hangs when run either from the unix
<command line or through a web server.
<
<The code is shown below:
<
<----------------------------------------------------------
<open(MAIL, "| /usr/lib/sendmail $user\@college.org");
<print MAIL "Date: $date\n";
<print MAIL "From: admin\@college.org\n";
<print MAIL "To: $user\@college.org\n";
<print MAIL "Subject: A test\n\n";
<print MAIL "Dear $desc,\n\n";
<print MAIL "This is a test";
<print MAIL "Goodbye!";
<close(MAIL);
<----------------------------------------------------------
Your problem is with sendmail, not perl. Most folks do this as
follows:
# Always, always ALWAYS check your return value on open!!!
open MAIL "|/usr/lib/sendmail -oi -t" || die "Can't open sendmail $!";
print MAIL <<EOF;
To: blah blah
From: blah blaaah
...
EOF
close MAIL
you could also use one of the modules on CPAN that do this for you, BTW,
and you could do it with an IO::Handle if you needed to pass around
a reference to your mail handle.
--
Eric D. Friedman
friedman@uci.edu
------------------------------
Date: 23 Feb 1998 16:03:20 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Hangs with sendmail ...
Message-Id: <6cs6k8$8v9$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, jdf@pobox.com (Jonathan Feinberg) writes:
:You forgot to see if the pipe opened:
: open(MAIL, "| /usr/lib/sendmail $user\@college.org") or die "$!";
That doesn't help. Just because the fork worked, doesn't mean
the exec did.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
A formal parsing algorithm should not always be used.
--D. Gries
------------------------------
Date: Mon, 23 Feb 1998 10:37:06 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Hangs with sendmail ...
Message-Id: <MPG.f5b61ad3d9860eb98973b@news.concentric.net>
[courtesy cc of this posting sent to cited author via email]
jquinn@shell7.ba.best.com said...
: open(MAIL, "| /usr/lib/sendmail $user\@college.org");
You forgot to see if the pipe opened:
open(MAIL, "| /usr/lib/sendmail $user\@college.org") or die "$!";
--
#!/usr/bin/perl -w -- Just another Perl hacker,
(open 0),$_=<0>,s,.*- +,,,chop;for(split?@*?){($$_++or$}=$_,y,y \,\
y,<STDIN>,,$$=~s\^\"sub $_ {print'$}'};7"\ee),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: 23 Feb 1998 17:08:03 GMT
From: Greg <jquinn@shell7.ba.best.com>
Subject: Re: Hangs with sendmail ...
Message-Id: <6csadj$21r$1@nntp1.ba.best.com>
Thansk for this info;
I should also have added in my original post that although the script
hangs when piping to sendmail, it actually always works; the mail message
is sent but the thing still hangs. I did a truss on the script and it
looked to me like perl was waiting for a process signal to return but it
didn't and there was a waitpid (sleep) process evident. I heard somewhere
that signal handling in perl wasn't so good and figured it was just this,
or maybe with sendmail.
Eric D. Friedman <friedman@uci.edu> wrote:
> In article <6cre8b$jmj$1@nntp1.ba.best.com>,
> Greg <jquinn@shell7.ba.best.com> wrote:
> <Hi,
> <
> <Hoping someone can help me with this; I have a simple perl
> <cgi script that attempts to send an email through sendmail
> <but the bloody thing hangs when run either from the unix
> <command line or through a web server.
> <
> <The code is shown below:
> <
> <----------------------------------------------------------
> <open(MAIL, "| /usr/lib/sendmail $user\@college.org");
> <print MAIL "Date: $date\n";
> <print MAIL "From: admin\@college.org\n";
> <print MAIL "To: $user\@college.org\n";
> <print MAIL "Subject: A test\n\n";
> <print MAIL "Dear $desc,\n\n";
> <print MAIL "This is a test";
> <print MAIL "Goodbye!";
> <close(MAIL);
> <----------------------------------------------------------
> Your problem is with sendmail, not perl. Most folks do this as
> follows:
> # Always, always ALWAYS check your return value on open!!!
> open MAIL "|/usr/lib/sendmail -oi -t" || die "Can't open sendmail $!";
> print MAIL <<EOF;
> To: blah blah
> From: blah blaaah
> ...
> EOF
> close MAIL
> you could also use one of the modules on CPAN that do this for you, BTW,
> and you could do it with an IO::Handle if you needed to pass around
> a reference to your mail handle.
> --
> Eric D. Friedman
> friedman@uci.edu
------------------------------
Date: 23 Feb 1998 15:49:45 GMT
From: twv@rose.hp.com (Terry von Gease)
Subject: Re: help with global variables needed
Message-Id: <6cs5qp$mbp$1@rosenews.rose.hp.com>
Thanks for the cogent explanation. I am, however, lect with a couple
of questions that niggle at me...
Tom Christiansen (tchrist@mox.perl.com) wrote:
> [courtesy cc of this posting sent to cited author via email]
>Here's what you should do:
>The file mymain should be executable, and contain:
> # mymain - primary executable
> package main; # superfluous because it's the executable
> use strict;
> use MainVars;
> use MyMod1;
> use MyMod2;
>The file MainVars.pm should contain:
> # MainVars.pm
> package MainVars;
> use strict;
> require Exporter;
> use vars qw/@ISA @EXPORT/;
I think I understand the need for this declaration but why is it that
all works well without it? In retrospect I would have thought that
perl would have thrown up wiht the @ISA =... and @EXPORT =... lines
using strict. This doesn't seem to be the case and one wonders why.
I have a number of modules that use strict and assign to @ISA and
@EXPORT without benefit of having these two items declared in a
'use vars' statement. Curious.
> @ISA = qw(Exporter);
> use vars qw/$var1 $var2 $gvar/;
> @EXPORT = qw/$var1 $var2 $gvar/;
> $var1 = 'init';
> $var2 = 'init';
> $gvar1 = 'init';
> 1;
My second question is what is the net effect if I were to invoke mymain.pl
in the following fashion...
mymain.pl -var1='twas' -var2='brillig'
>The file MyMod1.pm should contain:
> # MyMod1.pm
> package MyMod1;
> use strict;
> use MainVars;
> # now you may access MainVar's $var1 $var2, and $var3
>The file MyMod2.pm should contain:
> # MyMod2.pm
> package MyMod2;
> use strict;
> use MainVars;
> # now you may also access MainVar's $var1 $var2, and $var3
--
Terry A proper signature should sum up one's entire
philosophy and, at the same time, cause anyone who
reads it to question everything in which they
believe.
------------------------------
Date: Mon, 23 Feb 1998 11:03:45 -0500
From: "John C. Marsella" <sales@acceltec.com>
Subject: Help! CGI Registry Editing
Message-Id: <34F19DE1.797B@acceltec.com>
Solution Needed!!
I need to know if it is possible to run a compiled
c program (or perl, java, javascript, any web related programming
language!) on a unix machine during a web session
that can use an environment variable(s) to enter the user's registry and
read keys and values...?
I once visited a site that could tell what type of machine
I was using, what type of modem, how much RAM I had and other such
things.
I have used the standard CGI %ENV variables to the limit and those
will not perform the magic I need...
If you can help you will be compensated financially as well
as receive great credit through the use of banner ads!
E-Mail a solution to john@acceltec.com
Thanks,
Jon C. Marsella
Webmaster
1998 Winter Olympic Website
www.cbc.sympatico.ca
------------------------------
Date: Mon, 23 Feb 1998 10:23:39 -0600
From: jckwong@hotmail.com
Subject: How to synchronize multiple writes to a file?
Message-Id: <6cs7qa$6h$1@nnrp2.dejanews.com>
Hi,
Can someone give me an example of how to synchronize multiple writes from many
instances of a perl script, to a file? I know there's a command called
"select", but if I do:
($nfound, $timeleft) = select(undef, $win, undef, $timeout
if ($nfound) {
print FILEHANDLE $stuff; ## What if $win is not ready anymore
## two statements later??
}
I tried playing with flock instead, but wasn't successful either.
Anyone who have any examples? Helps are greatly appreciated.
I tried the FAQ but didn't find what I want.
John
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Mon, 23 Feb 1998 11:26:14 -0500
From: "Seong Y. Kim" <seong@cse.bridgeport.edu>
Subject: I really need your help.
Message-Id: <34F1A326.FFF924A1@cse.bridgeport.edu>
I have a big problem with my perl sub routine.
My sub routine will search all of the html files within /home/bunny
directory that has the names of users.
After certain numbers of users, the output says "can't open /home/bunny/
username". I should be able to open them.
I don't really know what's wrong with my sub routine. Please help me.
Thanks.
&find_file_dir("/home/bunny");
sub find_file_dir{
#initializing local variable $locdir, @locfile, $rdir, $one,
#$rea_locdir, $eone, @list_html
local ($locdir) = @_; #parameter.
local (@locfile, $rdir);
local ($one, $rea_locdir, $eone, @list_html);
local (*OD);
chdir $locdir; #change current directory to
$locdir.
if (opendir(OD, $locdir)){
@locfile = readdir(OD);
print "$locdir\n";
@list_html = grep /\.HTML?$|\.html?$/, @locfile;
foreach $one (@list_html){ #print the list of html file
within
#local directory, if readable.
if (-r $one){
print "$one\t ";
}
}
foreach $eone (sort @locfile){ #
if (-d $eone && -r $eone) {
unless($eone=~/^\.$/ or $eone =~/^\.\.$/){
&find_file_dir($locdir."/".$eone);
#calling a subroutine
}
}
}
print "\n";
close (OD);
}
else {
print "can't open dir $locdir\n";
}
chdir "..";
}
------------------------------
Date: Mon, 23 Feb 1998 15:33:20 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: if (-d $filename) in Win32
Message-Id: <Eou8JL.5p8@world.std.com>
Bill Jones <webmaster@fccj.cc.fl.us> writes:
>Hmmm, maybe I missed something, but
>either should work, IE -
Yes, both Jonothan and myself were agreeing that it would work. My
correction was just to the statement that "perl fixes" the path
separator "on all platforms." In truth, Perl just passes the strings
given to it to the operating system, and the MS-DOS kernel treats
forward and back slashes iterchagably.
Then Jonathan said that he didn't understand, COMMAND.COM treats the
forward slash as a option specifier. I then wrote this post trying to
explain how COMMAND.COM is not the operating system itself, just a
program that makes calls to the operating system.
I'm sorry that my message did not do a good job of explaining my
point. If you have a moment, could you point out where in my post I
give the mistaken impression that only forward slashes (or only
backslashes I'm not sure which one you though I was arguing for) would
work. If I see where my writing was unclear, it may help me to avoid
similar mistakes in the future.
By the way, your code has a bug. Since you put the string c:\Temp in a
double quoted string, backslash escapes are interpreted. This turns
"c:\Temp" into the same thing "c:Temp" (Since "\T" is not a known
escape sequence, the single backslash is simply removed.) This means
that if you run the code from a directory that has a subdirectory name
"Temp" then it will work, but the two tests are only equal when the
script is run in the root directory.
If your script had used a lower case "t", the bug would have been even
more apparent. Since it would have turned "c:\tmp" into the
characters, "c", ":", a tab character, "m", and "p". Since I believe a
tab characters is not valid in file and directory names under MS-DOS
and similar Microsoft developed operating systems, it couldn't match
any directory.
>#!perl -w
>print 'I am looking for C:\/(?)Temp' . "\n\n";
>print 'Found it as C:/Temp! ' if (-d "c:/Temp");
>print 'Still there as C:\Temp...' if (-d "c:\Temp");
--
Andrew Langmead
------------------------------
Date: Mon, 23 Feb 1998 15:35:51 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: if (-d $filename) in Win32
Message-Id: <Eou8nr.7o8@world.std.com>
jdf@pobox.com (Jonathan Feinberg) writes:
>webmaster@fccj.cc.fl.us said...
>: print 'Still there as C:\Temp...' if (-d "c:\Temp");
>You really have a folder called "c:Temp" ? (You didn't escape your backslash!)
Depends on where the currect directory for drive C: is when he ran the
script. It will match the same directory as c:/Temp when the currect
directory is the root.
--
Andrew Langmead
------------------------------
Date: Mon, 23 Feb 1998 12:33:34 -0500
From: "Bill Jones, FCCJ Webmaster" <bill@astro.fccj.cc.fl.us>
Subject: Re: if (-d $filename) in Win32
Message-Id: <34F1B2EE.EAF0C6EF@astro.fccj.cc.fl.us>
Andrew M. Langmead wrote:
>
> jdf@pobox.com (Jonathan Feinberg) writes:
>
> >webmaster@fccj.cc.fl.us said...
>
> >: print 'Still there as C:\Temp...' if (-d "c:\Temp");
>
> >You really have a folder called "c:Temp" ? (You didn't escape your backslash!)
>
> Depends on where the currect directory for drive C: is when he ran the
> script. It will match the same directory as c:/Temp when the currect
> directory is the root.
>
> --
> Andrew Langmead
Oops, my bad ;-)
But my point is still valid :-)
Bill
------------------------------
Date: Mon, 23 Feb 1998 19:44:59 +0200
From: Tzadik Vanderhoof <stvhoof@netvision.net.il>
Subject: indirect object
Message-Id: <34F1B59B.1FA1@netvision.net.il>
I have a question about "direct object" syntax. I have a script that
looks like this:
use CGI ":standard";
# ...
$cgi = new CGI;
# ...
$foo = $cgi->param('bar');
This works fine. However, if I say instead:
$foo = param $cgi 'bar';
I get a syntax error. I understood from the Camel book that the 2 ways
are identical and were just a manifestation of TMTOWTDI. What's going
on here?
In case it matters, I'm running Ver. 5.003 on Unix.
Thanks,
Tzadik
------------------------------
Date: 23 Feb 1998 18:05:29 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Is the PERL 5 Year 2000 compliance ?
Message-Id: <6csdp9$pjl$1@client3.news.psi.net>
Paul (pwwc@netvigator.com) wrote on 1638 September 1993 in
<URL: news:34F23BFF.3C29@netvigator.com>:
++
++ Do anyone know whether the PERL 5 is Year 2000 compliance ?
Why don't you just read the documentation that comes with perl?
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle 'print +(HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET", "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content)) =~ /(.*\))[-\s]+Additional/s) [0]'
------------------------------
Date: Tue, 24 Feb 1998 01:12:58 GMT
From: 666@eudoramail.com (Patrick)
Subject: Is there a "STDOUT/PIPE not available" error ?
Message-Id: <6cs7at$1j9$2@news.NL.net>
Perl WIN32 stuff, with a bit of CGI, but i think it's just as well a
perl problem...
I ran into the problem of scripts hanging after people pressing STOP
on their browser.
When the script wants to print to the "closed" STDOUT it sometimes
hangs ?
The webserver loses connection with the client, but what does this
mean to the script beside the fact output wont be printed ?
Does the print STDOUT fail ? or what ? Is Perl waiting for something
after when prints to STDOUT ?
Can you catch a $SIGnal or something on print STDOUT- fail ?
If STDOUT isn't available, what happens with Perl ?
I know of a solution by creating a watchdog with the alarm function.
The problem is that the WIN32 Perl still does not support the Alarm
function. (That's my second problem)
Heeeelp ?
TNX in advance.
Patrick
------------------------------
Date: Mon, 23 Feb 1998 10:13:30 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Law-enforcement apps ?
Message-Id: <MPG.f5b5c22dce336ef989737@news.concentric.net>
[courtesy cc of this posting sent to cited author via email]
jwaustin@sympatico.ca said...
: I am currently wrapping-up a project in law-enforcement and am filling
: in a missing link
I should warn you that until you configure Netscape to line-wrap correctly,
many people will skip your article out of principle. I couldn't think of a
funny enough way to pun on "wrapping-up"; be glad.
--
#!/usr/bin/perl -w -- Just another Perl hacker,
(open 0),$_=<0>,s,.*- +,,,chop;for(split?@*?){($$_++or$}=$_,y,y \,\
y,<STDIN>,,$$=~s\^\"sub $_ {print'$}'};7"\ee),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Mon, 23 Feb 1998 10:44:33 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Mail Attachments via Perl Sendmail A REAL ANSWER!
Message-Id: <MPG.f5b636bdf088de798973c@news.concentric.net>
rcd@kiwi.net said...
: This is a multi-part message in MIME format.
No! Bad! Usenet is a text-only medium. Please check your Netscape
preferences and tell it not to spit out MIME. Many people will ignore your
posts on principle, otherwise.
: Recently I asked the NG if anyone knew how to send attachments with Perl's
: sendmail. It was tough finding an answer that didn't require the MIME::Lite
: module. I figured it out though. I pieced a few things together that a few
: posters had said and compiled a Perl script that will do it.
: I appreciate the help that this NG has given me and now I am giving back.
With sincere respect for your intentions (and your typing ability), I hope
that no one will use your code. I hope, instead, that they'll go to CPAN and
download the MIME modules. Why would you want to set a precedent for re-
inventing the wheel?
--
#!/usr/bin/perl -w -- Just another Perl hacker,
(open 0),$_=<0>,s,.*- +,,,chop;for(split?@*?){($$_++or$}=$_,y,y \,\
y,<STDIN>,,$$=~s\^\"sub $_ {print'$}'};7"\ee),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Mon, 23 Feb 1998 07:58:16 -0700
From: Joey Garcia <j.garcia@lmco.com>
Subject: recommend a db for Win95 for web apps
Message-Id: <34F18E88.A4B7AF1E@lmco.com>
Could anyone recommend a good db that isn't overkill for web apps,
something to get my hands wet. I have Access, would that be the best
choice for an app on my pc? what if I wanted to move it to the web? what
is a common app that I wouldn't have trouble finding IPS support for?
Thanks
------------------------------
Date: Mon, 23 Feb 1998 10:27:56 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Runtime building of search expression
Message-Id: <MPG.f5b5f82c69ebffd989738@news.concentric.net>
[courtesy cc of this posting sent to cited author via email]
loyt@aals27.alcatel.com.au said...
: I am trying to write a perl thingie to search for things within
: a range with 2 parameters.
: 1:9-3:4,5:7
This isn't related to perl per se; it's really more a general data-
structures/algorithms problem. My illustrative suggestion (keeping in mind
the TMTOWTDI mantra):
#!/usr/bin/perl -w
$range_string = '1:9-3:4,5:7,3:17-3:19';
@ranges = split ',', $range_string;
foreach $range (@ranges) {
my($start_month, $start_day, $end_month, $end_day) =
$range =~ /^(\d+):(\d+)(?:-(\d+):(\d+))?$/;
do_date_range($start_month, $start_day, $end_month, $end_day);
}
sub do_date_range(@) {
my ($sm, $sd, $em, $ed) = @_;
if (defined $em and defined $ed) {
print "From $sm/$sd through $em/$ed\n";
} else {
print "On $sm/$sd\n";
}
}
__END__
Having said that, where's the year?
--
#!/usr/bin/perl -w -- Just another Perl hacker,
(open 0),$_=<0>,s,.*- +,,,chop;for(split?@*?){($$_++or$}=$_,y,y \,\
y,<STDIN>,,$$=~s\^\"sub $_ {print'$}'};7"\ee),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: 23 Feb 1998 15:30:21 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: Runtime building of search expression
Message-Id: <6cs4md$72p@news.service.uci.edu>
[mailed, posted]
In article <9a3ehayf2b.fsf@aals27.alcatel.com.au>,
Timothy Loy <loyt@aals27.alcatel.com.au> wrote:
<I am trying to write a perl thingie to search for things within
<a range with 2 parameters.
<
<File structure looks like:
<Month,Day,Entry
<
<Want to accept input like:
<1:9-3:4,5:7
<which means get any entry from 9th of Jan to 4th of Mar and
<the entry on 7th of May
<
<what is the best way to parse and search for this?
Use eval to build a matching function comprised of several smaller
regexes, one for each single entry or range of entries (as opposed
to doing a lot of '|' switching in one big regex).
Then, as you loop over your file, run this function on each line
and process the entry if your matching function returns a true
value.
sub match_any
{
my $code = <<EOCODE;
sub {
EOCODE
$code .= <<EOCODE if @_ > 5;
study;
EOCODE
for my $pat (@_)
{
$code .= <<EOCODE;
return 1 if /$pat/;
EOCODE
}
$code .= "}\n";
# print "$code\n"; # use for debugging
my $function = eval $code;
die "bad pattern: $@" if $@;
return $function;
}
my $func = match_any(qw(foo bar baz));
while (<>)
{
print "got a match" if &$func(); # prints if $_ has either foo, bar or bar
}
--
Eric D. Friedman
friedman@uci.edu
------------------------------
Date: Mon, 23 Feb 1998 11:11:54 -0600
From: "Rick Ryan" <rickryan@datrixnet.com>
Subject: Send email from Perl on NT platform
Message-Id: <6cs9r4$9t9@camel20.mindspring.com>
Is there a was to send email from a Perl script on the NT platform? If so,
any code examples of how to use it would be appreciated.
Thanks.
--
Rick Ryan Web page : www.datrixnet.com
Datrix Voice : 615-822-7829
P.O. Box 2975 FAX : 615-824-0943
Hendersonville, TN 37077 E-mail : rickryan@datrixnet.com
------------------------------
Date: Mon, 23 Feb 1998 10:52:24 -0500
From: Bruno Pagis <bruno_pagis@aur.alcatel.com>
Subject: shell expension in system function
Message-Id: <34F19B38.5F1EE35@aur.alcatel.com>
I want to do
system ("tar", "cvf", "MYTAR.tar", "./*");
The ./* is not expended, thus leading to a tar error:
tar: cannot stat ./*. Not dumped.
How to solve that ?
Thanks. BRUNO.
------------------------------
Date: 23 Feb 1998 16:58:06 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: shell expension in system function
Message-Id: <6cs9qu$ekm$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Bruno Pagis <bruno_pagis@aur.alcatel.com> writes:
:I want to do :system ("tar", "cvf", "MYTAR.tar", "./*");
:The ./* is not expended[sic], thus leading to a tar error:
:tar: cannot stat ./*. Not dumped.
:How to solve that ?
In the general case:
system("tar", "cvf", "MYTAR.tar", glob("./*"));
or in this case,
system("tar", "cvf", "MYTAR.tar", ".");
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
In general, if you think something isn't in Perl, try it out, because it
usually is. :-)
--Larry Wall in <1991Jul31.174523.9447@netlabs.com>
------------------------------
Date: 23 Feb 1998 18:26:30 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <6csf0m$5hn$1@info.uah.edu>
Following is a summary of articles spanning a 7 day period,
beginning at 16 Feb 1998 20:17:59 GMT and ending at
21 Feb 1998 21:36:03 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" e-mail address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
Excluded Posters
================
perlfaq-suggestions\@mox\.perl\.com
Totals
======
Posters: 430
Articles: 1036 (430 with cutlined signatures)
Threads: 342
Volume generated: 1664.6 kb
- headers: 705.0 kb (14,181 lines)
- bodies: 878.9 kb (27,266 lines)
- original: 606.6 kb (20,363 lines)
- signatures: 79.8 kb (1,533 lines)
Original Content Rating: 0.690
Averages
========
Posts per poster: 2.4
median: 1.0 post
mode: 1 post - 274 posters
s: 5.1 posts
Posts per thread: 3.0
median: 2.0 posts
mode: 1 post - 112 threads
s: 3.5 posts
Message size: 1645.3 bytes
- header: 696.8 bytes (13.7 lines)
- body: 868.7 bytes (26.3 lines)
- original: 599.5 bytes (19.7 lines)
- signature: 78.8 bytes (1.5 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
61 99.0 ( 42.5/ 43.7/ 28.7) mgjv@comdyn.com.au (Martien Verbruggen)
57 86.7 ( 33.2/ 41.5/ 30.4) jdf@pobox.com (Jonathan Feinberg)
31 50.8 ( 25.1/ 21.1/ 16.0) tchrist@mox.perl.com (Tom Christiansen)
25 45.2 ( 19.0/ 22.7/ 13.5) rjk@coos.dartmouth.edu
24 41.6 ( 16.1/ 25.4/ 17.3) cberry@cinenet.net (Craig Berry)
21 41.3 ( 17.8/ 20.4/ 8.8) abigail@fnx.com
19 28.7 ( 9.3/ 19.0/ 13.6) aml@world.std.com (Andrew M. Langmead)
17 34.2 ( 13.6/ 20.6/ 9.4) bill@astro.fccj.cc.fl.us
15 17.2 ( 10.0/ 7.2/ 4.8) nvp@shore.net (Nathan V. Patwardhan)
14 29.6 ( 7.6/ 17.9/ 12.2) uri@sysarch.com
These posters accounted for 27.4% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
99.0 ( 42.5/ 43.7/ 28.7) 61 mgjv@comdyn.com.au (Martien Verbruggen)
86.7 ( 33.2/ 41.5/ 30.4) 57 jdf@pobox.com (Jonathan Feinberg)
50.8 ( 25.1/ 21.1/ 16.0) 31 tchrist@mox.perl.com (Tom Christiansen)
45.2 ( 19.0/ 22.7/ 13.5) 25 rjk@coos.dartmouth.edu
41.6 ( 16.1/ 25.4/ 17.3) 24 cberry@cinenet.net (Craig Berry)
41.3 ( 17.8/ 20.4/ 8.8) 21 abigail@fnx.com
34.2 ( 13.6/ 20.6/ 9.4) 17 bill@astro.fccj.cc.fl.us
29.6 ( 7.6/ 17.9/ 12.2) 14 uri@sysarch.com
28.7 ( 9.3/ 19.0/ 13.6) 19 aml@world.std.com (Andrew M. Langmead)
22.1 ( 7.3/ 11.8/ 7.5) 11 Russ Allbery <rra@stanford.edu>
These posters accounted for 28.8% of the total volume.
Top 10 Posters by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 3.1 / 3.1) 5 "Lance" <changeATinto@>
0.996 ( 3.5 / 3.5) 5 gabor@vmunix.com (Gabor)
0.976 ( 5.5 / 5.7) 6 "Brandon S. Allbery KF8NH" <bf8$s03c92f97$a93d2@kf8nh.apk.net>
0.973 ( 1.9 / 2.0) 5 fl_aggie@thepentagon.com (I R A Aggie)
0.920 ( 10.1 / 11.0) 7 matt.pryor@dial.pipex.com
0.836 ( 2.6 / 3.1) 7 twod@not.valid
0.781 ( 2.2 / 2.9) 5 mikael@techtalk.se (Mikael Skogstrom)
0.762 ( 5.1 / 6.7) 8 ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
0.757 ( 16.0 / 21.1) 31 tchrist@mox.perl.com (Tom Christiansen)
0.744 ( 10.7 / 14.3) 5 Zenin <zenin@best.com>
Bottom 10 Posters by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.492 ( 3.3 / 6.7) 9 jdporter@min.net
0.483 ( 1.2 / 2.4) 5 dgwilson@gte.net (Douglas Wilson)
0.477 ( 2.8 / 5.8) 5 "Norman Bunn" <norman.bunn@mci.com>
0.455 ( 9.4 / 20.6) 17 bill@astro.fccj.cc.fl.us
0.436 ( 3.2 / 7.3) 8 Dan Boorstein <dboorstein@shopcfn.com>
0.435 ( 1.6 / 3.6) 7 Remove xx to reply <xxTony.Curtis@vcpc.univie.ac.at>
0.429 ( 8.8 / 20.4) 21 abigail@fnx.com
0.397 ( 2.5 / 6.3) 7 ilya@math.ohio-state.edu (Ilya Zakharevich)
0.374 ( 1.4 / 3.7) 5 Larry D'Anna <ldanna@hotmail.com>
0.338 ( 1.2 / 3.5) 6 Bob Trieger <corky@ultranet.com>
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
22 split on ':', but not '\:'
20 Year 2000 Compliance: Lawyers, Liars, and Perl
20 The Young Man and the Beach
15 Prisoners of the evil empire
14 Verifying a URL?
13 RFC about ``Matt's Script Archive''
13 Displaying Integers
12 Being Nice 2 Nice Beings [Was: Reading The FAQ's etc.: a teacher's perspective...]
11 HELP! My ISP claims that Perl access is a serious security risk!
10 5.004 bug? invisible object dereferencing
These threads accounted for 14.5% of all articles.
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
41.3 ( 14.6/ 25.3/ 18.3) 20 The Young Man and the Beach
36.2 ( 19.9/ 14.0/ 8.7) 20 Year 2000 Compliance: Lawyers, Liars, and Perl
31.6 ( 14.0/ 15.5/ 9.5) 22 split on ':', but not '\:'
24.7 ( 3.3/ 21.2/ 14.0) 5 Is perl and DBI good enough?
24.5 ( 8.0/ 15.3/ 9.3) 11 HELP! My ISP claims that Perl access is a serious security risk!
23.7 ( 7.4/ 14.6/ 9.3) 10 5.004 bug? invisible object dereferencing
23.3 ( 6.0/ 16.2/ 8.9) 8 sucess stories?
20.4 ( 10.3/ 9.4/ 5.6) 13 RFC about ``Matt's Script Archive''
18.9 ( 8.0/ 9.6/ 5.4) 10 FAQless Forays (was: Code Example Needed)
18.1 ( 10.9/ 6.8/ 3.7) 12 Being Nice 2 Nice Beings [Was: Reading The FAQ's etc.: a teacher's perspective...]
These threads accounted for 15.8% of the total volume.
Top 10 Threads by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.855 ( 5.9/ 6.9) 6 Internationalization
0.851 ( 9.9/ 11.7) 5 My first perl program, yippee!
0.813 ( 5.6/ 6.9) 6 String Extraction and checkup
0.807 ( 3.9/ 4.8) 5 Using HTML Tags in forms (Content Type)
0.800 ( 2.1/ 2.7) 5 Undefined Subroutine in &Module::Package::SubPackage
0.794 ( 3.5/ 4.4) 5 RTFM ???
0.789 ( 2.6/ 3.3) 5 Pure stupidity
0.782 ( 2.4/ 3.0) 5 NEWBIE: .=
0.771 ( 1.5/ 1.9) 6 Collon-seperated files?
0.766 ( 3.5/ 4.5) 6 books or anything
Bottom 10 Threads by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.548 ( 3.7 / 6.8) 12 Being Nice 2 Nice Beings [Was: Reading The FAQ's etc.: a teacher's perspective...]
0.547 ( 8.9 / 16.2) 8 sucess stories?
0.546 ( 2.8 / 5.1) 5 Help: Why does sysread give false end of file?
0.508 ( 1.3 / 2.6) 5 Regex & locales.
0.486 ( 2.1 / 4.3) 5 Sort help please!
0.484 ( 2.0 / 4.1) 7 hash data access
0.466 ( 3.6 / 7.6) 6 Referencing data in an array of arrays
0.454 ( 3.3 / 7.2) 8 Avoiding $`
0.423 ( 2.3 / 5.4) 7 A Pubilc Apology.
0.400 ( 1.8 / 4.5) 6 HELP! exec doesn't work properly!
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
26 comp.lang.perl.modules
25 comp.software.year-2000
23 comp.lang.c++
23 comp.lang.c
17 comp.lang.perl
12 alt.fan.e-t-b
10 news.software.readers
7 comp.lang.pascal.delphi.misc
7 comp.lang.pascal.borland
6 alt.html.webedit
Top 10 Crossposters
===================
Articles Address
-------- -------
13 abigail@fnx.com
9 hirishu@geocities.com
9 psxforu@aol.com
9 Scott Earnest <setech@_ix.netcom.com>
9 yhceamap@bigcock.com
8 Eli the Bearded <*@qz.to>
7 "Brandon S. Allbery KF8NH" <bf8$s03c92f97$a93d2@kf8nh.apk.net>
6 mgjv@comdyn.com.au (Martien Verbruggen)
6 Colin Dooley <colin@medit3d.com>
6 Steve Dover <swd@strata-group.Xcom>
------------------------------
Date: Mon, 23 Feb 1998 09:10:40 -0600
From: Robert Melson <rmelson@pswtech.com>
Subject: The Ineffable Tom C.
Message-Id: <34F19170.6100@pswtech.com>
Y'know, folks, Tom C., Larry, and others whose knowledge and opinions
are important to perl have been driven from the perl newsgroups by just
such attitudes as I've been reading recently (Why is Tom C. so rude?;
the waaay out of line response to Tom's fable for modern times about the
young man, the gypsies, etc.).
Like him or loathe him or something in between, Tom has knowledge and
experience that few others participating in this group can equal. I
would suggest to you that putting up with what many consider to be
Tom's abrasive personality is a small enough price to pay for the
value returned and that you should hope that the current round of
villification directed toward him will not -- again -- drive him from
active participation in this newsgroup.
--
_____________________________________________________________________
Bob Melson The right to be heard does not include
PSWTechnologies, Inc the right to be taken seriously
Austin, TX -- Hubert Humphrey
512-342-3511 rmelson@pswtech.com bmelson@swbell.net
------------------------------
Date: Mon, 23 Feb 1998 10:34:49 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Uninitialized value chunk error
Message-Id: <MPG.f5b6122ac4d858e989739@news.concentric.net>
[courtesy cc of this posting sent to cited author via email]
Eric Hilding <"no.#@&!spam"@no.spam.cyberdex.com> said...
: Use of unitialized value at mls222.pl.txt line 29, <INFILE> chunk 396
: $line =~ m/.*\d\/\d\/(\d).*\d{2}\/\D{2}\/\d{2}\s(.{5,25})/;
: #extract Status Code
: #and Address from this data line
: $stat = $1; #assign status code from $1
: $addr = $2; #assign address from $2
: $addr =~ s/^\s+|\s+$//g; #whitespace cleanup on address
It was difficult to tell which line is #29... Please, in the future, take the
time to point out the relevant lines when you post code examples. You're
performing a regex match on an undefined variable (meaning $2 never gets
set) which implies that either your first regex, above, is broken, or that
there's garbage data. You should throw some debugging code in there, or run
your script in the debugger, and see what $line actually looks like.
--
#!/usr/bin/perl -w -- Just another Perl hacker,
(open 0),$_=<0>,s,.*- +,,,chop;for(split?@*?){($$_++or$}=$_,y,y \,\
y,<STDIN>,,$$=~s\^\"sub $_ {print'$}'};7"\ee),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Mon, 23 Feb 1998 11:13:38 -0600
From: "Rick Ryan" <rickryan@datrixnet.com>
Subject: Update another frame from Perl script.
Message-Id: <6cs9uc$s8v@camel20.mindspring.com>
I'm building a messaging system with 2 frames. Frame 1 has a list of message
headers. When the user clicks a message header I want to run a system
program (with back ticks), then return the results (message text) to frame
2. Oh yea, this is under (shudder) NT. Any suggestions?
--
Rick Ryan Web page : www.datrixnet.com
Datrix Voice : 615-822-7829
P.O. Box 2975 FAX : 615-824-0943
Hendersonville, TN 37077 E-mail : rickryan@datrixnet.com
------------------------------
Date: Mon, 23 Feb 1998 15:33:45 GMT
From: toriw@online.no (Tor Iver Wilhelmsen)
Subject: Re: vec builtin function
Message-Id: <350d954c.27593718@news.eunet.no>
On Mon, 23 Feb 1998 01:26:51 -0600, tvs_srs@hotmail.com uttered:
>Can somebody give a simple example for vec function? Perlfunc manpage is
>pretty cryptic on this. BTW, I use perl 5.004_03.
Basically, it's a "please use a string reference to pack these n-bit
numbers in" construct.
package octalArray;
sub new {
return bless { }, shift();
}
sub setElement {
my ($this, $index, $value) = @_;
vec($this->{_string},$index,3) = $value;
}
sub getElement {
my ($this, $index) = @_;
return vec($this,$index,3);
}
--
"Between our dreams and actions lies this world."
- Bruce Springsteen, "Dead Man Walking"
Tor Iver Wilhelmsen toriw@online.no
------------------------------
Date: Mon, 23 Feb 1998 19:59:43 +0200
From: Tzadik Vanderhoof <stvhoof@netvision.net.il>
Subject: why no Case statment?
Message-Id: <34F1B90F.5709@netvision.net.il>
Why doesn't Perl have a real Case statement? I've read what the Camel
book says about the "alternatives", but none of them are really as nice
as a real Case statement supported directly by the language. I realise
that this is something that probably only Larry could answer, and I've
heard he no longer sees this newsgroup, but maybe someone has some ideas
about this...
Tzadik
------------------------------
Date: Mon, 23 Feb 1998 11:00:05 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Why not RegEx in $/?
Message-Id: <MPG.f5b670c73655d3498973e@news.concentric.net>
[courtesy cc of this posting sent to cited author via email]
cnwetzel@linguistik.uni-erlangen.de said...
: Why isn't it possible to use a regular expression for
: $/ ($INPUT_RECORD_SEPARATOR)? The perlvar page says:
:
: Remember: the value of $/ is a string, not a regexp.
: AWK has to be better for something :-)
:
: I think it could be very useful to cover different
: separators when processing big input texts, cause
: not all input has a uniform structure.
I would recommend that you study the scalar form of the range operator, which
is spelled (foo .. bar), where foo and bar are expressions. perlop gives some
sample uses of scalar range that may well address the problem you're solving.
Hope this helps.
--
#!/usr/bin/perl -w -- Just another Perl hacker,
(open 0),$_=<0>,s,.*- +,,,chop;for(split?@*?){($$_++or$}=$_,y,y \,\
y,<STDIN>,,$$=~s\^\"sub $_ {print'$}'};7"\ee),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 1958
**************************************