[18930] in Perl-Users-Digest
Perl-Users Digest, Issue: 1125 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 13 09:05:33 2001
Date: Wed, 13 Jun 2001 06:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <992437511-v10-i1125@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 13 Jun 2001 Volume: 10 Number: 1125
Today's topics:
Re: a question to programmers. <thinkit8@lycos.com>
Re: Can an lvalue sub also be an rvalue? (Anno Siegel)
Re: colors <andrew@mvt.ie>
Re: Determing the location of perl in a Perl script <somewhere@in.paradise.net>
Re: efficient change file with locking? <twanGEENSPAM@twansoft.com>
Re: Help with split?vvp (Rolf Krahl)
Re: how do I sort the output of this? <krahnj@acm.org>
Re: How to make a Perlscript Shareware? <admin@the-piper.net>
HTML to POD <AHALL5@nc.rr.com>
Re: is there a windows installer for perl ? <simon.andrews@bbsrc.ac.uk>
Re: modules (no, not perl modules) (Anno Siegel)
Re: newbie question (Garry Williams)
Re: perl script runs twice (Helgi Briem)
Re: PIng status ? <martin.cassidy@uk.sun.com>
Re: Problem with nph-script <SEE_MY_SIG@nospam.demon.co.uk>
Re: Problem with nph-script <flavell@mail.cern.ch>
Re: REGEX <bart.lateur@skynet.be>
Re: Removing ^M characters (Helgi Briem)
Re: Removing ^M characters <buggs-clpm@splashground.de>
Re: spawnv() in Perl? <clpl@snakefarm.org>
What causes Broken Pipe errors with sockets <b_feeney@vistech.ie>
Re: What causes Broken Pipe errors with sockets <buggs-clpm@splashground.de>
Re: What is ${'string'} ? <bart.lateur@skynet.be>
Re: What is ${'string'} ? Gordon.Haverland@gov.ab.ca
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Jun 2001 03:07:05 -0700
From: thinkit <thinkit8@lycos.com>
Subject: Re: a question to programmers.
Message-Id: <9g7e09018la@drn.newsguy.com>
In article <m3bsnsdi0g.fsf@mumonkan.sunstarsys.com>, Joe says...
>
>
>thinkit <thinkit8@lycos.com> trolls clp.misc this time and writes:
>
>> In article <tid2dtk5i80ja6@corp.supernews.com>, cberry@cinenet.net says...
>> >
>> >thinkit (thinkit8@lycos.com) wrote:
>> >: if a language only offered hexadecimal and binary input literals,
>> >: would you be more or less likely to utilize it? in a similar line,
>> >: how much hexadecimal do you use in the languages you use now? do
>> >: you count to 16, or to 0x10?
>> >
>> >I wouldn't use it. After all, even (most) assemblers offer string
>> >literals and the like. Having
>> >
>> > print 0x48656c6c6f2c20776f726c64210a;
>> >
>> >as your first program seems a bit...retro. :)
>> >
>
>[... sig snipped ...]
>
>> oops, i meant only hexadecimal and binary integer literals--and no
>> decimal. thus a-f would have same status as 0-9 w/regards to naming,
>> and you would need no "0x".
>>
>
>What next, mandatory conversion to the new metric system?
>BTDT, Jimmy Carter- and it's still 2880249322, IOW
>
> A_BAD_1DEA.
>
>
>all.SCORE application accepted.
>
>[F'ups set.]
>
>--
>Joe Schaefer "The past may not repeat itself, but it sure does rhyme."
> --Mark Twain
not really...they are quite different. your average moron who doesn't realize
anything but decimal exists can use metric just fine. it takes intelligent
people to understand hexadecimal.
------------------------------
Date: 13 Jun 2001 10:54:09 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Can an lvalue sub also be an rvalue?
Message-Id: <9g7goh$qv2$1@mamenchi.zrz.TU-Berlin.DE>
According to Ilya Zakharevich <nospam-abuse@ilyaz.org>:
> [A complimentary Cc of this posting was sent to
> John Lin
> <johnlin@chttl.com.tw>], who wrote in article <9g6gcb$hoo@netnews.hinet.net>:
> > > > > Can a sub declared with the "lvalue" attribute also be used as a
> > > > > regular (rvalue) sub?
> > > > > $thing_status = status($thing) ; # get thing's status
> > > > > status($thing) = 0 ; # reset thing's status
> > > >
> > > > Your code tells your the answer. Does it compile? Does it work?
>
> > Oh, sorry. In our Perl discussion group, sometimes people ask questions
> > like: "What would 'print sqrt(-1)' prints?" I would answer in this manner.
>
> Do not. Because it is a wrong answer. The answers to both these
> questions cannot be detected by experiments, because they are not
> completely documented.
>
> perl -MMath::Pari=:int -wle 'print sqrt -1'
> 1.000000000000000000000000000*I
>
> *No* question about programming may be answered by experiments (unless
> answered negatively ;-). This is the difference between programming
> and scripting.
Agreed, with reservations about the script/program semantics. But
I think you will agree too, that before asking "What would 'print
sqrt(-1)' print?" it's a good idea to run "perl -le 'print sqrt(-1)'".
And, if a poster gives indication of not having done so, that should
be pointed out.
Anno
------------------------------
Date: Wed, 13 Jun 2001 11:13:29 +0100
From: "Andrew" <andrew@mvt.ie>
Subject: Re: colors
Message-Id: <9g7eba$914$1@kermit.esat.net>
"gnari" <gnarinn@hotmail.com> wrote in message
news:992004984.121366990264505.gnarinn@hotmail.com...
> In article
<Pine.GSO.4.10.10106080849270.25194-100000@skinner.cs.mcgill.ca>,
> Alexander BATKO <abatko@cs.mcgill.ca> wrote:
> >
> >I've been using highlighting text in some of the output of my programs,
> >however i don't really know why/how it works.
> >
> >Here's a simple example of what i'm talking about:
> >
> >print "\e[41;2mI Love Perl\e[0;0m\n";
> >
> this is highly non-portable, and is unlikely to work in a DOS console,
> for example
>
> gnari
>
It is possible to get ANSI escape sequences like the one shown above to work
with DOS using nansi.sys, a replacement for ansi.sys which is supplied by
Microsoft.
nansi.sys can be found around the place on the internet, but it won't work
with Windows NT or 2000, only Win98 or previous. It would be better to use
Win32::Console for this kind of thing if using a Windows based system.
Andrew
------------------------------
Date: Wed, 13 Jun 2001 22:44:20 +1000
From: "Tintin" <somewhere@in.paradise.net>
Subject: Re: Determing the location of perl in a Perl script
Message-Id: <efJV6.29$HJ4.1833004@news.interact.net.au>
"Philip Newton" <pne-news-20010613@newton.digitalspace.net> wrote in message
news:6kdeitsiunj0o313bfamsm6am5r5g6rvmi@4ax.com...
> On Wed, 13 Jun 2001 18:19:01 +1000, "Tintin" <somewhere@in.paradise.net>
> wrote:
>
> > What I need to know is whether there is a portable way to know the
location
> > of the perl binary from inside a perl script? I've looked through the
> > special variables and can't see anything obvious.
>
> Look through them again. Look especially at the one called $^X :-)
Somehow I managed to miss that one. Thanks for pointing it out to me.
>
> (Well, that's the location of *a* perl binary; specifically, the one
> that is interpreting the current script -- and from what I read ("from
> C's argv[0]") it may only be the binary's idea of what it's called but
> could theoretically be spoofed, and/or it may not contain a full path[1]
> if the local C library doesn't put the full path in argv[0]. But it's
> probably OK in practice.)
For my purposes, I think it should do the job, although I'll need to do some
testing under Win/NT to see what results it gets.
------------------------------
Date: Wed, 13 Jun 2001 13:09:01 +0200
From: Twan Kogels <twanGEENSPAM@twansoft.com>
Subject: Re: efficient change file with locking?
Message-Id: <u6ieit01ojglrvm3vc2mcnt2t5bfuqfsr8@4ax.com>
On 13 Jun 2001 09:22:17 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:
>According to Twan Kogels <twanGEENSPAM@twansoft.com>:
>> On 13 Jun 2001 08:17:09 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
>> Siegel) wrote:
>>
>>
>> >>
>> >> This is the version without lock feature. But when i use locking it
>> >> still can go very wrong, because between the last close() call and the
>> >> first rename() call another proces could read the file. And because i
>> >> sometimes have more then 5 hits per second the chances of going wrong
>> >> are high.
>> >>
>> >> Is there a solution for this problem?
>> >
>> >In a Unix-ish environment it's easy: just keep the files open (and
>> >the lock in place) until after the rename. You can rename an open
>> >file.
>> >
>> Thanks, great news! Should the following code run without locking
>> problems on a unix bsd machine?
>
>I see a few problems.
>
>> ------
>> $old = $file;
>> $new = "$file.tmp.$$";
>> $bak = "$file.orig";
>> open(OLD, "< $old") or die "can't open $old: $!";
>> open(NEW, "> $new") or die "can't open $new: $!";
>>
>> flock(OLD, 2);
>
>Don't use hard coded values for the flock flag. "use Fcntl ':flock'"
>will give you the system-independent LOCK_EX instead.
>
>You will also want secure exclusive access to both files, because
>part of the time $old is the one that would be opened by a concurring
>process, and part of the time it's $new. This means you may have
>to open $old for both reading and writing (even if you don't write
>to it) because many systems don't give you an exclusive lock for
>a file that's only open for reading.
>
Thanks for the explaination. Maybe other people had the same problem,
so i'll post the changed code:
----
$file="test.txt";
$old = $file;
$new = "$file.tmp.$$";
$bak = "$file.orig";
open(OLD, "+< $old")||&OpenError("can't open $old: $!");
open(NEW, "> $new")||&OpenError("can't open $new: $!");
if($use_lock==1)
{
flock(OLD, 2);
flock(NEW, 2);
}
while (<OLD>)
{
print NEW "test: ".$_;
}
if($use_lock==1)
{
rename($old, $bak)||&OpenError("can't rename $old to $bak:
$!");
rename($new, $old)||&OpenError("can't rename $new to $old:
$!");
}
close(OLD);
close(NEW);
if($use_lock==0)
{
rename($old, $bak)||&OpenError("can't rename $old to $bak:
$!");
rename($new, $old)||&OpenError("can't rename $new to $old:
$!");
}
-----
(I set $use_lock to 0 when i test it on my local machine)
Thanks again for the support,
Twan
------------------------------
Date: 13 Jun 2001 12:56:15 GMT
From: rolf.krahl@gmx.net (Rolf Krahl)
Subject: Re: Help with split?vvp
Message-Id: <9g7ntf$e$1@kohl.informatik.uni-bremen.de>
In article <3B26993E.53AA12FF@stomp.stomp.tokyo>,
"Godzilla!" <godzilla@stomp.stomp.tokyo> writes:
>
> As you can see, my editor adds a newline even
> when I do not create one with my Enter key.
> This is verified in my tests three and four.
>
> Truth is you are right. My mistake is in not
> noticing what my program editor does. I was
> actually terminating with \n\n although my
> editor only displays one terminating \n after
> a search and replace.
So they are still advantages in using cat as text editor. :)
--
Rolf Krahl <rolf.krahl@gmx.net>
------------------------------
Date: Wed, 13 Jun 2001 11:24:24 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: how do I sort the output of this?
Message-Id: <3B274D66.84CD4A84@acm.org>
Patrick Flaherty wrote:
>
> Hello,
>
> Have the following procedure that I just wrote:
>
> #
> # Usage: perl dtrees.pl PATH
> # if PATH not defined then PATH=.
> #
> use File::Find;
> my $this_subtree;
>
> @ARGV = ('.') unless @ARGV;
> my $dir = $ARGV[0];
my $dir = $ARGV[0] || '.';
> # if there isn't a backslash at the end of ARGV[0] add one
> if ( substr($dir,-1) ne "\" ) { $dir = $dir . "\";}
^^ ^^
This is a syntax error. You should use a slash instead of a backslash or
escape the backslash.
> opendir DIR, $dir or die "can't opendir $dirname: $!";
^^^^^^^^
Where did the variable $dirname come from?
> while (defined($file = readdir(DIR))) {
> if (-d ($dir . $file) && $file ne "." && $file ne "..") {
> find sub { $this_subtree += -s }, ($dir . $file);
> write();
> $this_subtree = 0;
> }
> }
> closedir(DIR);
>
> format STDOUT =
> @<<<<<<<<<<<<<<<<<<<<< @###########
> $file $this_subtree
> .
>
> This works well enough. It takes all the directories within pwd and finds the
> subtree of each.
>
> Next iteration. I'd like to sort the output by the size field ($this_subtree).
>
> I've tried saving each line produced by the write() statement via a push to an
> array. But it's not clear to me how to use sort to sort on a certain column
> range within each string? Or do I need to set up my elements as data structures
> (with, presumably, a name and a size)?
John
--
use Perl;
program
fulfillment
------------------------------
Date: Wed, 13 Jun 2001 11:10:09 GMT
From: "Tom Klinger" <admin@the-piper.net>
Subject: Re: How to make a Perlscript Shareware?
Message-Id: <lSHV6.14213$cF.311114@news1.nokia.com>
"Steven" <steve.busiello@gs.com> wrote in message
news:fa45b871.0106121336.23a10231@posting.google.com...
> Or use perl2exe
>
> http://www.indigostar.com/perl2exe.htm
>
Hi Steven,
could be a possible solution. The only problem is that the script after
compiling with perl2exe is a bit too large.
So, does anybody know an other way to protect (for example license file or
so) ?
Cheers, Tom
------------------------------
Date: Wed, 13 Jun 2001 12:39:06 GMT
From: "Antoine Hall" <AHALL5@nc.rr.com>
Subject: HTML to POD
Message-Id: <K9JV6.90484$e34.12940173@typhoon.southeast.rr.com>
I have seen POD to PDF, POD to HTML, etc. modules, but is there a module out
there that will convert HTML to POD files?
==
'Toine
------------------------------
Date: Wed, 13 Jun 2001 11:35:20 +0100
From: Simon Andrews <simon.andrews@bbsrc.ac.uk>
Subject: Re: is there a windows installer for perl ?
Message-Id: <3B2741E8.A2503B1F@bbsrc.ac.uk>
ivan markose wrote:
>
> I'd like to know if there is a package to install perl
> on windows, not binaries that I don't know the head
> or tail of. I found this very good book - Mastering
> algorithms with Perl that I would like to learn from.
> Again what I have in mind is along the lines of
> the python installer for windows.
There is nothing stopping you from getting a C compiler, downloading the
perl source (www.perl.org) and compiling it yourself, but are you sure
you really want to?
Binary distributions, like the one from Activestate
(www.activestate.com) are just precompiled versions of the standard
source (with appropriate platform-specific modifications). The Perl you
write will work just the same under a precompiled binary as one you have
slaved to compile yourself. Once you have perl installed, then "perl
myprog.pl" should give you the same results wherever your perl came
from.
Simon.
------------------------------
Date: 13 Jun 2001 12:30:54 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: modules (no, not perl modules)
Message-Id: <9g7mdu$4hb$1@mamenchi.zrz.TU-Berlin.DE>
According to Todd Smith <todd@designsouth.net>:
> Where can I learn to build a perl app that's advanced enough to be able to
> load other outside modules (written for it, not Perl modules), and use that
> code? How do you make a script know when to give control to an outside
> module and what to expect back?
Start at perlxs and follow the pointers...
Anno
------------------------------
Date: Wed, 13 Jun 2001 13:02:21 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: newbie question
Message-Id: <slrn9iep2s.8oo.garry@zfw.zvolve.net>
On Tue, 12 Jun 2001 11:30:02 +0200, Juan Delgado Díaz-Pache <jddp@tid.es> wrote:
> Here you have your error:
[snip]
> Collecting New Data...
> ERROR: Tue Jun 12 11:39:37 101: Process CreateSourceTablesRequest-1: DMMPerlEngi
> ne.EvalString[PerlFeature, 8]:
> perl_eval_pv FAILED: Can't locate warnings.pm in @INC (@INC contains: /usr/l
> ocal/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 /home2/trapnell/per
> l5/lib/5.00503/sun4-solaris /home2/trapnell/perl5/lib/5.00503 /home2/trapnell/pe
> rl5/lib/site_perl/5.005/sun4-solaris /home2/trapnell/perl5/lib/site_perl/5.005 .
> Perl /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/sit
> e_perl/5.6.1 /usr/local/lib/perl5/site_perl) at /usr/local/lib/perl5/5.6.1/warni
> ngs/register.pm line 11.
> BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.6.1/vars.pm line 12.
> BEGIN failed--compilation aborted at Perl/DmmPerl.pm line 7.
Removing the file caused this error. The serach path shows two
versions of perl are installed: `5.6.1' and `5.00503'. The perl
executable is from the 5.00503 version because that version complains
about the legal syntax in warnings.pm.
Fix your PATH variable to find the right version of perl or change the
`#!' line in the script you're executing to point to the right
version. Also remove the old search path directories (the ones with
`5.00503') from the @INC variable. They probably got there from the
PERL5LIB environment variable.
--
Garry Williams
------------------------------
Date: Wed, 13 Jun 2001 10:57:24 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: perl script runs twice
Message-Id: <3b2746a7.1217734329@news.isholf.is>
On 12 Jun 2001 13:32:40 -0700, ccc2@lehigh.edu (chris)
wrote:
>I have a perl script acting as a CGI, and when I run it in IE 5.5, it
>runs twice for no discernable reason. It works fine in IE 5.0, does
>anybody have any idea why 5.5 could be making it run twice, and how I
>could make it stop?
It looks to me as if you have a problem with your
FeebleDork. Ugrade your Frimnitzer to version 6
and reapply Service pack 1.3 to your GobbleDiGook.
Regards,
Helgi Briem
------------------------------
Date: Wed, 13 Jun 2001 12:02:02 +0100
From: martin cassidy <martin.cassidy@uk.sun.com>
Subject: Re: PIng status ?
Message-Id: <3B27482A.D5924382@uk.sun.com>
Many thanks for the information, now i know how to access perldocs. I
solved my problem with a simple line of :
foreach $host (@hosts)
{
$ping = `/usr/sbin/ping $host$domain`;
if ($? != 0)
{
do stuff..
}
else
{
do stuff ...
}
Tom Klinger wrote:
>
> "martin cassidy" <martin.cassidy@uk.sun.com> wrote in message
> news:3B27272C.4153CDC3@uk.sun.com...
> > Hi all,
> >
> >
> > Could any one let me know how to grab the return code of a ping command
> > ie 0 for successful and any other number for ping failure in a script im
> > working on ?
> >
> >
>
> May I suggest you to use Net::Ping?
> Information about is available here:
> http://search.cpan.org/doc/RMOSE/Net-Ping-2.02/Ping.pm
>
> Hope this helps.
>
> Cheers, Tom
------------------------------
Date: Wed, 13 Jun 2001 12:34:39 +0100
From: James Taylor <SEE_MY_SIG@nospam.demon.co.uk>
Subject: Re: Problem with nph-script
Message-Id: <ant131139354fNdQ@oakseed.demon.co.uk>
In article <9g7ct3$5ni@news.Informatik.Uni-Oldenburg.DE>, Andreas Riese
<URL:mailto:Andreas.Riese@Informatik.Uni-Oldenburg.DE> wrote:
>
> I've written an nph-script which should print the output line by
> line in the browser, while the script ist still running. This works
> fine in Netscape browsers but doesn't work in Internet Explorer
> on Mac OS (but it works on Windows 98).
Just a guess but, perhaps the IE on the Mac was configured to read
through a caching proxy that doesn't deal with nph scripts correctly.
Turn the proxy setting off to see if I'm right.
> the filename begins with 'nph-' and the webserver is an Apache.
I may be wrong, in which case please correct me, but I thought that
Apache no longer required nph script filenames to start with 'nph-'
because it treated all scripts the same. All you should have to do
is output the correct headers (which you seem to be doing) and ensure
that Perl is not buffering output by setting $| = 1;
--
James Taylor <james (at) oakseed demon co uk>
Based in Hammersmith, London, UK.
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02
------------------------------
Date: Wed, 13 Jun 2001 14:19:30 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Problem with nph-script
Message-Id: <Pine.LNX.4.30.0106131401560.4222-100000@lxplus003.cern.ch>
On Wed, 13 Jun 2001, James Taylor wrote:
> I may be wrong, in which case please correct me, but I thought that
> Apache no longer required nph script filenames to start with 'nph-'
> because it treated all scripts the same.
Your actual statement is wrong as it stands. You may have read
something about Apache not buffering parsed-headers scripts, and so
it's not essential to use nph scripts in order to get output displayed
incrementally. That much is true.
But there are other differences between parsed-header- and nph-
scripts, and those have not changed. There is no parsed-header CGI
response that is also valid as a non-parsed-header response per the
specification (RTFM for details); CGI.pm will look after the
differences for you if you will let it.
> All you should have to do
> is output the correct headers (which you seem to be doing) and ensure
> that Perl is not buffering output by setting $| = 1;
I have no argument with that part of your answer. But the headers
need to be "correct" for whichever kind of response you are making,
which means you either have to take care of that yourself, or entrust
it to an appropriate module.
------------------------------
Date: Wed, 13 Jun 2001 10:47:26 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: REGEX
Message-Id: <93heit86ojgg7ap66g9qooa2u9psk2rc60@4ax.com>
Ren Maddox wrote:
>Even that last one breaks down if the starting quote is preceded by a
>backslash q/\"like this"/;
>
>The look-behind solution can handle that problem as well:
>
>/((?<!\\)".*?(?<!\\)")/sg
>
>works well as long as you don't anchor it.
Not if there's an escaped backslash in front of it, i.e. two
backslashes. But, even then, the backslash in front of *that* could be
escaped, i.e. 3 backslashes. Or 4. etc.
Since the OP was only interested in anchored matches, i.e. starting with
\G, this is a useless route, as there is no real fully complete solution
this way. Anchor it, that's all you can do to be safe.
--
Bart.
------------------------------
Date: Wed, 13 Jun 2001 10:53:03 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: Removing ^M characters
Message-Id: <3b2744b4.1217235372@news.isholf.is>
On Tue, 12 Jun 2001 15:46:05 -0400, Thanh Q Lam
<thanh.q.lam@alcatel.com> wrote:
>Does anyone know how to remove the "^M" characters at the end of each line
>which without removing uppercase M that may have in the same line in perl?
Hm it's not exactly a ^M, although it is shown as such in
certain Unix editors. What it is is a Linefeed character,
\r in Perl. Lines are delimited with \r on Macs and with
\r\n in DOS/Windows.
I use the following regular expression to fix this:
s/\r\n*/\n/g;
often in the form of a short script which converts
Mac/DOS files to Unix format:
#!/usr/bin/perl -w
while (<>) {s/\r\n*/\n/g;}
continue {print;}
Regards,
Helgi Briem
------------------------------
Date: Wed, 13 Jun 2001 13:46:27 +0200
From: buggs <buggs-clpm@splashground.de>
Subject: Re: Removing ^M characters
Message-Id: <9g7jt3$7md$03$1@news.t-online.com>
Helgi Briem wrote:
> Hm it's not exactly a ^M, although it is shown as such in
> certain Unix editors. What it is is a Linefeed character,
> \r in Perl. Lines are delimited with \r on Macs and with
> \r\n in DOS/Windows.
In Perl
\r is called return character,
\n is called newline character
Ah, and it's really wierd with Macs.
Buggs
------------------------------
Date: Wed, 13 Jun 2001 13:39:44 +0200
From: Carsten Gaebler <clpl@snakefarm.org>
Subject: Re: spawnv() in Perl?
Message-Id: <3B275100.A63C5673@snakefarm.org>
Rasputin wrote:
> Depends. What does spawnv() do?
> Don't think it's a standard library call.
Yes, you're right, it's not part of the C library. This spawnv() I saw was
a fork() with an execv(). Sorry for that.
cg.
------------------------------
Date: Wed, 13 Jun 2001 11:26:22 +0100
From: "Bryan Feeney" <b_feeney@vistech.ie>
Subject: What causes Broken Pipe errors with sockets
Message-Id: <9g7fc3$7jqjg$1@ID-92000.news.dfncis.de>
I've done this client/server thingwith TCP/IP sockets to abstract & cache
I/O for a comment page. The problem is sometimes I get a "Broken Pipe"
error. I found when I put in a load of debugging print statements it seemed
to go away. Do you know what's causing this, and how to fix it? I'm using
IO:Socket
Thanks in advance
--
Bryan Feeney - http://www.bfeeney.uklinux.net/
Turing test - tell the computer to simulate Alan Turing, then ask him if
he's "just a simulation"
------------------------------
Date: Wed, 13 Jun 2001 14:30:47 +0200
From: buggs <buggs-clpm@splashground.de>
Subject: Re: What causes Broken Pipe errors with sockets
Message-Id: <9g7mg7$a90$04$1@news.t-online.com>
Bryan Feeney wrote:
> I've done this client/server thingwith TCP/IP sockets to abstract & cache
> I/O for a comment page. The problem is sometimes I get a "Broken Pipe"
> error. I found when I put in a load of debugging print statements it
> seemed to go away. Do you know what's causing this, and how to fix it? I'm
> using IO:Socket
If the client disconnects suddenly you get a SIGPIPE.
Setup a handler for these.
If your system supports it you could set it to IGNORE, like
$SIG{PIPE} = 'IGNORE';
Buggs
------------------------------
Date: Wed, 13 Jun 2001 10:49:14 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: What is ${'string'} ?
Message-Id: <maheit0654jds4f1i8fhr710pa5r2r7pfq@4ax.com>
Todd Smith wrote:
>> > print "I have two ${item}s";
>>
>> But that is not the same as
>>
>> print "I have two ${'item'}s";
>>
>> Which is what the OP was talking about.
>how's it different?
See my other post in another subthread. (Msg ID =
<hsbcitc2b2elrkrh0mvgf3na8mfd3ta2ts@4ax.com>)
--
Bart.
------------------------------
Date: Wed, 13 Jun 2001 12:47:12 GMT
From: Gordon.Haverland@gov.ab.ca
Subject: Re: What is ${'string'} ?
Message-Id: <3b276002.75040544@news.gov.ab.ca>
On Wed, 13 Jun 2001 00:07:03 GMT, "Todd Smith" <todd@designsouth.net>
wrote:
>"Wyzelli" <wyzelli@yahoo.com> wrote in message
>news:KdxV6.4$_p6.3250@vic.nntp.telstra.net...
>> "Todd Smith" <todd@designsouth.net> wrote in message
>> news:mhuV6.140808$I5.37858595@news1.rdc1.tn.home.com...
>> > print "I have two ${item}s";
>>
>> But that is not the same as
>>
>> print "I have two ${'item'}s";
>>
>> Which is what the OP was talking about.
I'll settle for descriptions as to why a person would use either, or
both. This program I am trying to install has a number of hashes
scattered throughout it. All hashes except for one are named, like
$hash{key}, $item{'key'} or $item{"key"}. To me, this looks like the
original programmer just made a mistake. Is there some different
about ${key} or ${'key'} which points to its use in special
circumstances?
Gord
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 1125
***************************************