[16797] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4209 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 2 14:05:34 2000

Date: Sat, 2 Sep 2000 11:05:19 -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: <967917918-v9-i4209@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 2 Sep 2000     Volume: 9 Number: 4209

Today's topics:
    Re: $LIST_SEPARATOR bug?? (Keith Calvert Ivey)
    Re: $LIST_SEPARATOR bug?? <flavell@mail.cern.ch>
    Re: $LIST_SEPARATOR bug?? <lr@hpl.hp.com>
    Re: Adding HTML to every page in a directory <brian+usenet@smithrenaud.com>
    Re: Backslash usage? <flavell@mail.cern.ch>
    Re: Backslash usage? (Keith Calvert Ivey)
        dont refresh <j.pfeiffer@roadtv.de>
    Re: dont refresh (Abigail)
    Re: Help! my comma's are comma%27s <tina@streetmail.com>
    Re: Help! my comma's are comma%27s <godzilla@stomp.stomp.tokyo>
    Re: learning perl <slipgun@desertsnake.abelgratis.com>
    Re: learning perl (Tony L. Svanstrom)
    Re: module install questions (RH) (Colin Keith)
    Re: module install questions (RH) <cyberjeff@sprintmail.com>
    Re: My Perl looks like C! <gellyfish@gellyfish.com>
    Re: Net::SMTP error codes <gellyfish@gellyfish.com>
    Re: open web file <gellyfish@gellyfish.com>
    Re: open web file <gellyfish@gellyfish.com>
    Re: output fun (Tony L. Svanstrom)
    Re: Parsing MySQL TEXT field (Keith Calvert Ivey)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sat, 02 Sep 2000 15:10:35 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: $LIST_SEPARATOR bug??
Message-Id: <39b61602.35837480@news.newsguy.com>

"Alan J. Flavell" <flavell@mail.cern.ch> wrote:
>On Sat, 2 Sep 2000, Keith Calvert Ivey wrote:
>
>(in a news posting tagged as iso-8859-1):
>
>> I don't think you can blame Redmond for this one.  Using `` for
>> double quotes is a Unix thing, in my experience.  Microsoft
>> quoting would have been something like $^T 
>
>dollar caret T??
>
>This seems to be the newsreader trying its best to display an 8-bit
>control character (i.e not a displayable graphic) from your iso-8859-1
>character coding.

That's about what I expected.

>Somehow I don't think you meant that.  This is the kind of
>misunderstanding that happens when people innocently paste the wrong
>character coding into a document.  Excuse me if I seem to be nagging,
>but IMHO it's safer when trying to _discuss_ this kind of problem, to
>take care not to fall into a similar trap oneself.

I suppose it was a bit silly, but what happened is what I was
intending.  I pasted in a character that I knew would be
misinterpreted, because the misinterpretations would be things
that a Windows-1252 quotation mark might show up as.  I'm sure
people saw it in various ways, but I doubt that anyone saw it as
$``, which was the point I was making.

>And on usenet you certainly cannot rely on your audience interpreting
>charset=iso-8859-1 as if it meant Windows-1252, even if one's own
>newsreader might be misbehaving in that way.

As I wrote immediately after the part you quoted, the character
didn't display "correctly" (that is, as a Microsoftian curly
quote) in my newsreader, so it wasn't misbehaving.  I myself saw
it as a narrow black box.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


------------------------------

Date: Sat, 2 Sep 2000 18:09:46 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: $LIST_SEPARATOR bug??
Message-Id: <Pine.GHP.4.21.0009021758580.1247-100000@hpplus03.cern.ch>

On Sat, 2 Sep 2000, Keith Calvert Ivey wrote:

> That's about what I expected.

OK: "pax" ? 

> >And on usenet you certainly cannot rely on your audience interpreting
> >charset=iso-8859-1 as if it meant Windows-1252, even if one's own
                                                           ^^^^^^^^^
> >newsreader might be misbehaving in that way.
> 
> As I wrote immediately after the part you quoted, the character
> didn't display "correctly" (that is, as a Microsoftian curly
> quote) in my newsreader, so it wasn't misbehaving. 

That's why I was trying to express that part generically, rather than
directly accusing your own newsreader:  I guess that intention didn't
come through properly.

> I myself saw it as a narrow black box.

That doesn't sound like any of the codings that I'm familiar with.
Perhaps it's just some kind of placeholder in the font.  

Oh well, G.I.G.O, don't you agree?

all the best



------------------------------

Date: Sat, 2 Sep 2000 10:12:16 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: $LIST_SEPARATOR bug??
Message-Id: <MPG.141ad4c8c0ac8f6898ad18@nntp.hpl.hp.com>

In article <39b191f1.2022731@news.newsguy.com>, kcivey@cpcug.org says...
> Larry Rosler <lr@hpl.hp.com> wrote:
> >GMT, Steven Merritt <smerr612@mailandnews.com> says...
> >
> >...
> >
> >> Try $" = '';
> >
> >I would prefer to use
> >
> >      $" = "";
> >
> >so the value assigned doesn't appear anything like one double-quote.
> 
> Do you program in a proportionally spaced font?

I assume that's a rhetorical question.  No answer necessary.

>                                                    If you're 
> using a font that's appropriate for programming, '' is clearly
> distinguishable from ".

And "" is even more clearly distinguishable from ".

>                            (Not that I find "" offensive.)

Whew!  That's a relief. 

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Sat, 02 Sep 2000 12:23:54 -0400
From: brian d foy <brian+usenet@smithrenaud.com>
Subject: Re: Adding HTML to every page in a directory
Message-Id: <020920001223545661%brian+usenet@smithrenaud.com>

In article <QQ7s5.3291$%t6.361331@nnrp3.clara.net>, Colin Keith
<newsgroups@ckeith.clara.net> wrote:

> In article <K6Tr5.19$18.3407@news-west.eli.net>, "Michael Turitzin"
> <stevet@thevision.net> wrote:
> >Is there a way to add a HTML header to every page in a certain directory?
> >Like free hosting sites add a banner to the top of every page.

> Yes, but its not a Perl related question as such as you can do it in just 
> about anything, sh, and C happily spring to mind.

mod_perl with something like Apache::Sandwich come to mind, and that's
definately a Perl thing.


------------------------------

Date: Sat, 2 Sep 2000 17:44:59 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Backslash usage?
Message-Id: <Pine.GHP.4.21.0009021720360.1247-100000@hpplus03.cern.ch>

On Sat, 2 Sep 2000, Colin Keith wrote:

> \015 is an octal representation of an ASCII value. In this case
> its a way of writing "\r\n" (CRLF). I believe its been used for
> platform independence, but I don't remember why some platforms
> interpret \n and \r with different values

There's an instructive discussion of newline representations in
perldoc perlport

If you're only dealing with native-format text records, then 
probably the easiest approach to reading properly-formatted files
in a portable fashion is to read them in text mode with your native
newline (\n) acting as the end of line.

The other approach is (IMHO) to always read the records in binmode and
do the newline processing yourself.  However, when this has come up
before, some others have recommended a sort of mixed strategy
involving reading in text mode and then patching up the differences. I
_think_ this is entirely feasible, but somehow I don't find it
appealing myself.

Be that as it may: if you expect to have to deal with cross-platform
text files, then your first step would be to look closely at what
perlport says about sockets programming.  This is a special case, in
the sense that the convention for sockets calls for CR+LF to be used
as the newline representation - the platform-specific part is in the
choice of an appropriately portable coding style needed to handle the
sockets newlines.  And this is where \015\012 comes in.  You then have
portable code, but it can only handle one record format. The next step
would be to generalise that approach, that so that you not only have
portable coding, but portable coding which can handle cross-platform
record formats too.

If you're really devoted to cross-platform issues, you might want to
look at how CGI.pm tackles this.  Web formats, although they prefer
the CR+LF format beloved of sockets programming, also tolerate the use
of isolated LF or CR as line terminators, and this is taken advantage
of quite widely; so anything that's programmed to deal with web
formats needs to accommodate itself to that.

CGI.pm not only can process cross-platform newline formats: the code
is portable betweeen ASCII and EBCDIC platforms.  (It does not,
however, aim to process EBCDIC records on an ASCII platform or vice
versa).  AFAIR, CGI.pm tests which octal character corresponds to \t
(tab), and on the basis of that it deduces whether it's running on an
ASCII or EBCDIC platform, and sets $CRLF accordingly.

E&OE, hope that helps.  The main message is to read perlport.



------------------------------

Date: Sat, 02 Sep 2000 15:45:23 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Backslash usage?
Message-Id: <39bb1ff5.38384383@news.newsguy.com>

newsgroups@ckeith.clara.net (Colin Keith) wrote:
>"James R" <reevehotNOSPAM@hotmail.com> wrote:

>>\$cmd = $cmd
>
>\$var is a reference 

That would be a syntax error.  I imagine this line is actually
part of a double-quoted string or here-doc, so it has nothing to
do with references.  It's escaping the '$' so that it prints as
a literal dollar sign, 'c', 'm', 'd', space, '=', space,
followed by the value of $cmd.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


------------------------------

Date: Sat, 02 Sep 2000 19:03:04 +0200
From: joerg pfeiffer <j.pfeiffer@roadtv.de>
Subject: dont refresh
Message-Id: <39B132C7.64F0792C@roadtv.de>

hi,
I have a js script that starts with
location.href='http:192.168.1.1/cgi-bin/roadtv/wahl.cgi?welcherort=SydneyHits';

the perlscript "wahl.cgi"

wahl.cgi has to do only one thing:
open a file, add something, close the file, but should NOT refresh the
page in the Browser.
but, if I dont put a print command in my perl script, I get an "enternal
server error".
with print, everything works fine.

How can I run the perlScript, without refreshing my BrowserPage?????

Joerg



------------------------------

Date: 02 Sep 2000 13:10:35 EDT
From: abigail@foad.org (Abigail)
Subject: Re: dont refresh
Message-Id: <slrn8r2d2m.8ac.abigail@alexandra.foad.org>

joerg pfeiffer (j.pfeiffer@roadtv.de) wrote on MMDLIX September MCMXCIII
in <URL:news:39B132C7.64F0792C@roadtv.de>:
{} hi,
{} I have a js script that starts with
{} location.href='http:192.168.1.1/cgi-bin/roadtv/wahl.cgi?welcherort=SydneyHits';
{} 
{} the perlscript "wahl.cgi"
{} 
{} wahl.cgi has to do only one thing:
{} open a file, add something, close the file, but should NOT refresh the
{} page in the Browser.
{} but, if I dont put a print command in my perl script, I get an "enternal
{} server error".
{} with print, everything works fine.

I guess that was a typo, and you meant "eternal server error".

{} How can I run the perlScript, without refreshing my BrowserPage?????

What is your Perl question? How would you solve the problem in C, Ada,
FORTRAN, Haskell or vi macros? You'd do it the same way in Perl.

You might want to consult the HTTP RFC and the CGI specification.


Abigail
-- 
perl -we 'eval {die ["Just another Perl Hacker\n"]}; print ${$@}[$#{@${@}}]'


------------------------------

Date: 2 Sep 2000 16:27:14 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: Help! my comma's are comma%27s
Message-Id: <8or9p2$biulc$1@ID-24002.news.cis.dfn.de>

hi,
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> Tina Mueller wrote:
>> perspiring goth wrote:
>> > $unescaped =3D CGI::unescape($text);
>> > print "$unescaped ";
>> > ...doesn't work. I'm sure I seem woefully inept but... ???
>> define "doesn't work" and learn how to quote.
>> for me the following works:
>> 02:14am tina@syracus:~/public_html/cgi-bin > perl -e'use CGI;
>> $z=3DCGI::unescape("comma%2Cs");
>> print "$z\n"'


> Writing your own Brenner style read and parse will
> resolve this problem

which problem? and what's a Brenner style read?

> Not so difficult, maybe twenty to thirty lines
> of code for a Brenner style read and parse which
> includes addressing almost all major security=20
> concerns. Only challenge is you need to know how
> to program, not just copy and paste a module=20
> reference.

oh, I have to program? no, that's too much for
me, I only can use module subroutines. I know,
really good programmers like you avoid
modules. many of the so called experts here=20
recommend modules because they say "why reinvent
the wheel and maybe reinvent it worse then it
is". but i know they all just say that because they
are not really good programmers but don't want to
admit that.
what's programming for? not using modules
which have been proven to be correct for
a long time, nah, that's boring, but programming our
own code, and don't care about cases in which our
code could fail, because programming is fun,
and not being responsible.
let me close this little paragraph full of
irony with the following words:
--=20
$|++;@_=3Dmap{chr(ord($_)-$|)}split//,"Kvtu!bopuifs!Qfsm!Ibdlfs-";$\=3D"\r=
";@a=3Dqw(<
^ > v);$=A7=3D"_"x25;until($=A7!~m~_~){$o=3Dint(rand 28)+65;next if$s{$o}+=
+;$o=3D=3D91?$o=3D44
:($o=3D=3D92?$o=3D32:0);$g=3Dchr$o;for(0..24){if($_[$_]=3D~m)$g)i){for$m(@=
a,$_[$_]){substr
$=A7,$_,$|,$m;print$=A7;select$/,$/,$/,0.1}}}print$=A7}print$/ # http://ti=
nita.de


------------------------------

Date: Sat, 02 Sep 2000 09:45:25 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Help! my comma's are comma%27s
Message-Id: <39B12EA5.252B6999@stomp.stomp.tokyo>

Tina Mueller wrote:

> Godzilla! wrote:
> > Tina Mueller wrote:
> >> perspiring goth wrote:
 
> > Writing your own Brenner style read and parse will
> > resolve this problem
 
> which problem?

Yours and the originating author's.


> and what's a Brenner style read?

Oh my. A Brenner style read and parse is the
very foundation of cgi-poopmaker. Brenner's
methods are very well known amongst experienced
programmers. Seems he is not well known amongst
Perl 5 Cargo Cultist Copy and Paste Technicians.

* shrugs *

A few of us are seasoned programmers. A lot are
inexperienced mouse movers.


Godzilla!

-- 
@© = (a .. z); @® = qw (7 15 4 26 9 12 12 1 18 15 3 11 19);
srand(time() ^ ($$ + ($$ << 15))); for ($§ = $®[$®[0]]; $§ < $®[0]; $§++)
{ sub G { rand(1000) < 500 ? "\u$1" : "\l$1" ; } foreach $¿ (@®) 
{ $¢ = $©[$¿-1]; $¢ =~ s¡([a-z])¡G($1)¡gie; $Ø = "$Ø$¢"; }
$Ø ="$Ø! "; $ø = substr ($Ø, $®[12] - $®[11], 0, " ");
$Ø =~ s¯(a)(r)¯$1 $2¯i; print "$Ø\n"; } exit;


------------------------------

Date: Sat, 02 Sep 2000 17:25:22 +0000
From: Slip Gun <slipgun@desertsnake.abelgratis.com>
Subject: Re: learning perl
Message-Id: <39B13802.7A635B6E@desertsnake.abelgratis.com>

Simon Voorwinde wrote:
> 
> Where's is the best place to learn perl ?

I bought a copy of Larry + co's "Programming Perl" (aka the Camel) and
Randal L. Schwartz's "Learning Perl". I am reading through Learning
Perl, and when I find something that interests me, or I want to know
more about it, I look it up in the Camel. Both these books are good.
Cheers,
Ed
-- 
Those who trade away their privacy in favour of security will soon find
that they have neither.


------------------------------

Date: Sat, 2 Sep 2000 19:43:28 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: learning perl
Message-Id: <1egcjp5.1tzudv01pzcsktN%tony@svanstrom.com>

Simon Voorwinde <svavevav@idx.com.au> wrote:

> Where's is the best place to learn perl ?

I'm going to skip the jokes and go straight to the cheap way of solving
this lil problem...

        CGI, is the key.

1. You take your website and look at it thinking what you would like to
add to it.
2. You find a script on ze web that does almost what you want.
3. You try to rewrite that script so that it a) does exactly what you
want and b) only contains your code.

While you're doing that you will need a couple of tools:
1. Easy access to RTFM-land (all you need comes with Perl).
2. Other scripts, so that you can see how others have solved the same
problems that you might have.
3. The courage to ask questions in clpm knowing that at least 5 are
people are going to yell at you for now reading the manual. ;)


Once you've learned more and more about Perl that way it will come very
natural for you to start using Perl to solve non CGI-related problems.

Of course, you could just cheat and buy a cpl of books from www.ora.com.


     /Tony
-- 
     /\___/\ Who would you like to read your messages today? /\___/\
     \_@ @_/  Protect your privacy:  <http://www.pgpi.com/>  \_@ @_/
 --oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
   on the verge of frenzy - i think my mask of sanity is about to slip
 ---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
    \O/   \O/  ©99-00 <http://www.svanstrom.com/?ref=news>  \O/   \O/


------------------------------

Date: Sat, 02 Sep 2000 15:09:13 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: module install questions (RH)
Message-Id: <sK8s5.3368$%t6.368090@nnrp3.clara.net>

In article <39B091DA.9C979933@sprintmail.com>, Jeff Thies <cyberjeff@sprintmail.com> wrote:
>/usr/bin/ld: cannot open -lgdbm: No such file or directory

You either don't have libgdbm installed, or the system doesn't know where to 
find it. If its a unix OS fiddle with ldconfig (read the man page first) or 
your er.. LD_LIBRARY_PATH (?) env var, or you could probably specify it on the 
command line.

>Are these fatal errors? How do I find what they mean? I don't seem to be

Only in that it can't link against a library file, so its generally considered 
bad:)

>able to find all the installed libs and I can't find the .pm file.
>When is the "some_module.pm" created, is it after make, or make install?

That depends on the module. With modules that use XS afaik most (?) exist from 
the start and its library that needs to be compiled that is built, but until 
it is you can't use the module because the bootstrap() call will fail.

>Also, I'm curious about make test (this module doesn't have that, is
>that because of the ./configure ) or is make test dependant on module
>construction? Is make test just a dry run for make install?

Again, depends, usually its a series of test scripts that put the module 
through its paces to test that it has been properly installed - It can go off 
and do DNS lookups, nip round your granny's and steal her toast, or whatever 
its meant to do. Its usually run before make install to prove to you that it 
works properly so you don't install broken code.

>If I'm installing in my local directory, does it make more sense to use
>static libraries rather than shared, and what does that mean? Where
>would they be installed?

Ahh, that possibly why things are breaking. It would be easier for you to get 
your sysadmin to do it (we don't always say no ... well, not if tempted with 
choccy and things:) If they install it it will be available system wide and 
everyone gets to play. I don't know about the static/shared completely. Shared 
is better because the size of the executables are smaller because they load 
the libraries as needed, but you may have to use static libraries if your 
account has restricted access. (You're chrooted for instance). If you do have 
restricted access, that may also explain why it can't find some of the 
libraries you want.

>Can't seem to find the ImageMagick mail list (I thought I subscribed),
>anyone know where to find it, or is it real low volume. 

No idea, sorry. 

>I've been having a hard time on usenet lately, feel free to flame me for
>any usenet violations...

Kewl, a free invite to a flamathon:) Well its not entirely perl related, but 
it is more related than some of the questions here so dun't worry :)

Col.


---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC


------------------------------

Date: Sat, 02 Sep 2000 16:33:23 GMT
From: Jeff Thies <cyberjeff@sprintmail.com>
Subject: Re: module install questions (RH)
Message-Id: <39B12C23.C0027601@sprintmail.com>

> In article <39B091DA.9C979933@sprintmail.com>, Jeff Thies <cyberjeff@sprintmail.com> wrote:
> >/usr/bin/ld: cannot open -lgdbm: No such file or directory
> 
> You either don't have libgdbm installed, or the system doesn't know where to
> find it.

Is this a common file that should be on the OS already, or is it one
that the module installs?

 If its a unix OS fiddle with ldconfig (read the man page first) or
> your er.. LD_LIBRARY_PATH (?) env var, or you could probably specify it on the
> command line.

Not being root can I find this, or can I get this and put it in
somehwere that I know the path?
> 
> >Are these fatal errors? How do I find what they mean? I don't seem to be
> 
> Only in that it can't link against a library file, so its generally considered
> bad:)

Hmmm, so I should be able to call the module, or it's functions. I would
get an error at that time. ??? But the module is installed? How would I
know if it wasn't?
> 
> >able to find all the installed libs and I can't find the .pm file.
> >When is the "some_module.pm" created, is it after make, or make install?
> 
> That depends on the module. With modules that use XS afaik most (?) exist from
> the start and its library that needs to be compiled that is built, but until
> it is you can't use the module because the bootstrap() call will fail.

Can I see that error?

Are there times that "some_module.pm" wouldn't exist? The way that I use
this is to build another module and call through that. Just what does a
 .pm file do?
> 
> >Also, I'm curious about make test (this module doesn't have that, is
> >that because of the ./configure ) or is make test dependant on module
> >construction? Is make test just a dry run for make install?
> 
> Again, depends, usually its a series of test scripts that put the module
> through its paces to test that it has been properly installed - It can go off
> and do DNS lookups, nip round your granny's and steal her toast, or whatever
> its meant to do. Its usually run before make install to prove to you that it
> works properly so you don't install broken code.

Hmmm, so does make actually install the code and make install lock it
down? Poor chice of words, but I'm not sure what is happening here.

> 
> >If I'm installing in my local directory, does it make more sense to use
> >static libraries rather than shared, and what does that mean? Where
> >would they be installed?
> 
> Ahh, that possibly why things are breaking. It would be easier for you to get
> your sysadmin to do it (we don't always say no ... well, not if tempted with
> choccy and things:) If they install it it will be available system wide and
> everyone gets to play.

New host. RH6.1, Apache. They don't know how to install it, I pointed at
the resources and tried to help, but everything I know about modules
I've learned in the last week of not installing this one. Totally
depressed...

 I don't know about the static/shared completely. Shared
> is better because the size of the executables are smaller because they load
> the libraries as needed, but you may have to use static libraries if your
> account has restricted access. (You're chrooted for instance). If you do have
> restricted access, that may also explain why it can't find some of the
> libraries you want.

They have a ./configure switch:
--enable-static[=PKGS]   Is that "[]" optional or is that I prompt for a
path? Or is this a prompt for which libraries I want static? Syntax?

Cheers,
Jeff


------------------------------

Date: 2 Sep 2000 12:18:07 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: My Perl looks like C!
Message-Id: <8oqnlf$uo0$1@orpheus.gellyfish.com>

On Thu, 31 Aug 2000 23:19:32 GMT Steven Merritt wrote:
> In article <8oml68$s35$1@mark.ucdavis.edu>,
>   Adam Trace Spragg <spragg@cs.ucdavis.edu> wrote:
> 
>> One of my biggest concerns is that my Perl code looks like C code.
> When I
>> look at what Real Perl Hackers write, it doesn't look like C at all.
> 
> That's ok, my C looks like Perl.  And I bet it's a helluva lot harder to
> maintain than your Perl.
> 

I find this increasingly true as well - OK always putting the curlies in
single statement conditionals is not so much a problem - indeed it could
be defended as defensive programming, its leaving the brackets round the
arguments to a function that is the real pain in the arse ;)

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


------------------------------

Date: 2 Sep 2000 11:04:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Net::SMTP error codes
Message-Id: <8oqjb8$ui0$1@orpheus.gellyfish.com>

On 1 Sep 2000 23:25:10 GMT Lael Matthew Heinig wrote:
> 
> Occasionally after doing an $smtp->to ( 'some_address' ) ; I get an error
> code of 000.  Unfortunately, I get that error about 10% of the time.  I 
> checked the documentation for Net::Cmd and it says the following:
> 
>        code ()
>            Returns the 3-digit code from the last command. If a
>            command is pending then the value 0 is returned
> 
> What does it mean for a command to be "pending?"  My program treats that
> return value as an error.  How do I solve this problem?  How does it 
> come about?
> 

0 is not a valid SMTP status code (You will want to check the specification
for the ones that are) and this implies that you should check again until
you do get a valid code - of course it might be that the logic of the program
is causing the call of some Net::SMTP method which would give rise to a
valid status to be skipped.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


------------------------------

Date: 2 Sep 2000 12:41:55 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: open web file
Message-Id: <8oqp23$upj$1@orpheus.gellyfish.com>

On Fri, 01 Sep 2000 20:28:58 -0500 Jerry Jorgenson wrote:
> Abigail wrote:
> 
>> [snipped]
>> As for confusing, ask yourself, how often do people have a file called
>> "www.slashdot.org" in a directory "http:", while at the same moment writing
>> two path separators between directory name and file name. Isn't that a bit
>> far fetched?
>>
> 
> I guess you've never seen my users at work :-)
> 

Heh, on a machine at work I find peoples home directories with hundreds
of files which appear to be one named for each word that they thought they
were typing into some program.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


------------------------------

Date: 2 Sep 2000 12:50:55 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: open web file
Message-Id: <8oqpiv$uq9$1@orpheus.gellyfish.com>

On Fri, 01 Sep 2000 17:52:31 -0700 Jeff Zucker wrote:
> Gwyn Judd wrote:
>> 
>> I was shocked! How could Larry Rosler <lr@hpl.hp.com>
>> say such a terrible thing:
>> >Wouldn't the scheme part of a URI ('http://' for example) uniquely
>> >disambiguate it from a file-system pathname,  absolute or relative?
>> 
>> perversely, no it wouldn't. 'http://www.blah.com' is a perfectly valid
>> filename on my system at least.
> 
> The URI of that file would be something like
> "file:///http://www.blah.com".
> 

There is an RFC for Perl 6 that describes this.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


------------------------------

Date: Sat, 2 Sep 2000 19:21:51 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: output fun
Message-Id: <1egcigt.16ozccm2vhw8wN%tony@svanstrom.com>

Ren Maddox <ren.maddox@tivoli.com> wrote:

> tony@svanstrom.com (Tony L. Svanstrom) writes:
> 
> > Ren Maddox <ren.maddox@tivoli.com> wrote:
> > 
> > > kcivey@cpcug.org (Keith Calvert Ivey) writes:
> > > 
> > > > Uri Guttman <uri@sysarch.com> wrote:
> > > > 
> > > > >$_="ABCDEFGFEDCBA\n";print;print while y/G/ /||s/.( +)\S/ $1 /g;
> > > > 
> > > >  $_="ABCDEFGFEDCBA\n";print,s/G|(?<= ).|.(?= )/ /g while/\S/;
> > > > 
> > > > Four strokes shorter, and avoids printing the extra blank line.
> > > 
> > >    $_="ABCDEFGFEDCBA\n";print,s/.( +)./ $1 /,s/G/ /while/\S/;
> > > 
> > > Two strokes shorter.
> > 
> >      $_="ABCDEFGFEDCBA\n";$c=9;while($c--){s/\10$c/ /g;print}
> > 
> > Not really a good solution, but, hey, it's one character less. :)
> 
> On the contrary, I think it is a good solution, though it is a little
> bit broken.
> 
> Change the post-decrement to a pre-, and reverse the order of the
> substitution and the print, and you avoid printing the extra two blank
> lines (oh, and start with 8 instead of 9), all for the same length:
> 
>        $_="ABCDEFGFEDCBA\n";$c=8;while(--$c){print;s/\10$c/ /g}
> 
> Even better, change the while to a modifier to save a few characters:
> 
>        $_="ABCDEFGFEDCBA\n";$c=8;print,s/\10$c/ /gwhile--$c


I was hoping someone would be able to do something like that with it.
The one I posted was the latest in a long list of ways of doing it, but
I had to meet someone and couldn't really work on it; since it seemed to
be different enough, compared to the other solutions, I thought I'd post
it anyhow.
When I saw your improvements it made a lot of sense, and I asked myself
why I didn't make it like that to begin with. *L*


     /Tony
-- 
     /\___/\ Who would you like to read your messages today? /\___/\
     \_@ @_/  Protect your privacy:  <http://www.pgpi.com/>  \_@ @_/
 --oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
   on the verge of frenzy - i think my mask of sanity is about to slip
 ---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
    \O/   \O/  ©99-00 <http://www.svanstrom.com/?ref=news>  \O/   \O/


------------------------------

Date: Sat, 02 Sep 2000 15:36:33 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Parsing MySQL TEXT field
Message-Id: <39ba1be4.37343402@news.newsguy.com>

Marvin <ales.romaniuk@zag.si> wrote:

>When I pull this field into variable, and watch its value in DEBUG, I 
>can see this:
>
>Line1\cM\cJLine2\cM\JLine3\cM\cJ

It sounds like you're doing something wrong with translation of
line-ending characters, starting with data that's using Windows
(or network) line endings and treating it as if it has Unix line
endings.

>which seems to be CR/LF fields.
>
>If I watch line by line made by split "\n",@TEXTFIELD), I can see
>
>Line1\cM
>Line2\cM
>Line3\cM
>
>with no \cJ fields. 

No, you don't.  The second argument of split() should be a
scalar, not an array.  The result of split("\n", @TEXTFIELD)
would be just 3 in your case.

>How can I strip TEXT fields and put them into an ARRAY with the split 
>command ?

You may want something like this:

    my @lines = split /\cM\cJ/, $TEXTFIELD;

if you have a scalar, or

    s/\cM\cJ$// for @TEXTFIELD;

if you really have an array.

But it might be better to get your data right in the first
place.

>(Also split("\c",@TEXTFIELD) won't work)

What do you expect it to do?  It's a syntax error, though
strangely it isn't if you change the quotes to slashes (which is
a good idea, since the first argument to split() is a regex, not
a string).

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4209
**************************************


home help back first fref pref prev next nref lref last post