[6390] in Perl-Users-Digest
Perl-Users Digest, Issue: 15 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 26 05:07:10 1997
Date: Wed, 26 Feb 97 02:00:20 -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 Wed, 26 Feb 1997 Volume: 8 Number: 15
Today's topics:
Re: Alarm signal caught--program dies <sadd@msc.cornell.edu>
Re: bash to perl script <gsievers@gsievers.xnet.com>
Help with variation of form-mail.pl <vha@apc.net>
Re: How to spam - legitimately <tchrist@mox.perl.com>
Re: How to spam - legitimately <tchrist@mox.perl.com>
Re: How to spam - legitimately <tchrist@mox.perl.com>
Re: How would I write this more concisely (Tad McClellan)
Installing Perl modules without write access to Perl tr (Lloyd Zusman)
Re: Libwww, Simple.pm and env_proxy.al? @INC trouble. (Scott Meyer)
Object Perl Method <baku@india.ti.com>
Perl and NT (Denis Dumouchel)
Perl as a systems programming language <Trhowe@cris.com>
Re: Perl on Windows 95 <hanklem@ibm.net>
Re: Question on "eval" <rootbeer@teleport.com>
Re: Regular Expression question <ajohnson@gpu.srv.ualberta.ca>
Socket problem: sometimes getting garbage back on Solar (Gideon King)
WANTED: BBEdit Tips and Tricks <natanya@io.com>
Re: weird split prob <roderick@gate.net>
Re: Why do I get a ^\ when doing "multi-dimension" key (Brian L. Matthews)
Writting file to server <apinter@ptd.net>
Re: Writting file to server (Tad McClellan)
Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 25 Feb 1997 21:17:37 -0500
From: Michael Sadd <sadd@msc.cornell.edu>
To: Elliott McCrory <mccrory@fnal.gov>
Subject: Re: Alarm signal caught--program dies
Message-Id: <33139D41.6A136CFA@msc.cornell.edu>
The following code works on my Linux box:
#!/usr/bin/perl -w
$SIG{'ALRM'}= 'mysub';
alarm 4;
while (<>) {
print "Read line $_";
}
print "Error code was $!.\n";
sub mysub {
my($sig) = @_;
print "received signal: $sig\n";
}
__END__
line
Read line line
received signal: ALRM
another line
Read line another line
^D
Error code was Interrupted system call.
However, if I run it on a Sun, I get kicked out right
after the signal is received, with the same error.
The issue isn't so much with perl as it is with whether your
machine is using System V or BSD type signal handling. The
signal almost certainly arrives when you are reading from
standard input with <>. Under Sys V, when an i/o primitive
is interrupted by a signal handler, it exits immediately
with an EINTR error, and a total number of characters read
of zero. Your loop then exits.
My Linux box can go either way. Whoever compiled perl for me
must have defined the BSD type handlers. Luck for me, not
so for you :)
Actually, the way around this is to test if the error condition
was EINTR, and just continue on:
#!/usr/bin/perl -w
$SIG{'ALRM'}= 'mysub';
alarm 4;
while ($line=<> or $! eq 'Interrupted system call') {
print "Read line $line" if $line;
$!=0;
}
print "Error code was $!.\n";
sub mysub {
my($sig) = @_;
print "received signal: $sig\n";
}
__END__
line
Read line line
received signal: ALRM
another line after the alarm
Read line another line after the alarm
^D
Error code was .
The moral: Trash Solaris and get yourself a nice Linux box!
Mike
Elliott McCrory wrote:
>
> How do I catch an alarm signal and continue on? Here is the perl:
>
> #!/usr/local/ap/bin/perl
>
> $sec = 10;
> $SIG{ALRM} = \&mysub;
>
> alarm $sec;
> print "Waiting\n";
> while (<>) {
> print "Line read $_";
> }
>
> sub mysub {
> print "Alarm signal caught\n";
> return; # Effect is the same with and without this return
> }
>
> And it runs like this:
>
> solaris$ test-alarm.pl
> Waiting
> Write a line while I wait
> Line read Write a line while I wait
> Alarm signal caught
> solaris$
>
> It exits immediately after catching signal.
> --
> Elliott S. McCrory, Ph. D. | mccrory@fnal.gov
> Fermi National Accelerator Lab | http://www-linac.fnal.gov/~mccrory
> MS 307, PO Box 500 | Phone: 630-840-4808
> Batavia, IL 60510 | FAX: 630-840-8590
------------------------------
Date: 25 Feb 1997 21:46:29 -0600
From: Jerry Sievers <gsievers@gsievers.xnet.com>
Subject: Re: bash to perl script
Message-Id: <x7u3n0teju.fsf@gsievers.xnet.com>
Steve Vandiver <buxx@buxx.com> writes:
>
> What is the perl equiv of this bash statment?
> I keep getting compile errors no matter which
> way I write it.
>
> Need to detect if file exists then ... else ...
>
>
> if [ -f /var/run/ppp0.pid ] ; then
> {
> ...
> }
> else
> {
> ...
> }
> fi
>
> Thx
> mailto://buxx@buxx.com
if ( -f "/var/run/ppp0.pid" )
{
# do something now
}
else
{
# do some other thing
}
this is pretty basic stuff... maybe reading the perl docs is in order?
--
@------------------------------------------------------------------@
| Jerry Sievers Unix Admin/Web Site Architect |
| 312 527-0618 (home) mailto:gsievers@xnet.com |
| 847 267-3594 (work) http://www.xnet.com/~gsievers |
@------------------------------------------------------------------@
------------------------------
Date: Tue, 25 Feb 1997 18:33:23 -0800
From: Vinh Ha <vha@apc.net>
Subject: Help with variation of form-mail.pl
Message-Id: <3313A0F3.499@apc.net>
Hi,
I need to write a script that will allow a user to attach a file within
a form. That will then be mailed along with the form input to my
email...any suggestions?
Thanks in advance.
--
**
*********
******** _O_ *
*********** |
***************_ /_\__,
*********************
***************************
*********************************
+--------------------------------+
| |
| Vinh Ha |
| (714)216-2160 |
| http://www.azurecreations.com |
| vha@azurecreations.com |
| vha@apc.net |
| |
+--------------------------------+
------------------------------
Date: 26 Feb 1997 05:20:56 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to spam - legitimately
Message-Id: <5f0h7o$dk0$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
somsky@dirac.phys.washington.edu (William R. Somsky) writes:
:By the by, does anyone know if there are established terms for the
:two different types/usages of nouns I'm referring to here as
:"substansive" and "objective"?
I've always heard them as "count noun" versus "mass noun".
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
I can't change the way people talk,
but I can damn well complain about it.
--David Casseres in <28542@goofy.Apple.COM>
------------------------------
Date: 26 Feb 1997 05:19:44 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to spam - legitimately
Message-Id: <5f0h5g$dk0$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
jlerner@panix.com (Joshua Lerner) writes:
:1. three electronic mail messages -- awkward, wordy
:2. three email messages -- see above
:3. three messages -- ambiguous
:4. three eletters -- not commonly used, so awkward
:5. three pieces of electronic mail -- awkward, especially since "piece"
: suggests something material
:
:I have to say, I prefer "three emails" to the sorry candidates above.
Both 2 and 3 sound find, and aren't hard to understand or too long.
"Three emails" sounds like "Me talk good", and evokes a similar
gut response.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
If I don't document something, it's usually either for a good reason,
or a bad reason. In this case it's a good reason. :-)
--Larry Wall in <1992Jan17.005405.16806@netlabs.com>
------------------------------
Date: 26 Feb 1997 05:25:30 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to spam - legitimately
Message-Id: <5f0hga$dk0$3@csnews.cs.colorado.edu>
[courtesy cc of this posting denied to nimrod author due to
forged posting]
In comp.lang.perl.misc,
DeathToSpam@dev.null.com (Lee) writes:
:Unlike British English, French and other languages
:that maintain a language police, the english the rest of the world
:depends upon is truly democratic in the choice of words.
The French have their National Academy, and the Spanish their Royal
Academy, but in English we have no such body. We have various authors
and style guides whose opinions and examples we follow, but there exists
no Language Law in English.
Dat doughn't means that we be any which way we lighk aspeakin, dough.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"Text processing has made it possible to right-justify any idea, even
one which cannot be justified on any other grounds."
--J. Finnegan, USC.
------------------------------
Date: Tue, 25 Feb 1997 20:12:43 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: How would I write this more concisely
Message-Id: <r660f5.c45.ln@localhost>
Tad McClellan (tadmc@flash.net) wrote:
: Gene Johannsen (gej@spamalot.mfg.sgi.com) wrote:
: : What would be a more concise way of writing this? I'm not looking for
: : anything obfuscated, just something a little shorter and a little
: : clearer:
: : if ($#ARGV == -1) {
: : $sked_file = "sked";
: : }
: : else {
: : $sked_file = shift;
: : }
: : if ($#ARGV == -1) {
: : $min = 5;
: : }
: : else {
: : $min = shift;
: : }
: : It just parses two command line arguments, a filename and a time, both
: : of which are optional.
: $sked_file = shift or $sked_file = "sked";
: $min = shift or $min = 5;
Oh yeah.
If the arg is '' for $sked_file or 0 for $min, and you want to set
to those values, rather than the default, then my solution above
is a problem, not a solution ;-)
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 26 Feb 1997 03:14:46 GMT
From: ljz@asfast.com (Lloyd Zusman)
Subject: Installing Perl modules without write access to Perl tree.
Message-Id: <slrn5h7ak6.ra4.ljz@sunspot.tiac.net>
At one of the sites I work at, there is a nicely installed version of
Perl 5.003. This installation resides in /opt/lib/perl5, but only
sysadmins with root access can write into this tree.
Sometimes, we non-sysadmin types find some really neat modules from
CPAN that we'd like to use. We know how to download these modules,
unpack them, and then run the sequence ...
perl Makefile.PL
make
make test
make install
... on them.
Of course, the final "make install" step doesn't work because of my
lack of write permission to /opt/lib/perl5 at our site.
I'm hoping that there is some accepted method for properly installing
Perl modules into some user-specific directory (which can be referred
to in $PERLLIB or added to @INC) when the central library directory is
non-writable. I haven't been able to figure out any clean, mostly
automated way to do this.
Thanks in advance for any help you folks can provide.
--
Lloyd Zusman 01234567 <-- The world famous Indent-o-Meter.
ljz@asfast.com ^ Indent or be indented.
------------------------------
Date: Wed, 26 Feb 1997 05:35:44 +0100
From: Meyer@algonet.se (Scott Meyer)
Subject: Re: Libwww, Simple.pm and env_proxy.al? @INC trouble.
Message-Id: <Meyer-ya02408000R2602970535440001@news.algonet.se>
Thanks everyone for helping me out!
Changing use lib "/home/meyer/lib"; to
use lib "/home/meyer/lib/perl";
makes the scripts work now, as long as they don't need the IO or Net module.
Scott
---------
Here's a run through of what I was trying to do.
I've been trying to install the Libwww modules in my home account,
with only partial success. I tried it at two different servers
at two different internet providers with the same result
(one in the states, one in europe).
The IO/Socket.pm, Net/FTP.pm and MD5.pm were missing at both places.
With every module I do this:
perl Makefile.PL PREFIX=~
make
make test
make install
When I install the IO-1.15 (IO/Socket.pm) module everything looks fine,
but when I try to install additional modules like
libnet-1.04 (Net/FTP.pm) or Libwww, these modules cannot find
the IO module.
After succesfully installing the IO module
the file File.pm is to be found here:
./lib/perl5/IO/File.pm
./IO-1.15/IO/File.pm
./IO-1.15/blib/lib/IO/File.pm
When I try to install the libnet-1.04 module:
/home/meyer/libnet-1.04> perl Makefile.PL PREFIX=~
Can't locate IO/File.pm in @INC at Makefile.PL line 64.
BEGIN failed--compilation aborted at Makefile.PL line 64.
Setting the PERL5LIB environment variable to
"/home/meyer/lib"
doesn't change anything, but I get another message if I set it to:
"/home/meyer/lib/perl5"
/home/meyer/libnet-1.04> perl Makefile.PL PREFIX=~
Can't find loadable object for module IO in @INC (/home/meyer/lib/perl5 /u
sr/modules/perl/5.003/lib/perl5/sun4-solaris/5.003
/usr/modules/perl/5.003/lib/p
erl5 /usr/modules/perl/5.003/lib/perl5/site_perl/sun4-solaris
/usr/modules/perl/
5.003/lib/perl5/site_perl .) at /home/meyer/lib/perl5/IO/Handle.pm line 22
9
BEGIN failed--compilation aborted at /home/meyer/lib/perl5/IO/File.pm line
103.
BEGIN failed--compilation aborted at Makefile.PL line 64.
Is there something different in how the IO module installs?
I noticed IO installs in lib/perl5 whilst Libwww will install in lib/perl.
Is that significant?
Anyway, I guess I'll better read up on what make and makefiles are!
------------------------------
Date: Wed, 26 Feb 1997 10:20:57 +0530
From: Ajitesh Das <baku@india.ti.com>
Subject: Object Perl Method
Message-Id: <3313C130.41C67EA6@india.ti.com>
Can anyboby tell me the exact ( with a eg ) differences
between "Class method" and "Instance method"?
Thanks in advance!
--
Regards,
Ajitesh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AJITESH DAS TI INTERNAL MSGID : BAKU
SOFTWARE DESIGN ENGINEER E-MAIL ID : baku@india.ti.com
DART GROUP baku@msg.ti.com
EDA SYSTEMS a-das1@ti.com
ASIC PHONE: (091)-(080)-526-9451
TEXAS INSTRUMENTS INDIA PVT LTD Extn: 174
Wind Tunnel Road URL:- http://www.india.ti.com/~baku/
Murugheshpalya
Bangalore- 560017
Karnataka
India.
"Anything can change any time,in any manner,the whole world is the
field of all probabilities, all possibility." -- "The Discipline of
Yoga"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Wed, 26 Feb 1997 03:28:39 GMT
From: dd@mic.qc.ca (Denis Dumouchel)
Subject: Perl and NT
Message-Id: <5f0a6q$9rq$2@wagner.spc.videotron.ca>
Hello,
I have a CGI on a Linux system and it works quite good. But the
server is moving to NT soon. I would like to have some information to
help me make the transfer.
1- First, I had the following: #!/usr/bin/perl
that pointed I think to a file. I did not see such a file on the NT
system, can I only have it point to the Perl program?
2- Then there are a few variables that are use in the CGI:
$backurl = "http://college-granby-hy.qc.ca/";
$backname = "College de Granby Haute-Yamaska";
$mailprog = '/bin/mail';
$youmail = 'dd@mic.qc.ca';
$yourname = "Denis Dumouchel";
$get_date = "/bin/date";
are those valid in the NT world?
3- and concerning the: $mailprog = '/bin/mail'; and the
$get_date = "/bin/date"; who do I find out the correct path, the one
I have now being on the Linux system?
please reply by e-mail: dd@mic.qc.ca
thanks,
Denis
------------------------------
Date: Wed, 26 Feb 1997 04:00:29 -0500
From: Tim_Howe <Trhowe@cris.com>
Subject: Perl as a systems programming language
Message-Id: <Pine.SUN.3.95.970226035844.17968B-100000@viking.cris.com>
Granted that perl is a wonderful language, I have a few reservations and
questions about using it as a systems programming language, especially if we
want it to be OS-independent (on Unix and on NT).
My questions are:
Has anyone found a good way to make perl code accessible from both perl and
from the command line?
Is anyone really using perl as a complete substitute for shell languages?
Here are the problems I've run into in trying to substitute perl for the Korn
shell:
1. If I write a Korn shell script to perform a task, that script becomes a
command that is automatically available both from the command line and from
other scripts. But that's not how it works for perl, because the command line
processor is not the same as the perl interpreter. Even on Unix.
So I end up writing a .p and a .pl for many tasks that I implement in perl. I
can call a subroutine in the .pl from any perl program, and I can invoke the .p
from the command line (it processes the command line arguments and then invokes
the subroutine in the .pl file).
2. Perl has no copy command. This is not a large problem; I just write a
subroutine to do the copying. The subroutine finds out what the operating
system is and then invokes cp on Unix, copy on NT.
3. Similarly for rm, ls, etc. Perl has mkdir() but if I want the equivalent of
"mkdir -p", I have to write my own. So now I'm having to write a sort of
compatibility library.
4. To emulate the Korn shell's
for file in *.java; do
...
done
in perl, we need something like
foreach $file (&listfiles ("*.java"))
{
...
}
if we want it to be OS-independent.
5. And to emulate the Korn shell's
echo >> myfile
in perl, we need to open the file for append, write the string, then close the
file. Of course, we can write a subroutine to do that, but it's still not as
smooth as it is in Korn shell.
6. Here's something that's easy to do on the Korn shell:
# invoke Informix and submit database commands:
dbaccess << EoSQL
connect to '$db';
$dbcmd;
EoSQL
In perl this would be less straightforward, especially if we want our code to
be portable to DOS and to NT's DOS shell, which don't recognize "<<".
To repeat, my questions are:
Has anyone found a good way to make perl code accessible from both perl and
from the command line?
Is anyone really using perl as a complete substitute for shell languages?
Thank you.
------------------------------
Date: Tue, 25 Feb 1997 21:14:13 -0700
From: Hank LeMieux <hanklem@ibm.net>
To: puzzled@cris.com
Subject: Re: Perl on Windows 95
Message-Id: <3313B895.4756@ibm.net>
Peter Holtan wrote:
> I have the same question as Mark did. Please excuse me if my question
> sounds stupid, but I am very new to this. Where can I get a server?
Peter,
We're kind of getting off-subject as far as this newsgroup goes, but
since several people want to know I thought I'd post it rather than
email.
What you want to do is a Yahoo search for "web server windows". A whole
kaboodle will come up. I personally am using Netscape Fastrack 2.0 on
win95. You can give it a 90 day trial if you like. Just go to their
web site and follow the links. The other one I am familiar with is
Microsoft's Personal Web Server. You can download it from the MS site
(be persistent; I remember it's a little hard to find). Fasttrack was a
breeze to install and run. The only trick is that, during installation
when it asks you the domain address of your server, you have to make up
an IP #. I use 127.0.0.1. Then, you go into your browser and enter
that IP# in the URL window to access your server. Create a "cgi-bin"
directory within the server's "docs" directory, then go into the Admin
server and specify that directory as a shell cgi directory (this is all
in the Fasttrack documentation). Also remember to associate the .pl
extension with perl.exe, within Windows 95. Finally, create an HTML
document which calls the perl script (<FORM
ACTION="cgi-bin/yourscript.pl" METHOD="GET">) and place it in that
"docs" directory.
Bang! you're off & running. You'll be able to test your perl scripts
locally (except for ones that require Win96 to open a new socket, like
email scripts that call BLAT).
let's handle any more questions you may have by email, rather than on
this newsgroup.
Good Luck,
Hank
--
Hank LeMieux
Freelance Web Design/JavaScript/CGI
Santa Fe, NM, USA
(505) 986-8166
http://members.aol.com/HankWeb/
------------------------------
Date: Tue, 25 Feb 1997 18:41:52 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: David Salisbury <salisbur@venus.fsl.noaa.gov>
Subject: Re: Question on "eval"
Message-Id: <Pine.GSO.3.95q.970225183656.13796V-100000@kelly.teleport.com>
On 26 Feb 1997, David Salisbury wrote:
> #!/bin/perl
>
> $sortorder='$date$type';
>
> $date='05/01/96';
> $type="bob";
>
> $sometext = "this is some text";
>
> eval "\$anArray{$sortorder} = \$sometext"; ##<--- why no work??
This line results in this string.
$anArray{$date$type} = $sometext
The problem is that '$date$type' isn't a valid Perl expression, so that
code is syntactically invalid. Try putting '$date . $type' into
$sortorder, and this should work. Although there may be better ways to do
what you're trying to do. :-)
> If the directory name is any indication, I'm running perl 5.
It is an indication, but you can find a better answer with 'perl -v', and
maybe also 'perl -V'. Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Tue, 25 Feb 1997 22:41:34 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Regular Expression question
Message-Id: <3313BEFE.350F17C8@gpu.srv.ualberta.ca>
Darrel Riekhof wrote:
>
> > With (a*), the contents of the parens is the regex /a*/, so what that
> > matches is what $1 will be. This can be "", "a", "aa", "aaa", etc.,
> > depending on the string. If your string was "a", then it will be "a".
> >
> > |> Then I tried (a*)* and $1 had ''.
> >
> > Yup. $1 can be filled by /a*/, and that can match "".
>
> I still don't understand this part. /a*/ will match
> all the a's. Then the outer star should match 0 or
> more of the inner, but it chooses to match the empty
> string. I don't like this behavior. Is there a reason
> for it?
>
the outer star will try to repeat the inner regex, not what
the inner regex matched, meaning it will try to match zero
or more a's again.
> Still trying to figure out the reason why it doesn't always
> remember the maximal match......
>
$& does.
perhaps the following *may* help to clear some of this up...
(no promises)
take a look at the following test code:
#!/usr/bin/perl -w
$_="aabbbababb";
if (/((a*)(b*))*/) {
print "test 1:\n\t";
print ":1 is \'$1\'\n\t";
print ":2 is \'$2\'\n\t";
print ":3 is \'$3\'\n\t";
print ":all is \'$&\'\n\n";
}
if (/(a*)/) {
print "test 2:\n\t";
print ":1 is \'$1\' :all is \'$&\'\n\n";
}
if (/(a*)*/) {
print "test 3:\n\t";
print ":1 is \'$1\' :all is \'$&\'\n";
}
###end of script###
the escaped single quotes are just to show where
our variable should be in the output.
remember $& is the whole match regardless of ()'s.
output of this script with -w is:
((a*)(b*))* matches null string many times at - line 3.
(a*)* matches null string many times at - line 17.
test 1:
:1 is ''
:2 is ''
:3 is ''
:all is 'aabbbababb'
test 2:
:1 is 'aa' :all is 'aa'
test 3:
:1 is '' :all is 'aa'
-------------------------------end of output---
the first two warnings should point out the problem.
in test 1, the outermost * causes repetition of the inner
parentheses, correct?...so after $2 and $3 held aa and bbb
respectively, they went on to hold a and b , and then a and bb,
and then---this is the important part---((a*)(b*)) was able to match
the null at the end of the string...repeatedly as the warnings
point out---thankfully, perl recognizes this, or the question
might have been: "why doesn't my regex ever end?"
tests 2: zero or more a's will grab the first two a's,
and finish: $1 contains aa. it asks, can I match one a, yes,
can i match another? yes, another? no...done.
test 3: zero or more a's grabs the first two a's and is done, but
the outer * says try again from where you left off...so it
matches zero a's after the second a and before the first b,
and again, and again...
I think... :-)
regards
andrew
------------------------------
Date: 26 Feb 1997 05:06:57 GMT
From: gideon@csarc.otago.ac.nz (Gideon King)
Subject: Socket problem: sometimes getting garbage back on Solaris machine
Message-Id: <5f0gdh$ajf$1@celebrian.otago.ac.nz>
Keywords: Socket, Solaris, Help!
I am getting some odd behaviour running my sockets based system under
Solaris (it works fine under perl 5.002 and 5.003 on NeXTSTEP 3.3).
The symptoms are:
1. every second time a connection is attempted, the connection appears to
fail.
2. there seems to be garbage coming back from the perl program as well as
the correct data (one line of garbage - part of a variable, then my line
of data)
The way my program works:
A connection is made to my perl server process on a known port. It then
spawns another process to handle the ongoing communications and redirects
STDIN and STDOUT to the spawned process (this is all standard code I
copied from the perl docs). The child then reads from stdin a line at a
time, and prints stuff back to STDOUT for the client to read.
All pretty standard stuff, and as I said, it works perfectly on another
operating system with the same version of perl (we have tested with 5.002
and 5.003)
The person who built perl said that there may still be some old SunOS
libraries lying around which may be being picked up instead of the correct
ones. Is this possible or likely to cause these problems?
Any hints would be gratefully received.
---
Gideon King | Phone +64-3-479 9017
Senior Software Engineer | Fax +64-3-479 8529
The Black Albatross |
University of Otago |
Computer Science Applied | e-mail gideon@csarc.otago.ac.nz
Research Centre | NeXT mail, MIME ok. PGP key available.
Department of Computer Science |
P.O. Box 56 | I don't have a solution
Dunedin | but I admire the problem.
New Zealand |
WWW access: http://www.csarc.otago.ac.nz:805/
------------------------------
Date: 26 Feb 1997 01:57:06 GMT
From: Natanya <natanya@io.com>
Subject: WANTED: BBEdit Tips and Tricks
Message-Id: <5f059i$dob$1@nntp-2.io.com>
Keywords: BBEdit tips, tricks, resources
I am co-authoring the BBEdit Handbook with Bob LeVitus for Ziff-Davis
Press to be released later this spring. The book will cover using BBEdit
as an editor for both HTML and advanced programming.
I'm interested in any useful tips or tricks BBEdit users have discovered
over the years. This goes beyond the basic "how to use BBEdit"
information and into the relm of the voice of experience. Anyone who
shares a solid, useful trick or tip, HTML or programming related, will be
credited appropriately in the book.
Also, any useful resources such as web sites (other than barebones),
listservs, and such would be greatly appreciated.
I'm an experienced BBEdit user myself, but know that there are others out
there who have ideas I have never thought of and would like to share that
information with my readers.
Please send email to natanya@lanw.com.
TIA,
Natanya
--
Natanya A. Pitts
natanya@lanw.com
"Just because you can do something doesn't mean you should"
------------------------------
Date: 25 Feb 1997 20:46:33 -0500
From: Roderick Schertler <roderick@gate.net>
To: "Douglas L. Cordero, PhD" <dcordero@giss.nasa.gov>
Subject: Re: weird split prob
Message-Id: <pzohd8jqc8.fsf@eeyore.ibcinc.com>
On Tue, 25 Feb 1997 13:37:52 -0500, "Douglas L. Cordero, PhD" <dcordero@giss.nasa.gov> said:
>
> $line = "/lastly/I/have.hadit/jkdnkjnvf.89090100";
>
> @fields = split(/./, $line);
You mean
@fields = split(/\./, $line);
, see perlre(1). The code you've got splits on /./, which means any
character. The result is a bunch of empty strings (the empty strings
"between", before and after the characters of your original string)
which are dropped because split drops trailing empty fields if you don't
specify a limit.
--
Roderick Schertler
roderick@gate.net
------------------------------
Date: 25 Feb 1997 23:23:39 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: Why do I get a ^\ when doing "multi-dimension" key in associative array ?
Message-Id: <5f0odr$1ih$1@halcyon.com>
In article <5etagf$kri@chnews.ch.intel.com>,
Wai Fai Yee~ <wyee@sedona.intel.com> wrote:
|However when I tried to retrieve the value of the associative array using
|"$var1"."$var2" as the key, I got a NULL (See output from program).
Read perlvar, paying particular attention to $; (including the last
sentence).
Brian
--
Brian L. Matthews Illustration Works, Inc.
For top quality, stock commercial illustration, visit:
http://www.halcyon.com/artstock
------------------------------
Date: Tue, 25 Feb 1997 22:21:06 -0500
From: Adrian <apinter@ptd.net>
Subject: Writting file to server
Message-Id: <3313AC22.77DB@ptd.net>
I am trying to write a file to my ISP using perl. I have not previously
done any work with perl, but I am in the middle of a Java program in
which I need to write a binary file to a server, by POSTing data to it.
I wrote the program below (in spite of the fact that I don't know perl)
to try and accomplish this, but it did not work correctly. When I ran
the program while logged in with the "perl" command, it ran fine. But
when I tried actually posting data to it, I got no where. I set the
permissions to the necessary values; I even made a directory with
read/write permission for all, but nothing worked. The file did not
write when I called the script from my java program no matter what.
Please tell me what you think of this code and what you think my problem
is. Thanks in advance.
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
open(STDOUT, ">test/test.txt");
print("file sucessfully writen");
print($buffer);
exit 0;
-Adrian
------------------------------
Date: Tue, 25 Feb 1997 22:41:17 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Writting file to server
Message-Id: <dte0f5.7r5.ln@localhost>
Adrian (apinter@ptd.net) wrote:
: I am trying to write a file to my ISP using perl. I have not previously
: done any work with perl, but I am in the middle of a Java program in
: which I need to write a binary file to a server, by POSTing data to it.
: I wrote the program below (in spite of the fact that I don't know perl)
: to try and accomplish this, but it did not work correctly. When I ran
: the program while logged in with the "perl" command, it ran fine. But
: when I tried actually posting data to it, I got no where.
Well, if it runs from the command line, but not as a CGI, then
it is almost _never_ a perl problem.
Try asking in the CGI newsgroup:
comp.infosystems.www.authoring.cgi
: I set the
: permissions to the necessary values; I even made a directory with
: read/write permission for all, but nothing worked. The file did not
: write when I called the script from my java program no matter what.
: Please tell me what you think of this code and what you think my problem
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I think you have some sort of non-perl problem...
: is. Thanks in advance.
: read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
: open(STDOUT, ">test/test.txt");
: print("file sucessfully writen");
: print($buffer);
: exit 0;
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Jan 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.
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 15
************************************