[7799] in Perl-Users-Digest
Perl-Users Digest, Issue: 1424 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Dec 6 05:16:58 1997
Date: Sat, 6 Dec 97 02:00:39 -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 Sat, 6 Dec 1997 Volume: 8 Number: 1424
Today's topics:
Re: 001 + 1 = 002; 002 - 1 = 1 ARGH <rootbeer@teleport.com>
Re: Better way to do this? snailgem@aol.com
Re: Better way to do this? <rootbeer@teleport.com>
Re: Better way to do this? (Adam Schneider)
Re: Can anybody Help me in this!!! <rootbeer@teleport.com>
Re: can perl do multi-threaded programming? (Ilya Zakharevich)
Clearing a namespace (Dave Wolfe)
Re: Communication through pipes with su (Jeff Yoak)
Converting from Perl 4 to 5 <lmanduley@lucent.com>
Re: Converting from Perl 4 to 5 (Mike Stok)
Re: Executing a Perl script inside a HMTL page ? <talkasab@opal.tufts.edu>
Finding ASCII/ANSI numbers <jdownie@julian.uwo.ca>
Re: Finding ASCII/ANSI numbers (Mike Stok)
Re: forked processes not exiting charlot@SPAM-FREE.org
Re: forked processes not exiting <rootbeer@teleport.com>
Re: Fully qualifying variables <rootbeer@teleport.com>
Re: Help with VERY simple problem <dgwilson@gte.net>
Re: HELP!!! FTP script suddenly NOT working... <rootbeer@teleport.com>
Re: Mailing binary file <rootbeer@teleport.com>
Re: Matching lowercase letter in regexp <rootbeer@teleport.com>
Re: negative lookahead help in HTML entity substitution <usenet-tag@qz.little-neck.ny.us>
Re: NEWBIE can't tar latest_tar.gz <barnett@houston.Geco-Prakla.slb.com>
Perl 5.004 binary for Solaris 2.5 (Waqar Hafiz)
Re: Perl 5.004 binary for Solaris 2.5 <tycage@infi.net>
Re: Perl Contractors Wanted (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Re: Perl for NeXT <rootbeer@teleport.com>
perl packages question <mwrostron@imation.com>
Re: Perl probs with files <rootbeer@teleport.com>
Re: Perl4 is not Y2K (was Re: Forced to use brain-dead <joneil@cks.ssd.k12.wa.us>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 5 Dec 1997 13:17:52 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Bart Lateur <bart.mediamind@tornado.be>
Subject: Re: 001 + 1 = 002; 002 - 1 = 1 ARGH
Message-Id: <Pine.GSO.3.96.971205130023.29415P-100000@usertest.teleport.com>
On Fri, 5 Dec 1997, Bart Lateur wrote:
> Ok. So what comes after "a999"?
If the docs are insufficient, you should file a bug report. :-) But in
any case, a test script should give you the answer.
perl -e '$_ = "a999"; $_++; print "$_\n"'
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Fri, 05 Dec 1997 14:45:57 -0500
From: snailgem@aol.com
Subject: Re: Better way to do this?
Message-Id: <348859F4.4A45@aol.com>
Your suggestion won't work because I don't know how many items there are
going to be after something=
I should have been more clear in my post:
something=alpha,beta,gamma. . .
Thanks.
> :I'm reading from a file and am interested in lines like this:
> :something=alpha,beta,gamma
> :
> :I use the following code to do things with alpha, beta, gamma:
> :
> :open (FILEHANDLE, $myfile) or die ("Can't open $myfile");
> :while (<FILEHANDLE>){
> :@lines=split /=/, $_ if /^something=/;
> :}
> :shift @lines;
> :#I dislike this one:
> :@mylines=split /,/, join(",", @lines);
> :chomp @lines;
> :foreach $line (@mylines) {
> :##do things here
> :}
>
> You might try
>
> while (<FILEHANDLE>)
> {
> if (/^something=/)
> {
> ($alpha, $beta, $gamma) = (split(/=|,/))[1..3];
> #do something with $alpha $beta and $gamma here
> }
> }
>
--
Will
"Take any demand, however slight, which any creature, however weak, may
make. Ought it not, for its own sole sake, to be satisfied? If not,
prove why not."
William James
------------------------------
Date: Fri, 5 Dec 1997 12:25:43 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: snailgem@aol.com
Subject: Re: Better way to do this?
Message-Id: <Pine.GSO.3.96.971205121654.29415H-100000@usertest.teleport.com>
On Fri, 5 Dec 1997 snailgem@aol.com wrote:
> open (FILEHANDLE, $myfile) or die ("Can't open $myfile");
> while (<FILEHANDLE>){
> @lines=split /=/, $_ if /^something=/;
> }
> shift @lines;
> #I dislike this one:
> @mylines=split /,/, join(",", @lines);
> chomp @lines;
> foreach $line (@mylines) {
> ##do things here
> }
>
> This works fine, but is there a better way of doing this?
Does that _really_ work fine? (That is, are you interested only in the
last line in the file which begins 'something='?) If so, this is better...
open FILE, $myfile
or die "Can't open file '$myfile': $!";
my $line;
while (<FILE>) {
next unless /^something=(.*)$/;
$line = $1;
}
close FILE;
my @lines = split /[,=]/, $line;
for $line (@lines) {
##do things here
}
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Fri, 05 Dec 1997 14:41:11 -0600
From: DO_NOT_SPAM_acs@bitstream.net (Adam Schneider)
Subject: Re: Better way to do this?
Message-Id: <DO_NOT_SPAM_acs-0512971441120001@acs.bitstream.net>
In article <34879D0D.1E49@aol.com>, snailgem@aol.com wrote:
> I'm reading from a file and am interested in lines like this:
> something=alpha,beta,gamma
>
> I use the following code to do things with alpha, beta, gamma:
>
> open (FILEHANDLE, $myfile) or die ("Can't open $myfile");
> while (<FILEHANDLE>){
> @lines=split /=/, $_ if /^something=/;
> }
> shift @lines;
> #I dislike this one:
> @mylines=split /,/, join(",", @lines);
> chomp @lines;
> foreach $line (@mylines) {
> ##do things here
> }
>
> This works fine, but is there a better way of doing this?
> Thanks.
I'm not sure *exactly* what you need, but I think this should work:
open (FILEHANDLE, $myfile) or die ("Can't open $myfile");
while (<FILEHANDLE>) {
if (/^something=/){
chomp;
s/^something=//;
@alphabetagamma = split (/,/,$_);
foreach $letter (@alphabetagamma){
#do things here
}
}
}
Adam
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Adam Schneider * DO_NOT_SPAM_schneider@pobox.com
(remove "DO NOT SPAM" from my address to send me e-mail)
WWW: http://pobox.com/~schneider/adam.html
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
------------------------------
Date: Fri, 5 Dec 1997 12:33:43 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Lops <lops@I_should_put_my_domain_in_etc_NNTP_INEWS_DOMAIN>
Subject: Re: Can anybody Help me in this!!!
Message-Id: <Pine.GSO.3.96.971205123233.29415K-100000@usertest.teleport.com>
On Fri, 5 Dec 1997, Lops wrote:
> From: Lops <lops@I_should_put_my_domain_in_etc_NNTP_INEWS_DOMAIN>
Yes, you should.
> Subject: Can anybody Help me in this!!!
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> Is it possible to overwrite the particular record
> in the text file . Is there any method of directly manipulating the
> text file in PERl ?
The FAQ has some good information about that. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 5 Dec 1997 20:14:32 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: can perl do multi-threaded programming?
Message-Id: <669nb8$kt$1@agate.berkeley.edu>
In article <6692m4$6b7$1@news.ox.ac.uk>,
Malcolm Beattie <mbeattie@sable.ox.ac.uk> wrote:
> There are two ways to allow arbitrary perl code to be usable from
> signal handlers. One is Chip's way which has the advantage that a
> multi-threading perl isn't required but has the disadvantage that
> perl's internal loop has to poll after every few instructions
> whether a signal has been raised or not.
The other disadvantage is that it does not work. Not in the sense
that the current signal handlers do not work (they may do whatever
they are pleased to do, most probabably segfault). But in the sense
that they cannot stop whatever is going now, they are postponed until
next sequence point, which may happen the next millenium if some nasty
internal perl operation take a millenium.
Anyway, your objection is not that important, since the common wisdom
is that it is enough to check for "delayed" signals from OP_UNSTACK
opcode.
> The other is the way that
> I've included in the threading stuff: it has the disadvantage that
> a multi-threaded perl is required but the advantage that no polling
> is necessary in perl's internals. The multi-threaded safe signal
> handling works by creating a special thread which sits there
> blocking waiting to be notified that a signal has arrived. The
> real C signal handler merely notifies the signal thread (safely)
> about the arrival of the signal. The signal handling thread then
> executes whatever perl code you like. So if you include
> use Thread::Signal;
> at the top of your program (and wait until I've polished up the
> internals a bit to complete things) then you can write signal
> handlers that do whatever you like completely safely and without
> affecting the performance of your main program. Note, however,
> that a perl compiled with multi-threading support
> (./Configure -Dusethreads) is intrinsically slower than perl
> compiled without because of the extra dereferencing necessary.
But you also cannot abort a long elementary operation this way too,
since you cannot longjump the other thread.
Most promising way is to have all this mechanisms (Chips, threaded,
and as a last resort the unsafe current mechanism) available to the
users discretion. Like this:
$SIG{INT} = {delayed => \&myhandler1, immediate => \&myhandler2};
with the semantic that the service of SIGINT is delayed until the next
OP_UNSTACK, if the second one arrives before the first one is
serviced, then it is executed immediately.
Ilya
------------------------------
Date: 5 Dec 97 18:33:45 GMT
From: dwolfe@miaow.sps.mot.com (Dave Wolfe)
Subject: Clearing a namespace
Message-Id: <dwolfe.881346825@talos4>
I have a config module that has a method to export the config variables/
values to a specific namespace (i.e. package name), a la CGI.pm
import_names(). In one usage, I loop processing different configurations.
To keep from accumulating spurious definitions I need to undefine all
the symbols in the namespace before defining the next set. I've tried:
1. undef %CFG::;
2. %CFG:: = ();
3. undef *CFG::;
The problem is, after #1 and #2, symbols defined in $CFG:: are still
there unless I use soft references, i.e. ${"CFG::testvar"} is undefined
but $CFG::testvar still shows the old value. Even more unfortunately,
after redefining the symbols, $CFG::testvar doesn't change, only
${"CFG::testvar"}. #3 doesn't seem to undefine the namespace at all.
I suspect the problem has to do with references made at compilation time
that don't change just because the symbol table does, but I thought I'd
ask if there's a correct way to flush and refill a symbol stash at
runtime other than always using soft references or eval?
Here's my test program and output:
#!/usr/bin/perl -w
$| = 1;
sub import_variables {
my ($namespace, $varef) = @_;
my ($var, $val);
while (($var, $val) = each %$varef) {
${"${namespace}::$var"} = $val;
}
}
my $init;
foreach $init (0..3) {
import_variables('CFG', { testvar => "first value ($init)" });
undef %CFG:: if $init == 1;
%CFG:: = () if $init == 2;
undef *CFG:: if $init == 3;
print "\nAfter undefining by method $init:\n";
print "'testvar' is defined\n" if defined $CFG::testvar;
print "'testvar' not defined\n" unless defined $CFG::testvar;
print "\$CFG::testvar => $CFG::testvar\n";
print qq(\${"CFG::testvar"} => ${"CFG::testvar"}\n);
import_variables('CFG', { testvar => "second value ($init)" });
print "\nAfter redefining:\n";
print "'testvar' is defined\n" if defined $CFG::testvar;
print "'testvar' not defined\n" unless defined $CFG::testvar;
print "\$CFG::testvar => $CFG::testvar\n";
print qq(\${"CFG::testvar"} => ${"CFG::testvar"}\n);
}
After undefining by method 0:
'testvar' is defined
$CFG::testvar => first value (0)
${"CFG::testvar"} => first value (0)
After redefining:
'testvar' is defined
$CFG::testvar => second value (0)
${"CFG::testvar"} => second value (0)
After undefining by method 1:
'testvar' is defined
$CFG::testvar => first value (1)
Use of uninitialized value at zz line 24.
${"CFG::testvar"} =>
After redefining:
'testvar' is defined
$CFG::testvar => first value (1)
${"CFG::testvar"} => second value (1)
After undefining by method 2:
'testvar' is defined
$CFG::testvar => first value (1)
Use of uninitialized value at zz line 24.
${"CFG::testvar"} =>
After redefining:
'testvar' is defined
$CFG::testvar => first value (1)
${"CFG::testvar"} => second value (2)
After undefining by method 3:
'testvar' is defined
$CFG::testvar => first value (1)
${"CFG::testvar"} => first value (3)
After redefining:
'testvar' is defined
$CFG::testvar => first value (1)
${"CFG::testvar"} => second value (3)
--
Dave Wolfe
------------------------------
Date: Fri, 05 Dec 1997 18:47:06 GMT
From: jeff@yoak.com (Jeff Yoak)
Subject: Re: Communication through pipes with su
Message-Id: <669i2r$a3g@dfw-ixnews10.ix.netcom.com>
jeff@yoak.com (Jeff Yoak) wrote:
>if($username) {
> open(COMMAND, "|su $username -c '$command 2>&1' |");
> print COMMAND "$password\n";
> $output = <COMMAND>;
>} else {
> $output = `$command 2>&1`;
>}
[snip]
>My first question is whether or not this is safe. Other than the risk
>of sending a password to the server unencrypted (which he can overcome
>with htts if he is really concerned at that level) I don't see any
>problems here, but I'm not an expert.
I should add that this script would be protected by .htaccess so not
just anyone could execute it via the web. Anyone who could get to the
directory in question to run it from the command line on the system
could already act as "nobdy." The more I think about it, the more I
think this part of the question might be better suited to the CGI
group...
Jeff
Jeff Yoak jeff@yoak.com http://yoak.com/
------------------------------
Date: Thu, 04 Dec 1997 13:25:41 -0600
From: Linda Manduley <lmanduley@lucent.com>
Subject: Converting from Perl 4 to 5
Message-Id: <348703B5.20A7@lucent.com>
We have a large application written in Perl 4 that must be upgraded to
Perl 5 or converted to another language. Please recommend:
1. Any utilities to help moving from 4 to 5
2. Any documentation on converting
3. Any language that would be easy to convert to
Thanks,
Linda
------------------------------
Date: 5 Dec 1997 20:29:31 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Converting from Perl 4 to 5
Message-Id: <669o7b$blo@news-central.tiac.net>
If you have a system with a recent perl 5 installed (5.004_04 is a good
place to start) then you can check out the "Perl4 to Perl5 Traps" section
of the perltrap manual page and the perldelta man page too. If it's
possible to try running a copy of your application under perl5 with the -w
flag switched on you should be able to get an idea of how much work is
needed to get the code "clean" under perl 5. For the most part perl 5 is
a superset of perl 4. Taking full advantage of perl 5's new features will
take more work than that, but this will give you an idea of where you
stand. You might also want to check out the documentation for splain
(explain) which will generate more verbose diagnostics.
Hope this helps,
Mike
In article <348703B5.20A7@lucent.com>,
Linda Manduley <lmanduley@lucent.com> wrote:
>We have a large application written in Perl 4 that must be upgraded to
>Perl 5 or converted to another language. Please recommend:
>
> 1. Any utilities to help moving from 4 to 5
> 2. Any documentation on converting
> 3. Any language that would be easy to convert to
>
>Thanks,
>Linda
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Fri, 5 Dec 1997 14:20:53 -0500
From: "Tarik Alkasab" <talkasab@opal.tufts.edu>
Subject: Re: Executing a Perl script inside a HMTL page ?
Message-Id: <669ka9$iqb$1@news3.tufts.edu>
On Wed, 02 Oct 1996 22:30:13 GMT, nilsson@algonet.se (Hans Nilsson)
wrote:
>Does anyone know (how?) if it4s possible to execute
>a Perl script as a part of a page under IIS ?
>Can it be done ?
You should also check our Binary Evolution's Velocity Engine for Perl, and
see if it does what you want (it sounds like it does).
http://www.binevolve.com
Terry
------------------------------
Date: Fri, 05 Dec 1997 13:05:28 -0500
From: "J. Stephen Downie" <jdownie@julian.uwo.ca>
Subject: Finding ASCII/ANSI numbers
Message-Id: <34884268.8BE6881D@julian.uwo.ca>
HI gang:
How one convert any ASCII/ANSI character to its Integer value?
I see that chr(NUMBER) exist but this is exactly opposite from my needs.
Thanks for your help,
Stephen
--
**********************************************************
J. Stephen Downie
Lecturer, PhD candidate, and consultant
Graduate Programmes in Library and Information Science
Faculty of Communications and Open Learning
University of Western Ontario
London, Ontario, Canada
(519) 432-3053
http://www.uwo.ca/gslis/phd/downie
------------------------------
Date: 5 Dec 1997 19:08:15 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Finding ASCII/ANSI numbers
Message-Id: <669jev$7on@news-central.tiac.net>
In article <34884268.8BE6881D@julian.uwo.ca>,
J. Stephen Downie <jdownie@julian.uwo.ca> wrote:
>How one convert any ASCII/ANSI character to its Integer value?
>I see that chr(NUMBER) exist but this is exactly opposite from my needs.
you can use ord or unpack as a couple of ways to do it, in the debugger:
DB<1> print ord 'A'
65
DB<2> print unpack 'C', 'A'
65
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: 5 Dec 1997 15:19:52 -0500
From: charlot@SPAM-FREE.org
Subject: Re: forked processes not exiting
Message-Id: <669nl8$3ei@ocean.CAM.ORG>
In article <34884435.55A6ADE2@customer_insight.com>,
Andy Collier <andy_collier@customer-insight.com> wrote:
>
>You need to do a wait() or waitpid() from the parent of the process in
>order to harvest the childs exit so that a zombie process isnt created.
>Check the second edition O'Reilly book and look for the little section
>of code entitled REAPER in the Cl/Svr examples for a starting point.
>But the base fact on a *ix system is that you have to have something to
>take the exit of a child when it exits. If you dont, the OS will (and
>thats where zombies come from). Thats life with fork() and friends (as
>I learned many years ago in C). Too bad we dont have true threading yet
>-- it would likely solve most of your problems while causing you a few
>new interesting ones.
>
Not that I'm against multi-threading, but you don't have to wait() or
waitpid() on your child-processes if you don't care about their exit code.
Just set the handle for SIGCHLD to SIG_IGN. In Perl, this would look like
this:
$SIG{CHLD} = 'IGNORE';
*In theory*, this will prevent zombies from arising... (I haven't tested
this in Perl,, but I don't see why it wouldn't work).
Richard.
--
Richard Bellavance -- charlot(at)cam(dot)org -- http://www.cam.org/~charlot/
"All along this path I tread / My heart betrays my weary head
With nothing but my love to save / From the cradle to the grave"
(Eric Clapton, "From the cradle")
------------------------------
Date: Fri, 5 Dec 1997 13:29:02 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Dan Hopkins <dan@ukonline.co.uk>
Subject: Re: forked processes not exiting
Message-Id: <Pine.GSO.3.96.971205132539.29415S-100000@usertest.teleport.com>
On Fri, 5 Dec 1997, Dan Hopkins wrote:
> they become zombie processes.
http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq8/
How_do_I_avoid_zombies_on_a_Unix.html
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Fri, 5 Dec 1997 12:05:17 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Zenin <zenin@best.com>
Subject: Re: Fully qualifying variables
Message-Id: <Pine.GSO.3.96.971205115354.29415C-100000@usertest.teleport.com>
On 5 Dec 1997, Zenin wrote:
> Strict 'subs' does require that subs be defined before use. This
> is either by the full sub foo {}, or with use subs qw(foo).
Or, when the sub is used, it's all right if it's not used as a plain
bareword. That is, so long as it's clearly a sub call, there's no problem.
use strict;
&foo; # this is fine
foo(); # so is this
foo; # error unless &foo is previously declared
> BTW, variables don't need to be fully qualified, just defined.
For a scalar variable to be 'defined', it needs simply to have a non-undef
value. Is that what you're meaning? Or do you mean 'declared'? Either way,
the docs for scrict.pm are pretty clear on what really needs to happen.
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 5 Dec 1997 18:40:11 GMT
From: Douglas Wilson <dgwilson@gte.net>
Subject: Re: Help with VERY simple problem
Message-Id: <669hqb$992$1@gte1.gte.net>
Jason Thomas Hitesman wrote:
>
> while (<PFILE>) {
> $rows[$i] = <PFILE>;
> $i++;
> }
>
> However when I try to read in a three line text file I only get two lines
> read in.
First, every time you do a <PFILE>, it reads a line of the
file. The <PFILE> in the top of the while loop assigns the line
by default to the '$_' variable, then the other one explicitly
assigns the next line to the rows array.
But the easiest way to read the file into the array is:
@rows=<PFILE>;
which magically reads the entire file (since its assigned in
an array context) and assigned to the array.
Hope that helps,
Douglas Wilson
------------------------------
Date: Fri, 5 Dec 1997 13:23:38 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Connie <connie@bitterpills.com>
Subject: Re: HELP!!! FTP script suddenly NOT working...
Message-Id: <Pine.GSO.3.96.971205132108.29415R-100000@usertest.teleport.com>
On Fri, 5 Dec 1997, Connie wrote:
> The result: Everything else using standard TCP/IP protocols seems to
> work fine, but MY programs (which rely on the ftplib 1.1's ftp'put
> command), returns a "426 Connection Reset By Peer" error any time it
> is asked to transfer a file larger than, say, 12K.
Does any other FTP client have the same trouble? If your code is doing
what a normal FTP client does (that is, what the FTP protocol says to do),
then you're doing the right things. If you're not sure what the protocol
says, check it out. :-) Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Fri, 5 Dec 1997 12:30:16 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Mikel Cook <mikel@ap.net>
Subject: Re: Mailing binary file
Message-Id: <Pine.GSO.3.96.971205122718.29415I-100000@usertest.teleport.com>
On Thu, 4 Dec 1997, Mikel Cook wrote:
> The open for mail looks like this:
>
> open (MAIL, "|/usr/bin/sendmail -B 8BITMIME");
>
> I am not getting an error on the open statement even with the -w
> parameter, so it seems that flag is OK.
That doesn't necessarily follow.
> I read in the sendmail man page that the -B flag is for a binary message
> body.
If you're having trouble getting sendmail to do what you want, you should
check the docs, FAQs, and books about sendmail. If you still can't get it
working, you should ask your local sendmail expert. When even that fails,
you should try a sendmail newsgroup. Of course, there's nothing
Perl-specific about getting sendmail to work. Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Fri, 5 Dec 1997 12:34:56 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Honza Pazdziora <adelton@fi.muni.cz>
Subject: Re: Matching lowercase letter in regexp
Message-Id: <Pine.GSO.3.96.971205123404.29415L-100000@usertest.teleport.com>
On Fri, 5 Dec 1997, Honza Pazdziora wrote:
> Tom Phoenix <rootbeer@teleport.com> writes:
>
> > On Thu, 4 Dec 1997, Honza Pazdziora wrote:
> >
> > > how do I match lowercase letter (locale-smart, of course)?
> >
> > while (<>) {
> > while (/(\G.*?[^\W0-9_])/g) {
> > print "$1\n" if $1 eq lc $1;
> > }
> > }
> >
> > Does that do what you want?
>
> So, the only way to do it currently is to match something and then
> check if after conversion to lowercase it's the same as before,
> right?
Well, I'd hesitate to say that any way to do something is the "only way"
in Perl. But this is the only good way. :-) :-) :-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 5 Dec 1997 20:09:15 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: negative lookahead help in HTML entity substitution
Message-Id: <eli$9712051451@qz.little-neck.ny.us>
Posted and mailed.
Eric Litman <elitman@viaduct.com> wrote:
> I have a document parser which needs to be able to look through a text
> document and find any ampersands which are not part of either an HTML entity
> or a double ampersand (&&).
Strange, but okay.
> It seems to me that this should work:
>
> $match =~ s/&+?(?![^&][a-zA-Z0-9#]{2,5};)/\&\;/go;
Closest I can think of now is:
$match =~ s/(?!&(?:[a-zA-Z0-9#]{2,5};|&+))&/&/g;
It skips entities well, but double (or more) ampersands still screw it
up. Offhand I can't see a way to fix that without being allowed to
assume a \b condition before the ampersand (or having look-behind).
The last ampersand in a string of them is not followed by an entity or
another ampersand, you see....
(Actually it just occured to me to use capturing:
$match =~ s/(^|[^&])(?!&(?:[a-zA-Z0-9#]{2,5};|&+))&/$1&/g;
which works just dandy.)
Elijah
------
out of practice
------------------------------
Date: Fri, 05 Dec 1997 13:54:22 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: NEWBIE can't tar latest_tar.gz
Message-Id: <34885BEC.79C81FB6@houston.Geco-Prakla.slb.com>
Nick Nottleman wrote:
> I am trying to extract latest_tar.gz on a SCO Unix box. The command i am
> using is tar xvf latest_tar.gz. I am getting directory checksum
^^^^.gz = compressed
using gzip
.Z = compressed using compress
This is not a tar file. It is a tar'red gzip'ped file. You must use
gzip/gunzip to uncompress it first, and then perform the tar.
gunzip latest_tar.gz
tar xvf latest_tar
Dave
--
"Security through obscurity is no security at all."
-comp.lang.perl.misc newsgroup posting
------------------------------------------------------------------------
* Dave Barnett U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------
------------------------------
Date: Fri, 05 Dec 1997 20:40:18 GMT
From: waqar.hafiz@virgin.net (Waqar Hafiz)
Subject: Perl 5.004 binary for Solaris 2.5
Message-Id: <669otq$t04$1@nclient5-gui.server.virgin.net>
Can someone point me to a site where I can grab the Perl 5.004 binary
for Solaris 2.5.
Thanks in advance
Waqar
------------------------------
Date: Fri, 05 Dec 1997 16:00:57 -0500
From: Ty Cage Warren <tycage@infi.net>
Subject: Re: Perl 5.004 binary for Solaris 2.5
Message-Id: <34886B89.799F69D2@infi.net>
Waqar Hafiz wrote:
>
> Can someone point me to a site where I can grab the Perl 5.004 binary
> for Solaris 2.5.
>
> Thanks in advance
> Waqar
You can get 5.004_03 from
ftp://sunsite.unc.edu/pub/solaris/sparc/perl5.004.03.SPARC.Solaris.2.5.pkg.tgz
I haven't seen 5.004_04 pop up there yet though. *sigh*
Hope this helps,
Ty
--
+---+
Ty Cage Warren tycage@infi.net
Systems Engineer InfiNet
Homepage: http://www.wsol.net/~tycage
PGP Public Key: http://www.wsol.net/~tycage/pgpkey.html
PGP Fingerprint: FF C1 28 CA 80 B5 31 78 B1 24 2E 8C AB DA FB D2
------------->Never invoke anything bigger than your head.<-------------
------------------------------
Date: Fri, 05 Dec 97 16:06:02 -0500
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: Perl Contractors Wanted
Message-Id: <34886d18$12$ofn$mr2ice@speaker>
In <47f3656da8rhodri@wildebst.demon.co.uk>, on 12/04/97 at 10:04 PM,
Rhodri James <rhodri@wildebst.demon.co.uk> said:
+-----
| > Give him a break. (You have to bear in mind he's probably just an MBA,
| > not a perl techie).
| Yes, but he could have written it in English. Or American, I'm not that
| choosy :-)
+--->8
He probably thought it *was* "English". Then again, the "English" I hear in
public seems to be slipping backwards toward caveman language....
--
use 5.004;sub AUTOLOAD{print$_{$_.++$x{$_}}}sub new{my%x;%_=map{++$a%2?$_.++$x{
$_}:$_}split(//,pack('N*',unpack('w*',unpack('u*','M@H*HP\'2"@\C`88+SE/!EA(F!'.
"A'6\$LZV0+(3;C9QRA9NAPG2&D\\G(88:KL=A0\n4AN.5W\"\"&\\[W>;H>3S>0\@A\\N\@PB\$`")
)));bless{}}$b=(new main);map{$b->_}split(//,' Brandon S. Allbery KF8NH') # :-)
------------------------------
Date: Fri, 5 Dec 1997 12:08:08 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Andrew Gehring <andrew_gehring@mk.com>
Subject: Re: Perl for NeXT
Message-Id: <Pine.GSO.3.96.971205120700.29415E-100000@usertest.teleport.com>
On Thu, 4 Dec 1997, Andrew Gehring wrote:
[NON-Text Body part not included]
I'm not sure what body part that was, but I'm glad that my newsreader
won't show it to me. :-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Fri, 5 Dec 1997 13:55:41 -0600
From: "Mark Rostron" <mwrostron@imation.com>
Subject: perl packages question
Message-Id: <669m9q$ooi1@zinc.imation.com>
hi,
I am trying to create a package and have noticed that the order of package
declaration will influence whether values assigned to package variables are
visible or not.
For example, the following code
package junk;
$a = "hello world\n";
package main;
print $junk::a,"\n";
will correctly display the value of junk::a, whereas
package main;
print $junk::a,"\n";
package junk;
$a = "hello world\n";
will not.
I have read in perlsyn that the interpreter binds as much as it can during
compilation - in this case, the result could occur. Have I not rtfm
properly?
mr
------------------------------
Date: Fri, 5 Dec 1997 12:59:51 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Madness <nic@cyber-west.com>
Subject: Re: Perl probs with files
Message-Id: <Pine.GSO.3.96.971205125746.29415O-100000@usertest.teleport.com>
On Fri, 5 Dec 1997, Madness wrote:
> Is there something I'm not aware of that could be causing the
> ownership status?
Yes. :-) But Perl shouldn't change the ownership of a file unless you
explicitly call the chown() function (and unless the kernel allows it). Of
course, if Perl is having to create a file, that's another matter. Hope
this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Fri, 05 Dec 1997 13:24:18 -0800
From: Jerome O'Neil <joneil@cks.ssd.k12.wa.us>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl4 is not Y2K (was Re: Forced to use brain-dead perl 4 -- how do I accomplish task that is simple in perl 5 ?)
Message-Id: <34887102.9AA54029@cks.ssd.k12.wa.us>
> That's an idea: Make the next version of Perl have a number that's so
> large that nobody will want to keep using Perl4.
>
> Perl98!
Tom Phoenix has crossed to the Dark Side. Heaven help us all.
Jerome "Using the Schwanz" O'Neil
------------------------------
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 1424
**************************************