[24283] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6474 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 27 03:06:15 2004

Date: Tue, 27 Apr 2004 00:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 27 Apr 2004     Volume: 10 Number: 6474

Today's topics:
        a warning <robin @ infusedlight.net>
    Re: autobox <tassilo.parseval@rwth-aachen.de>
    Re: Difficult regular expression problem! (Fritz Bayer)
    Re: free source blogger (works) <tadmc@augustmail.com>
    Re: free source blogger (works) <matthew.garrish@sympatico.ca>
    Re: free source blogger (works) <uri.guttman@fmr.com>
    Re: free source blogger (works) <tassilo.parseval@rwth-aachen.de>
    Re: free source blogger (works) <uri@stemsystems.com>
    Re: free source blogger (works) <robin @ infusedlight.net>
    Re: free source blogger (works) <robin @ infusedlight.net>
    Re: free source blogger (works) <robin @ infusedlight.net>
    Re: free source blogger (works) <robin @ infusedlight.net>
    Re: free source guestbook (finished) <robin @ infusedlight.net>
        FTP with Auth TLS or Auth SSL <Peter_member@newsguy.com>
    Re: How can I create a PDF page with only Images (EPS & (Aqua)
    Re: How can I create a PDF page with only Images (EPS & (Aqua)
    Re: Ignore errors inserting dup records? (pt)
    Re: Ignore errors inserting dup records? <mb@uq.net.au.invalid>
    Re: is there a way ..... any way <matternc@comcast.net>
    Re: is there a way ..... any way <dha@panix.com>
    Re: is there a way ..... any way <robin @ infusedlight.net>
    Re: Newsreader - human error [OT] <webmaster@infusedlight.net>
    Re: operator <robin @ infusedlight.net>
    Re: output to STDOUT to a file <matthew.garrish@sympatico.ca>
    Re: RegExp poser: matching two substrings (Malcolm Dew-Jones)
    Re: SV_TYPE_* constants? <tassilo.parseval@rwth-aachen.de>
    Re: Tripod wont find my lib files <invalid-email@rochester.rr.com>
    Re: what I was doing (originally textarea problem) <robin @ infusedlight.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 26 Apr 2004 23:11:31 -0800
From: "Robin" <robin @ infusedlight.net>
Subject: a warning
Message-Id: <c6kq2e$18aa$1@news.f.de.plusline.net>

When I installed perl builder (windows) with the default install with
activestate perl, it crashed my @INC and it may have even deleted some of
the which are supposed to be included in @INC, so let me advise you not to
install this software.

--
Regards,
-Robin
--
[ webmaster @ infusedlight.net ]
www.infusedlight.net




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

Date: Tue, 27 Apr 2004 06:13:19 +0200
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: autobox
Message-Id: <c6kml2$d7hqo$2@ID-231055.news.uni-berlin.de>

Also sprach Michele Dondi:

> On Sun, 25 Apr 2004 22:37:44 +0200, "Tassilo v. Parseval"
><tassilo.parseval@rwth-aachen.de> wrote:
> 
>>>>You find the complete thread starting with this article here:
> [snip]
>>The discussion following the suggested patch was IMO not very rational.
>>The main reason against it appeared to be that it reminded some people
>>of pseudo-hashes. However, they weren't really able to give any evidence
> 
> I've noticed that, in fact! However I don't even know what
> pseudo-hashes are actually... already heard about them, though!

You can forget about them now. They've been deprecated in perl5.8.0 and
'use fields' is now implemented on top of restricted hashes. In perl5.10
pseudo-hashes will be removed altogether.

>>I don't know, maybe it should be put onto the agenda once again. I
>>wouldn't expect much from it, though. I also have the impression that the
>>birth of ponie has made it more difficult to get new features into Perl
>>as people now say that one should wait for perl5.12. This happened to me
>>anyway when I proposed to extend the tie() interface with stuff like
>>SUBSTR, INDEX etc. for which I provided an outline on how this could be
>>implemented.
> 
> Hmmm, that sounds interesting!

Of course it does. ;-)

I had the idea of writing a module that makes Perl scalars store their
content zlib compressed so that people could put very large strings into
them (provided that these strings can be compressed well; ordinary text
strings usually can) and trade speed for space. But then I realized that
the first time someone did

    substr($compressed, 1, 1);

perl would translate that into

    substr( tied($compressed)->FETCH, 1, 1 );

and that gave me no chance to only inflate the needed parts of the
string. So I had to abandon my idea.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: 26 Apr 2004 22:57:53 -0700
From: fritz-bayer@web.de (Fritz Bayer)
Subject: Re: Difficult regular expression problem!
Message-Id: <a9c0aa9e.0404262157.1a676fe6@posting.google.com>

Gunnar Hjalmarsson <noreply@gunnar.cc> wrote in message news:<c6ji7g$ccroo$1@ID-184292.news.uni-berlin.de>...
> Fritz Bayer wrote:
> > 1. I'm looking for a pattern (lets call it A), which I want to
> > capture and print out to standard output. It reocurs several times
> > in the text.
> > 
> > 2. If I find the pattern A in the text, then I want to know,
> > whether or not a certain word (lets call it B) out of a word list
> > (lets call it C) preceeds pattern A.
> > 
> > 3. In the end I want the following result: If A is found, preceeded
> > by a word out of C, then print A;C;. If A is found, but none of the
> > words out of C preceed A, the just print A;;.
> > 
> > For example:
> > 
> > "This is an example, which hopefully helps me and you to solve my 
> > problem. I would buy a used computer for 50 Dollars but I wouldn'
> > buy it for 1000 Dollars. I definitely would by an apartment for
> > 3000 Dollars or a Miro for 1500 Dollars but not for 5000000
> > Dollars. For 50 Dollars you can hire me as a perl programmer - but
> > I guess I'm not worth the Dollar:)"
> > 
> > Here the regex, which of course is not working (just to give you an
> > idea):
> > /.*?(computer|apartment|miro|somethingelsemissing).*?(\d+)\s+Dollars?/
> > print ($1 . ";" . $2 . ";\n")/gies
> > 
> > I would like the following result:
> > 
> > 50;computer;
> > 1000;;
> > 3000;apartment;
> > 1500;Miro;
> > 5000000;;
> > 50;;
> 
> As I indicated in my previous reply, I believe that you'd better
> capture respective pattern in two steps. This would do it:
> 
>      while (/(.*?)(\d+)\s+Dollar?/igs) {
>          print "$2;",
>                $1 =~ /(computer|apartment|miro|somethingelsemissing)/i,
>                ";\n";
>      }

Ok, I get the point and you a right - that would work, so it's a
solution. Thanks!

Just one more thing. Haven't you forgotten to print out $1 and how
come that you can append the regex using a comma (,)?


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

Date: Mon, 26 Apr 2004 19:57:57 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: free source blogger (works)
Message-Id: <slrnc8rc0l.qd7.tadmc@magna.augustmail.com>

Robin <robin@infusedlight.net> wrote:
> 
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrnc8r3n4.q1d.tadmc@magna.augustmail.com...
>> Robin <robin@infusedlight.net> wrote:
>>
>> > some of it is just sucky advice though, for example, the
>> > fact that I'm using if (! ) instead of unless makes no difference.
>>
>>
>> Yes it does. You just have not been programming long enough to
>> recognize the difference.
>>
>> You are communicating with the reader of your code.
>>
>> If it communicates more clearly, then it is NON-sucky.
> 
> which statement is faster for one thing? I thought if was always faster in
> it's check?


You just have not been programming long enough to recognize
what is more important.

Maintenance time trumps execution speed...


> Or am I totally wrong?


 ... so you are concerning yourself with something that you
should be unconcerned with. (until *after* it has been shown
to be too slow)


   "Premature optimization is the root of all evil."

      -- Tony Hoare, restated by Donald Knuth


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Mon, 26 Apr 2004 22:10:21 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: free source blogger (works)
Message-Id: <9ijjc.18937$OU.401712@news20.bellglobal.com>


"Robin" <robin @ infusedlight.net> wrote in message
news:c6k41p$trk$2@news.f.de.plusline.net...
>
> which statement is faster for one thing? I thought if was always faster in
> it's check?
> Or am I totally wrong?
>

And how many microseconds difference would you speculate your use of if
saves? It's amusing that you would even attempt that as a justification,
considering how much more time is consumed by the horrible logic in your
scripts.

Matt




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

Date: 26 Apr 2004 17:02:57 -0400
From: Uri Guttman <uri.guttman@fmr.com>
Subject: Re: free source blogger (works)
Message-Id: <siscr7ua5u66.fsf@configsvr.fmr.com>

>>>>> "R" == Robin  <robin @ infusedlight.net> writes:

  R> "Uri Guttman" <uri@stemsystems.com> wrote in message
  R> news:x7ekqadf1q.fsf@mail.sysarch.com...
  >> 
  >> define 'works' in 500 words or less
  >> 
  >> uri

  R> hmmm...it runs.

does it meet the specifications? oh, there are no specifications. does
it pass the test suite? oh, no test suite. hard to write one without
specifications. 

so my conclusion is that your script doesn't work by most definitions of
work. do you concur?

just to try to educate you some more. a program has to have some way of
being judged to be working other than by some printed output. you don't
have the skills to create a spec that would allow such testing. coding
is much more then just printing things in files and to web browsers.

as for your 'it runs' reply:

	winblows runs but it doesn't work. hell, it has no spec at all
	so it will never 'work'.

uri




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

Date: Tue, 27 Apr 2004 05:51:37 +0200
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: free source blogger (works)
Message-Id: <c6klcc$cvs7i$1@ID-231055.news.uni-berlin.de>

Also sprach Tad McClellan:

> Robin <robin@infusedlight.net> wrote:
> 
>> some of it is just sucky advice though, for example, the
>> fact that I'm using if (! ) instead of unless makes no difference.
> 
> 
> Yes it does. You just have not been programming long enough to 
> recognize the difference.
> 
> You are communicating with the reader of your code.
> 
> If it communicates more clearly, then it is NON-sucky.

I will forever disagree with this one. 'unless' may communicate more
clearly with a native English speaker. But it it doesn't work half as
well with someone (like me) whose native language doesn't really have an
equivalent word for it. In German, you'd usually use 'if' + negated
condition to express 'unless'. There are other ways of expressing it,
but those require a very different syntactic structure of the sentence;
one that doesn't ressemble anything Perl can offer.

I used 'unless' a few times long ago but then I realized that it took me
much longer to decipher it afterwards. So I dropped it altogether and
probably haven't used it altogether throughout the past two years. And I
will continue not to do so.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Tue, 27 Apr 2004 04:35:33 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: free source blogger (works)
Message-Id: <x7brleavhm.fsf@mail.sysarch.com>

>>>>> "TvP" == Tassilo v Parseval <tassilo.parseval@rwth-aachen.de> writes:

  TvP> I will forever disagree with this one. 'unless' may communicate more
  TvP> clearly with a native English speaker. But it it doesn't work half as
  TvP> well with someone (like me) whose native language doesn't really have an
  TvP> equivalent word for it. In German, you'd usually use 'if' + negated
  TvP> condition to express 'unless'. There are other ways of expressing it,
  TvP> but those require a very different syntactic structure of the sentence;
  TvP> one that doesn't ressemble anything Perl can offer.

then you have that choice and since you explained it i can live with
it. but for most speakers of english, unless is a very good word for
that situation. it reads so smoothly when you want to explain logic.

	you do this UNLESS this is so.

you do it for all the situations except the one you want to skip.

if not is logically the same but stiffer in its descriptions. not as
poetic either.

  TvP> I used 'unless' a few times long ago but then I realized that it
  TvP> took me much longer to decipher it afterwards. So I dropped it
  TvP> altogether and probably haven't used it altogether throughout the
  TvP> past two years. And I will continue not to do so.

you have a legitimate reason. but you can understand why english
speakers (and remember, larry is one of them and a linguist as well),
likes such well selected words as unless. as such it should be the
example and your reason for 'if not' is a counterexample.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Mon, 26 Apr 2004 22:26:05 -0800
From: "Robin" <robin @ infusedlight.net>
Subject: Re: free source blogger (works)
Message-Id: <c6kp6m$17vi$1@news.f.de.plusline.net>


"Sherm Pendley" <spamtrap@dot-app.org> wrote in message
news:5Lydneq4F6EbORDd4p2dnA@adelphia.com...
> Robin wrote:
>
> > They won't let me do that, I need a new host, I don't have shell access,
> > unless there's a way of installing them with ftp?
>
> It's possible, but it's a pain in the arse.
>
> If you can mirror their system configuration *exactly* - same OS, same
> libraries, same version of Perl compiled with the same options, etc. - you
> could compile modules locally to upload onto the server.

cool...yeah I'll check into that, I think they don't allow it actually, plus
I'm not running unix...yet...I should be running unix. -Robin




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

Date: Mon, 26 Apr 2004 22:27:09 -0800
From: "Robin" <robin @ infusedlight.net>
Subject: Re: free source blogger (works)
Message-Id: <c6kp6o$17vi$2@news.f.de.plusline.net>


"Eric Schwartz" <emschwar@pobox.com> wrote in message
news:etowu42e37v.fsf@fc.hp.com...
> "Robin" <robin @ infusedlight.net> writes:
> > which statement is faster for one thing? I thought if was always faster
in
> > it's check?
>
> If you care about the difference in speed between 'if (!foo)' and
> 'unless foo', then you shouldn't be using Perl.  But if you really
> really really REALLY care, then use Benchmark.pm to find out which one
> is faster:
>
> $ perldoc Benchmark
>
> But I will bet you significant amounts of money that the difference is
> below infinestimal.
>
> > Or am I totally wrong?
>
> Why do you think you care?  For one thing, you're running this as a
> CGI program, which means that you have to fork and exec the Perl
> interpreter for each request, the overhead of which vastly dwarfs
> any amount you'll save worrying about 'if !' vs. 'unless'.
>
> Program for readability and correctness first, and THEN worry about
> optimizing.

I was merely curious.
-Robin




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

Date: Mon, 26 Apr 2004 22:30:47 -0800
From: "Robin" <robin @ infusedlight.net>
Subject: Re: free source blogger (works)
Message-Id: <c6kp6p$17vi$3@news.f.de.plusline.net>


> does it meet the specifications? oh, there are no specifications. does
> it pass the test suite? oh, no test suite. hard to write one without
> specifications.
>
> so my conclusion is that your script doesn't work by most definitions of
> work. do you concur?
>
> just to try to educate you some more. a program has to have some way of
> being judged to be working other than by some printed output. you don't
> have the skills to create a spec that would allow such testing. coding
> is much more then just printing things in files and to web browsers.
>
> as for your 'it runs' reply:
>
> winblows runs but it doesn't work. hell, it has no spec at all
> so it will never 'work'.
>
> uri

so, what would you do to the blogger.pl script to make it "work"? I don't
need code, just some friendly advice, or do you not have the programming
skills to output friendly advice. Actually, just kidding, I like your rants.
-Robin





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

Date: Mon, 26 Apr 2004 23:23:33 -0800
From: "Robin" <robin @ infusedlight.net>
Subject: Re: free source blogger (works)
Message-Id: <c6kqp5$18ko$1@news.f.de.plusline.net>

can someone identify themselves as the hacker who posted that image on my
blog?
Thanks, and yes, the auth needs a lot of work, I realize.
-Robin





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

Date: Mon, 26 Apr 2004 23:16:26 -0800
From: "Robin" <robin @ infusedlight.net>
Subject: Re: free source guestbook (finished)
Message-Id: <c6kqeh$18jv$1@news.f.de.plusline.net>


Juha:
> Ouch. First gethead just to determine whether or not the file exists,
> and if it did succeed, do it again to actually store the read contents.
> So, opening/locking/reading/unlocking/closing the file twice for each
> request (if using your original gethead code)? In addition there would
> of course be the possible race condition that the header file gets
> removed between the two gethead calls; the first call to gethead telling
> that the file is there, and thus default content is not needed, and the
> second trying to read content from the file that no longer exists.
>
> Also, what's the point of having the head variable as an array instead
> of a scalar; anyway you're not editing it in your code, so you an just
> slurp it in and spit it out. Using an array for that variable doesn't
> make any sense.

And how would I fix this race condition?
and thanks for all the suggestoins.
-Robin





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

Date: 26 Apr 2004 20:15:24 -0700
From: Peter <Peter_member@newsguy.com>
Subject: FTP with Auth TLS or Auth SSL
Message-Id: <c6kj8c0cb8@drn.newsguy.com>

Hi everyone,

I need to connect to an FTP-server to perform some file operations there.
Nothing that can't easily be done with Net::FTP, I agree.

The problem is; This server only accepts encrypted command- and
data-connections, using either Auth SSL or Auth TLS.
There is no sftp available.

I have googled this group and search the CPAN, but to no avail. :(

Is it possible to communicate in this manner from Perl?

I have some delusions that things like Net::FTP and Net::SSLeay could be
combined, but even if it is so, it would likely be beyond my current level of
Perl competence to handle.

Any tips would be thankfully recieved. :)


Peter



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

Date: 26 Apr 2004 22:46:25 -0700
From: junk@dlink.org (Aqua)
Subject: Re: How can I create a PDF page with only Images (EPS & TIFF)
Message-Id: <55d7995c.0404262146.3f009fd9@posting.google.com>

> Can you install PDF::API2?
> 
> This should allow you to create a PDF with all the images...
> 
> HTH,
> Ricky

I am conversant with Perl. So I have already tried PDF::API2. 
use PDF::API2;

unlink "test.pdf";
$pdf = PDF::API2->new(-file=>"test.pdf");
$page = $pdf->page(1);
$gfx = $page->gfx;
$img = $pdf->image_tiff("bbb.tif");
#$img = $pdf->image_jpeg("ccc.jpg");
$gfx->image($img, 0, 0);
$page->update;
$pdf->update;

exit;

The above sample doesnt create a PDF (or it creates a PDF but I am not
able to open it)

Regards
Dominic


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

Date: 26 Apr 2004 22:54:34 -0700
From: junk@dlink.org (Aqua)
Subject: Re: How can I create a PDF page with only Images (EPS & TIFF)
Message-Id: <55d7995c.0404262154.108a67ac@posting.google.com>

> The simple way is to make a document with all the images included and then 
> run out the PS and use GS to make the PDF.
> 
> The document that you use depends on your skill. Either use Quark or 
> Pagemaker with some scripting to include the images into your document.

I dont have Quark, but I have PM. Though I am familar with PM
scripting, I can give it a try.

> Or you could use LaTeX: create a galley using perl and then runout.
> Or you could write manual PostScript using Perl. This would require some 
> work, but then it would be quite portable.

I am conversant with perl but I am not familar with Latex. But I can
try if it works. Appreciate any pointers.

Thanks and Regards
Dominic


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

Date: 26 Apr 2004 20:47:33 -0700
From: mnemotronic@yahoo.com (pt)
Subject: Re: Ignore errors inserting dup records?
Message-Id: <da662010.0404261947.54de7084@posting.google.com>

spamtotrash@toomuchfiction.com (Kevin Collins) wrote in message news:<slrnc8r0qi.dsd.spamtotrash@doom.unix-guy.com>...
> In article <da662010.0404261328.3a6a1845@posting.google.com>, pt wrote:
> > I have a table "T" with an autonum primary key field "ID" and a
> > text/string field "v".  The field "v" is indexed and declared UNIQUE. 
> > Is there a syntax which will allow me to add records and ignore (or
> > not add) any which would violate the "unique" aspect of "v"?
> > 
> > Table "T":
> > ID v
> > ----
> > 1 I
> > 2 am
> > 3 the
> > 4 walrus
> > 5 oo
> > 6 koo
> > 7 katchoo
> > 
> > Given this table, I run this :
> > INSERT INTO T (v) VALUES ("The" , "walrus" , "was" , "Paul") ;
> > 
> > The insertion of "walrus" will fail because it already exists, and "v"
> > is indexed/no_dups.  I want the SQL to insert records for "The",
> > "was", and "Paul", and not error when in sees "walrus" already present
> > at record #4.
> 
> No, it won't. It will fail because you are trying to insert 4 column values
> into a table which has oonly 1 column!

You noticed that SQL isn't my strong suite.  Are you saying the only
way to insert 4 rows is to execute 4 individual SQL statements? 
Sounds like a lot of overhead.  Is there another way?  What if I have
not 4, but 40,000 records I want to insert?

> > 
> > I'm doing this with Perl + DBI/DBD (not ODBC) talking to a MS-Access .MDB
> > file.
> > 
> > Thanks in advance.


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

Date: Tue, 27 Apr 2004 14:15:48 +1000
From: Matthew Braid <mb@uq.net.au.invalid>
Subject: Re: Ignore errors inserting dup records?
Message-Id: <c6kmpk$k2e$1@bunyip.cc.uq.edu.au>

pt wrote:

> I have a table "T" with an autonum primary key field "ID" and a
> text/string field "v".  The field "v" is indexed and declared UNIQUE. 
> Is there a syntax which will allow me to add records and ignore (or
> not add) any which would violate the "unique" aspect of "v"?
> 
> Table "T":
> ID v
> ----
> 1 I
> 2 am
> 3 the
> 4 walrus
> 5 oo
> 6 koo
> 7 katchoo
> 
> Given this table, I run this :
> INSERT INTO T (v) VALUES ("The" , "walrus" , "was" , "Paul") ;
> 
> The insertion of "walrus" will fail because it already exists, and "v"
> is indexed/no_dups.  I want the SQL to insert records for "The",
> "was", and "Paul", and not error when in sees "walrus" already present
> at record #4.
> 
> I'm doing this with Perl + DBI/DBD (not ODBC) talking to a MS-Access
> .MDB file.
> 
> Thanks in advance.

I'll assume you mean ("The"), ("walrus"), ("was"), ("Paul")...

You can wrap your statement handle execute calls in an eval and just not care if 
it fails, or if access supports it (and it probably doesn't going by how truly 
horrible access is) you can use INSERT IGNORE instead of INSERT. With mysql at 
least this will repress duplicate key errors (turns a duplicate insert into a noop).

MB



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

Date: Mon, 26 Apr 2004 21:32:57 -0400
From: Chris Mattern <matternc@comcast.net>
Subject: Re: is there a way ..... any way
Message-Id: <V82dnQhFj7nUJRDdRVn-sA@comcast.com>

Henry Law wrote:

> I had found that, in general, a
> reference manual was enough to get me going: my basic knowledge of the
> things that *should* be possible, plus a reference manual to show me
> how those things were done in language "x", would be enough to get me
> going, after which reading good code provided the refinement.   (OK,
> OK, that didn't work for APL, but that's another story!)

Heck, that's another universe!

-- 
             Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"


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

Date: Tue, 27 Apr 2004 03:09:43 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: is there a way ..... any way
Message-Id: <slrnc8rjnn.9be.dha@panix2.panix.com>

In article <Xns94D78E33A157dkwwashere@216.168.3.30>, David K. Wall wrote:
> Do you all ever sleep? 

What is this "sleep" you speak of?  Is it a custom of your people?  :-)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
The Teletubbies are coming to America.
They must be stopped!


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

Date: Mon, 26 Apr 2004 22:12:57 -0800
From: "Robin" <robin @ infusedlight.net>
Subject: Re: is there a way ..... any way
Message-Id: <c6kms0$16n9$2@news.f.de.plusline.net>


"Andries" <andries@zilz.nl> wrote in message
news:9eko80tvb2m053u98cs78v5112gcbmnsh1@4ax.com...
> On Mon, 26 Apr 2004 01:36:25 +0200, Gunnar Hjalmarsson
> <noreply@gunnar.cc> wrote:
>
> >Andries wrote:
> >> I tried lurking on but it stays jibberish to me. Questions asked
> >> are responded with a jargon that is beyond my comprehension and
> >> often in a tone you'll think twice to ask the next question. So
> >> this is too heavy for me (yet?).
> >
> >Actually, if you are referring to the "Novice..." thread you started,
> >you got plenty of useful advice. It's correct that nobody posted a
> >complete program, which is quite in order.
> >
> >Please understand that this is not a help desk, it's not "write my
> >program for me for free" service!! (You also wrote me privately, and -
> >stupid as I may be - I sent you a complete program. Not sure if it
> >does exactly what you want, but it's a start.)
> >
> >> Is there a way that simple mortals can ask questions how to do
> >> things with perl/ work with perl.
> >
> >Absolutely. Provided, though, that those "mortals" *show* (not just
> >say) that they are interested in improving their Perl skill *and* that
> >they have made reasonable own efforts before posting.
> >
> >> ok ok RTFM you'll say.
> >
> >Yes. It can't be said too often. :)
> >
> >> Obviously you don't understand my question and despair.
> >
> >If you know no Perl, and are in such a hurry, the natural thing to do
> >is to *hire* somebody who helps you.
>
> Gunnar,
>
> point taken. I just wanted a start that's all.
> If you are new to something, like i am then it is helpfull to have a
> start.
> You helped me very much but the program you gave me is not the end. It
> is a start for me. I can understand what it "does" and helps me to
> improve my skills.
> I can now look in the faqs and docs and look to my specific needs.
> People like me learn from doing and trying and stumbling.
> I think, although i can understand your point, that you have a rather
> pessimistic view.
> When i wanted just a program i would pay (of course). i wanted a
> program to learn.
> So you helped me to learn. And that's all that i wanted. It was never
> my intention to take advantage of anyone.
>
> Andries

look in the faq and docs then, that's what I've been *doing*.
-Robin




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

Date: Tue, 27 Apr 2004 06:33:16 +0000 (UTC)
From: Robin <webmaster@infusedlight.net>
Subject: Re: Newsreader - human error [OT]
Message-Id: <Xns94D85AB5790Ewebmasterinfusedligh@212.19.48.35>

James Willmore <jwillmore@remove.adelphia.net> wrote in
news:pan.2004.04.26.18.36.25.900311@remove.adelphia.net: 

> I use pan and found a whole lot of messages waiting to 
be sent.  And,
> like a trained chimp, I clicked "Yes" a whole lot of 
times :-(
> 
> I know that I *should* know better than to click "Yes" 
without
> thinking. 
> 
> Sorry for any repeat messages.
> 

for a good newsreader for windows, check out xnews, it's 
on download.com and it's freeware, it sends them 
instantly.


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

Date: Mon, 26 Apr 2004 22:23:22 -0800
From: "Robin" <robin @ infusedlight.net>
Subject: Re: operator
Message-Id: <c6kn8g$16o3$1@news.f.de.plusline.net>


"kums" <bckumari@yahoo.com> wrote in message
news:9d6926ebdbe6805405d9f41666c934ab@localhost.talkaboutprogramming.com...
> tell me the difference between the substitution operator(s) and
> transliteration operator(tr)

one of them looks like tr and one them looks like s.
read the perldocs.

--
Regards,
-Robin
--
[ webmaster @ infusedlight.net ]
www.infusedlight.net




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

Date: Mon, 26 Apr 2004 21:54:15 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: output to STDOUT to a file
Message-Id: <33jjc.18746$OU.395603@news20.bellglobal.com>


"Richard Morse" <remorse@partners.org> wrote in message
news:remorse-421E6A.16535526042004@plato.harvard.edu...
> In article <f6d34657.0404261229.3b673517@posting.google.com>,
>  jshaboo@hotmail.com (joe shaboo) wrote:
>
> > I'm trying to output the STDOUT to a file which is the same as the
> > file I'm reading.
> >
> > The way I'm handling it now is sloppy, and I'd like to do it all
> > inside the perl script.
> >
> > Here's an example.
> >
> > $file = filename
> >
> > while (<$file>) {
> >     print $_;
> > }
> >
> > Then from the command line, I do $./script file > file1;mv file1 file
> >
> > This is terrible, and I know it is easy, but I can't get it to work
> > with open(), and I'm sure you can, I just can't get it to work.
>
> I think, if I understand you correctly, that you are trying to do
> in-place file editing.  That is, you wish to open a file, read through
> it, and save any changes.  The best way to do this is something like:
>

[snip code that reads from backup and saves to original]

The best way would arguably be to use the Tie::File module for in-place
editing. The only caveat I would add is to only use the module on data you
trust. I loved the module so much after using it for the first time that I
tried incorporating it into a script that does some prepocessing work on
files for the editorial staff where I work. Sure enough, up it went in smoke
the first time it was used on a file that had been emailed from an outside
author (damn line endings!).

So I guess that means your way is the safest, albeit not the coolest. But
there's always something good to be said for safe code.

Matt




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

Date: 26 Apr 2004 18:05:42 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: RegExp poser: matching two substrings
Message-Id: <408db1e6@news.victoria.tc.ca>

Stuart Moore (stjm2@cam.ac.uk.remove) wrote:
: I've been working on a uni project where you have to work out how 
: similar two strings are, and I was wondering if it could be done somehow 
: in a regular expression (or two...). This isn't part of my project, 
: there are far more sensible ways of doing it, this is just for fun.

: Suppose you have two strings, $s and $t. You want to find the substrings 
: of $s and $t that have the highest score attached, where you have +1 for 
: each pair of letters that match, and -1 for each that don't.

: So, $s='MEAT', $t='ATE' has a score of 2 because you match the 2 'AT' 
: substrings.
: $s='ABCDE' $t='ABFDE' has a score of 3 - it's still worthwhile taking 
: the -1 on the middle letter, because there's +2 on either side.

: Any thoughts? Feel free to assume $s and $t are alphabetic/alphanumeric.

: Finding matching substrings of length $n is easy, using
: "$s:$t" =~ /([^:]{$n}).*:.*$1/;
: (untested) but I got no further...

: Stuart

I would not use regexp.

I would split the strings into character arrays, and then use the diff 
module with each character treated as a "line".




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

Date: Tue, 27 Apr 2004 06:02:15 +0200
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: SV_TYPE_* constants?
Message-Id: <c6kml2$d7hqo$1@ID-231055.news.uni-berlin.de>

Also sprach FixerDave:

> anyone willing to point me in the right direction for finding information
> on "SV_TYPE_* constants"?  The docs for Win32::NetAdmin say "For flags, see
> SV_TYPE_* constants," with no other mention of them.  I've been running
> around is circles trying to figure out what these are.

Hmmh, SV_TYPE_* is misleading. My first association was the SVt_*
constants in the perl source used to identify the type of variable.

Those the docs mention however can be found in Win32/NetAdmin.pm. See
the source of this module. Or print them out like this

    use Win32::NetAdmin;
    print join "\n", grep /^SV_TYPE/, @Win32::NetAdmin::EXPORT;

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Tue, 27 Apr 2004 02:41:13 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: Tripod wont find my lib files
Message-Id: <408DC812.1070001@rochester.rr.com>

Bob Walton wrote:

> javatiger wrote:
> 
 ...
> 
> 
>> open( TXT, ">>messages.txt" );


Oh yeah, and *always* check your open statements to see if
they succeeded or not, like:

    open TXT,">>messages.txt" or
          die "Oops, couldn't open messages.txt for append, $!";

print TXT "Message: $txt - From $name \n";                     


close(TXT);



>> open( DATA, "<messages.txt" );


    open DATA,"<messages.txt" or
       die "Oops, couldn't open messages.txt for read, $!";


 ...

-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl



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

Date: Mon, 26 Apr 2004 22:08:34 -0800
From: "Robin" <robin @ infusedlight.net>
Subject: Re: what I was doing (originally textarea problem)
Message-Id: <c6kmrv$16n9$1@news.f.de.plusline.net>


"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message
news:bvhjc.18190$OU.359798@news20.bellglobal.com...
>
> "Robin" <robin @ infusedlight.net> wrote in message
> news:c6k5ii$uhj$2@news.f.de.plusline.net...
> >
> > I'm stupid.
> >
>
> No need to state the obvious when posting here...
>
> Matt

thanks a lot....
jesus.
--
Regards,
-Robin
--
[ webmaster @ infusedlight.net ]
www.infusedlight.net




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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 6474
***************************************


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