[25076] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7326 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 27 18:15:48 2004

Date: Wed, 27 Oct 2004 15:15:15 -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           Wed, 27 Oct 2004     Volume: 10 Number: 7326

Today's topics:
    Re: How do I parse this Charactor? 2byte vs 1byte <nntp@rogers.com>
    Re: How do I parse this Charactor? 2byte vs 1byte <usenet@morrow.me.uk>
    Re: How do I parse this page? <tadmc@augustmail.com>
        How to use relative path for a module (dn_perl@hotmail.com)
    Re: How to use relative path for a module <spamtrap@dot-app.org>
        How's my logic? <ioneabu@yahoo.com>
    Re: How's my logic? <lawshouse.public@btconnect.com>
    Re: list vs array <nospam@nospam.com>
    Re: MAIL recommendation <bik.mido@tiscalinet.it>
    Re: MAIL recommendation <bik.mido@tiscalinet.it>
    Re: Modify program to write just data to a text file. <tadmc@augustmail.com>
    Re: Modify program to write just data to a text file. <noreply@gunnar.cc>
        Newbie needs help with forking (Michael Smith)
        Parallel/ Multithreading /Forking? (Prabh)
        removin \n from only part of a string (sroemerm)
    Re: removin \n from only part of a string <noreply@gunnar.cc>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 27 Oct 2004 15:37:25 -0400
From: "nntp" <nntp@rogers.com>
Subject: Re: How do I parse this Charactor? 2byte vs 1byte
Message-Id: <SMKdnSWXZO6PZOLcRVn-hA@rogers.com>


>
> Well, you'll need to:
>
> 1.  Get a recent version of Perl if you don't already have it (5.8.4 is
> fine).
>
> 2.  Check out the docs for the binmode() function:  perldoc -f binmode
>
> 3.  Determine what sort of encoding is used to represent your character.
>   If you don't know, you can guess by trying the options available in
> the binmode() function.  Chances are good it is UTF-8 encoding.
>

I only need English charactors. Is that possible using s///gs to remove
those suckers? It is totally messed up my program. When I parse, I got
Chinese, French, Spanish, everything, but I only need English.




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

Date: Wed, 27 Oct 2004 19:22:26 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: How do I parse this Charactor? 2byte vs 1byte
Message-Id: <2k5552-e07.ln1@osiris.mauzo.dyndns.org>


Quoth karel@e-tunity.com:
> And regarding encodings or character sets:  _yes_, Perl can be told to
> regard 2-byte sequences as 1 character (or even more than 2 bytes,
> actually). Try "perldoc -f multibyte" and then play around with the Unicode
> modules. 

You mean '-q'. :)

Ben

-- 
   Although few may originate a policy, we are all able to judge it.
                                             - Pericles of Athens, c.430 B.C.
  ben@morrow.me.uk


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

Date: Wed, 27 Oct 2004 13:14:13 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How do I parse this page?
Message-Id: <slrncnvpbl.r71.tadmc@magna.augustmail.com>

Dr John Stockton <spam@merlyn.demon.co.uk> wrote:
> JRS:  In article <Xns958EB135B42A7asu1cornelledu@132.236.56.8>, dated
> Tue, 26 Oct 2004 21:25:13, seen in news:comp.lang.javascript, A. Sinan
> Unur <1usa@llenroc.ude.invalid> posted :
>>"nntp" <nntp@rogers.com> wrote in
>>news:_dydnarTGPNdFePcRVn-sQ@rogers.com: 
>>
>>> I am trying to parse
>>> http://www.ebay.com without success.
>>> 
>>> I view the source, and I see a lot of ?/td>. This page is unsavable.
>>
>>That ain't true. If you have any questions on parsing HTML using 
>>HTML::Parser, please post them here. Otherwise, this waaay off-topic.
> 
> Please take greater, or at least better, thought before using a word
> such as "here".


Please take greater, or at least better, notice of the Newsgroups
header before determining which "where" is "here".

:-)


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


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

Date: 27 Oct 2004 13:46:10 -0700
From: dn_perl@hotmail.com (dn_perl@hotmail.com)
Subject: How to use relative path for a module
Message-Id: <97314b5b.0410271246.65469cd3@posting.google.com>

Is it (possible / advisable) to use relative path for a module?

I install 3 directories under a location specified by my client.
The client may specify /apps/home or /home/usr/myproduct or whatever
as the location where I should install my 3 directories.

My directories are :  myapp, mylib, myhelp.
Let us say they are installed under /apps/home. One env variable
which the user is required to set is $MYAPP_HOME="/apps/home/myapp" .
The dir /apps/home/mylib contains a module : dir_list.pm .
I want the perl script /apps/home/myhelp/option01 to use dir_list.pm .
How can I do so using 'use dir_list' construct?
"use ../mylib/dir_list" gives syntax error.


Thanks in advance.


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

Date: Wed, 27 Oct 2004 17:09:57 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: How to use relative path for a module
Message-Id: <Q8adnS-MYKk7kx3cRVn-gA@adelphia.com>

dn_perl@hotmail.com wrote:

> I install 3 directories under a location specified by my client.

One option is to have the installer script - if you're using one - alter 
the 'use lib' line in your scripts.

> Let us say they are installed under /apps/home. One env variable
> which the user is required to set is $MYAPP_HOME="/apps/home/myapp" .

If you're asking your users to set environment variables anyway, you 
could simply have them set PERL5LIB to point to /apps/home/mylib.

Another option would be to do this:

use lib $ENV{'MYAPP_HOME'} . '/../mylib';

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Wed, 27 Oct 2004 15:55:00 -0400
From: wana <ioneabu@yahoo.com>
Subject: How's my logic?
Message-Id: <10nvvepcp1opu81@news.supernews.com>

Here is a piece of code from a simple program I wrote to do some FTPing.  I
was wondering if the form of my statement is acceptable with respect to the
use of 'and' and 'or'.  I did it, hoping for the best, and it seems to
work.  I am always shaky on rules of precedence and usually use lots of
()'s to make sure I get it right, but I am trying to wean myself off of
them.

if ($user and $pass)
{
        $ftp->login($user, $pass)
        and print "successfully logged on to $server as $user\n"
        or print "problem logging on to $server as $user\n";
}


Thanks!



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

Date: Wed, 27 Oct 2004 22:55:50 +0100
From: Henry Law <lawshouse.public@btconnect.com>
Subject: Re: How's my logic?
Message-Id: <l460o01adoho3sn03p44j245mobiff0cgs@4ax.com>

On Wed, 27 Oct 2004 15:55:00 -0400, wana <ioneabu@yahoo.com> wrote:

>if ($user and $pass)
>{
>        $ftp->login($user, $pass)
>        and print "successfully logged on to $server as $user\n"
>        or print "problem logging on to $server as $user\n";
>}

Can you post a complete program?  Then someone (even me, a comparative
newbie) could run it, see what happens and try to help.  I can't run
that fragment, though, and to try to erect a scaffolding around it to
enable it to run would (a) be a drag to do; and (b) distance the code
so far from yours as to be meaningless.

Henry Law       <><     Manchester, England 


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

Date: Wed, 27 Oct 2004 17:23:08 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: list vs array
Message-Id: <1098912235.555848@nntp.acecape.com>

"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message
news:kc1tn09fd5medk2ro1dgsdab4cjdg6u3tb@4ax.com...
> >"Starting" ActiveState's Komodo (or VisualPerl.  I forgot the actual
name)
>
> Then why didn't you say so? To you Komodo or whatever other IDE you
> like may be a synonim to "Perl", but for most other people here it is
> not, for (for one thing) I think that only a minority of them is using
> an IDE at all. Let alone Komodo...

i did say so...that it was slow loading and running


> BTW: personal preferences are personal preferences, but did you try a
> good text editor and the cmd line or do you think that this could
> severely injure you?
ignoring the slap in that sentence...i stated i prefer IDE's...just the
world i have grown acustomed to.  as a side note i think especially for when
you are new to a language, being in a visual debuger, where you can just
grab a variable and play with how you cast it, till you get it right is very
usefull....

and yes personal preferences are personal preferences and when they come
from other prrogrammers i take them into account....





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

Date: Wed, 27 Oct 2004 22:47:50 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: MAIL recommendation
Message-Id: <ut00o0lrtj4qcjptgc7crms7r792d7808v@4ax.com>

On Wed, 27 Oct 2004 01:52:02 -0400, "daniel kaplan"
<nospam@nospam.com> wrote:

>sorry guys, asking an opinion is a person thing,  i have been given
>a few mail modules to look at...but look at the FAQ when you do
>a search on IDE (mentioning it cause i got the same speech when
>i asked for opinions on an IDE.."FAQ!""FAQ!""FAQ!")

And an opinion is a personal thing. If you *really* want to use an
IDE, then to find the one best suited for *you*, *you* have to try
some out. I suppose that most experienced users don't use an IDE at
all...

>guys/gals....that is a FAQ!  nothing more, there is NO OPINION there.
>doesn't say
>that --- offers upload, +++ is slow, ==== is buggy, etc.

"offers upload"?!? (Are you talking about CGI et similia?) "is
slow"/"is buggy"? These are other subjective charachteristics. What is
slow for someone may be acceptably fast for others, and what some
consider to be a bug may be a feature for someone else. So which is
the point in asking for a personal opinion at all, *about such a
thing*?

>and if you can't take 2 seconds to say...this one i think sucks, this one i
>love, etc.
>then i'm sorry you're not a community...you might help technicaly, but then
>you're
>just a book.

Your informed judgement may well be this. I think you're judging too
fast though. As far as I'm concerned, I have learned more about Perl
from clpmisc than from any other resource. And I'm here because I'm
still learning, although being now moderately experienced the threads
that I find actually interesting are less and less. OTOH I can help
others by sharing what I (am certain I) *do* know (well enough).

>i do like how a select few do give their opinion and move on....suprised the
>SS haven't hunted them down and taken them out...oops gotta go, someone's at
>the door...

Oh no! Godwin's law again... bleach!!

I haven't checked carefully, but it seems to me that in the best case
only a minority of those regulars whose opinion I would value as
precious (those from which I *have* learnt) did give their opinion. 


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Wed, 27 Oct 2004 22:47:53 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: MAIL recommendation
Message-Id: <1u00o092ovsdn6p0v84r81tg1qg0dsftcq@4ax.com>

On Wed, 27 Oct 2004 03:34:43 -0400, "daniel kaplan"
<nospam@nospam.com> wrote:

>and finally a rule we ALL have not followed, i would say,
>"But if you get upset, wait a while before writing your followup. I
>recommend waiting at least 30 minutes. Count to ten after composing and
>before posting when you are upset  After you have written your followup,
>wait another 30 minutes before committing yourself by posting it. You cannot
>take it back once it has been said. "
>
>and i just realized who wrote the guideline...AUTHOR: Tad McClellan ...and
>when i think of tad's posts, which i finally had to stop reading....wow...i
>needed that laugh seriosuly...

I think that Tad did think long enough before writing anything he may
have written to you. And as for the fact that you decided to ignore
him (but then I suppose that he killfiled you in the first place), I
can tell you that for me "Tad McLellan" is nothing but a name, a name
though, associated to an individual that over the years has given me
hints, advices, informed answers and what more... an individual, in
short that has been preciously helpful in helping me to learn. If you
prefer the opinions of Dr. Fred Mbogo... well, good luck!


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Wed, 27 Oct 2004 13:10:47 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Modify program to write just data to a text file.
Message-Id: <slrncnvp57.r71.tadmc@magna.augustmail.com>

Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:

> It would be interesting to hear a lawyer's opinion on this.


There is a newsgroup for discussing such things, complete
with lawyers:

   misc.int-property


And the occasional "Condo for sale!" posts are good for a grin too.


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


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

Date: Wed, 27 Oct 2004 23:42:29 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Modify program to write just data to a text file.
Message-Id: <2uajucF27ha8lU1@uni-berlin.de>

Tad McClellan wrote:
> Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
>>It would be interesting to hear a lawyer's opinion on this.
> 
> There is a newsgroup for discussing such things, complete
> with lawyers:
> 
>    misc.int-property

Thanks for the tip.

(This sub-thread may have been off topic, but OTOH the topic should 
reasonably be of interest to anybody dealing with software.)

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: 27 Oct 2004 13:52:09 -0700
From: ms7530@yahoo.com (Michael Smith)
Subject: Newbie needs help with forking
Message-Id: <87e3adb4.0410271252.155b219e@posting.google.com>

Hey Yall (from Tennessee you know),

Here is what I want to do:

Start a perl script which first forks a process that runs own it's
own.  This child process will be a Oracle sqlldr job.  This job will
run for about 30 mintes

While the sqlldr job is running return to the parent thread and start
running a bunch of database selects and OS commands to give me
statistics on the overall performance.

Once the sqlldr job completes stop collecting statistics and end the
script.

Anyone have an example close to that?

Thanks,

Mike


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

Date: 27 Oct 2004 12:30:00 -0700
From: Prab_kar@hotmail.com (Prabh)
Subject: Parallel/ Multithreading /Forking?
Message-Id: <e7774537.0410271130.624bfdf0@posting.google.com>

Hi,
My task involves searching a huge number of files on filesystem and
based on the filetype perform some function. e.g. if file is ".java"
perform a particular routine, if its ".pl" perform another.

As the no. of files is quite huge, I thought it'd be most efficient if
I used any parallel-processing techinique.

Some've advised me to use forking, some parallel processing, some
others multi-threading. Needless to say, I'm confused.

Are these terms being interchangeably used?
How are they diff. from one another?

Could anyone give me a clue what would be a good fit for my task.
Should I be downloading any CPAN modules and such?

Thanks for your time.
Prabh


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

Date: 27 Oct 2004 14:02:30 -0700
From: roemerman@gmail.com (sroemerm)
Subject: removin \n from only part of a string
Message-Id: <e32a40f9.0410271302.2d713642@posting.google.com>

I have a rather large string wiht all kinds of valid \n(s) but I have
some that I want to get rid of.

In the following example I want to get rid of only the new lines in
between < and >

my $string = "I like this\n but <I dont like\n the\n ones\n in here>"
I want the previous string to look like this
"I like this\n but <I dont like the ones in here>"

I've tried a couple things but the bottom line is that I'm not good at
expression parsing.   please help.


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

Date: Wed, 27 Oct 2004 23:12:50 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: removin \n from only part of a string
Message-Id: <2uai68F28uim5U1@uni-berlin.de>

sroemerm wrote:
> I have a rather large string wiht all kinds of valid \n(s) but I have
> some that I want to get rid of.
> 
> In the following example I want to get rid of only the new lines in
> between < and >
> 
> my $string = "I like this\n but <I dont like\n the\n ones\n in here>"
> I want the previous string to look like this
> "I like this\n but <I dont like the ones in here>"
> 
> I've tried a couple things but the bottom line is that I'm not good at
> expression parsing.   please help.

     $string =~ s/(<[^>]+>)/ ( my $tmp = $1 ) =~ s!\n!!g; $tmp /eg;

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

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


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