[19922] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2117 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 12 18:05:49 2001

Date: Mon, 12 Nov 2001 15:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1005606309-v10-i2117@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 12 Nov 2001     Volume: 10 Number: 2117

Today's topics:
    Re: Best language for low IQ programmers? <fraklein@massed.net>
        Can I make one perl cgi script work both in linux and i <sj88@cornell.edu>
    Re: comp.lang.perl <godzilla@stomp.stomp.tokyo>
    Re: comp.lang.perl <mgjv@tradingpost.com.au>
    Re: error message <bart.lateur@skynet.be>
        How do I search for values in an array and change them? (Nathan)
    Re: How do I search for values in an array and change t <ronh@iainc.com>
    Re: IO::Socket write fail <uri@stemsystems.com>
    Re: Mail::Audit <rereidy@indra.com>
        Perl 6 (john)
    Re: Perl 6 (Chas Friedman)
    Re: Perl 6 <Tassilo.Parseval@post.rwth-aachen.de>
        perl install (fabrizio)
    Re: perl install <hillr@ugs.com>
    Re: perl install <Tassilo.Parseval@post.rwth-aachen.de>
        RegEx ack references ... I need a clue <donotspam-jen@dangerousideas.com>
    Re: RegEx ack references ... I need a clue (Chas Friedman)
    Re: RegEx ack references ... I need a clue <bart.lateur@skynet.be>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 12 Nov 2001 17:49:40 -0500
From: "Frances Klein" <fraklein@massed.net>
Subject: Re: Best language for low IQ programmers?
Message-Id: <9spjag$s6m$1@bob.news.rcn.net>

Java?  I love to drink java at the end of a good meal.  Can anyone recommend
a nice kosher restaurant in the southern half of Manhattan, full of
atmosphere and lots of choices beyond the usual?

Frances

Where have all the foodies gone???


"Marshall Spight" <mspight@dnai.com> wrote in message
news:iGCF7.23838$wj5.13647496@news1.rdc1.sfba.home.com...
"Brian Metc" <BrianMetc@aol.com> wrote in message
news:1004990076967295@aol.com...
>
> Java is simple compared to c plus plus but a scam language, based on hype.


Is this some kind of joke?


Marshall







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

Date: Mon, 12 Nov 2001 15:24:18 -0500
From: "Shi Jin" <sj88@cornell.edu>
Subject: Can I make one perl cgi script work both in linux and in windows?
Message-Id: <9spb5o$rdj$1@news01.cit.cornell.edu>

in linux , the first line should be
#!/usr/bin/perl
But in windows, it should be
#!E:\cygwin\bin\perl.exe
How can I make it work in both systems?
Thanks a lot.




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

Date: Mon, 12 Nov 2001 12:44:03 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: comp.lang.perl
Message-Id: <3BF03493.F15B36AE@stomp.stomp.tokyo>

Stuart Gall wrote:


(carefully clerically censored)
 

> I have seen many people say this group has been rmgrouped 5 years ago. I
> have seen the URLs stating that it is so.

> Or since I have the group maybe I should go on a crucade posting a "this
> group is dead please go to comp.lang.perl.misc " message every two weeks.


There exists another newsgroup you should add to your Cleric "Crucade" to be
sure all infidel groups are exterminated before they lead to a dire demise
of all USENET. This dangerous nonbeliever group is alt.perl which does present,
as all other rogue newsgroups do, a clear and present danger to the health and 
happiness of all internet denizens.


Godzilla!  Queen Of Perl Heritics.


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

Date: Mon, 12 Nov 2001 22:07:54 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: comp.lang.perl
Message-Id: <slrn9v0i2h.2q5.mgjv@verbruggen.comdyn.com.au>

On Mon, 12 Nov 2001 08:21:50 -0600,
	Mr. Sunblade <djberge@qwest.com> wrote:
> 
> "Martien Verbruggen" <mgjv@tradingpost.com.au> wrote in message
> news:slrn9uuhvb.2q5.mgjv@verbruggen.comdyn.com.au...
><snip snip>
>> > Exactly the sort of stuff I was referring to.  I'm not sure if English
> is
>> > your first language Martien,
>>
>> English is not my first language, but I don't think that's an issue
>> here.
> 
> Sometimes stuff that may seem like plain English to non-native speakers
> comes off as brusque and/or sarcastic to us native English speakers.

Possibly. But I wouldn't use the fact that English isn't my native
language as an excuse. I've seen many posts from native English
speakers who couldn't get their point across. While a less complete
command of a language can be a handicap, I don't think it is, or at
least should be, in my case :)

>> On the other hand, many people are overly sensitive to criticism. I've
>> seen enough abusive threads start with an overreaction to a gentle
>> enough pointer to the FAQ, documentation or other resource, to be able
>> to say that the issue isn't as simple as it seems. Yes, some
>> non-answers are unnecessarily rude, but some receptions of some
>> answers are unnecessarily overly sensitive.
> 
> True.  Normally my philosophy is "insult me all you want, just so long as
> you actually help me".

This is the attitude a programmer should have. After all, a
computer/compiler/interpreter does this to you all the time. :)

>                         Maybe it's that "growing frustration" you've
> referred to.

Probably. Which, of course, isn't an excuse, merely an explanation.

>> And this is probably something we would disagree on. I do not believe
>> that the utility of this newsgroup has stayed as healthy as it was 4
>> years ago. In fact, I just had the opportunity to reread a load of
>> archived posts[1] on groups.google.com from the first days the archive
>> starts (when Larry Wall was still posting here, BTW). The tone of the
>> posts, the S/N ratio and the amount of information in posts back then
>> was significantly better than it is nowadays. There were fewer posts
>> that asked offtopic questions, and fewer posts that asked for
>> information that is answered by the FAQ and the documentation. New
>> posters also seemed more willing to accept any help they got, even if
>> they were simply pointers to documentation, or a more appropriate
>> newsgroup.
> 
> I always figured Larry Wall was simply too busy to read the posts here.

Maybe, although I don't think that was the only reason. Many people
have been busy from time to time, and they'll leave the group for a
while, then come back. Larry Wall did express his dissatisfaction with
how this group (and others) were developing, so we do know the
frustration existed.

> Quite frankly, I think 99% of the posts are probably too easy for him to
> waste his time with anyway.  The remaining 1% would be POSIX, XS or the
> various NT/2000/XP issues that creep up from time to time.

I think that 99% of the posts here are too "easy" for many people who
still hang around here. I don't think that the level of complexity is
that important. I see well established Perl hackers respond politely
to very basic questions, without frustration. The problem is, and this
works in both directions, that the most vocal and loud people tend to
be the ones that create an atmosphere. A very small minority can
account for a large part of the atmosphere on a newsgroup, something
like Pareto's law for Usenet moods. These people, when they occur on
different sides of an argument, especially if its one that involves
the "rules" of the newsgroup, can easily dominate your thread view for
weeks, gradually diminishing the reading pleasure.

> A very unscientific "gut feeling" is that a very hefty chunk of the
> off-topic stuff is CGI related.  Part of the problem is that many people
> want to know how to do stuff with CGI in Perl, and there question falls
> somewhere between this newsgroup and the comp.infosystems.www.authoring.cgi
> newsgroup.  I mentioned the idea of a comp.lang.perl.cgi a while back but it
> met with little, if any, support.  I think it would help the signal to noise
> ratio considerably for this newsgroup.  It works for Tk - you get relatively
> few Tk-related cross-posts to clpm, though obviously Perl-Tk isn't as
> ubiquitous as CGI. :)

I don't have a problem with a clp.cgi group anymore. I used to,
because I didn't see that it was necessary to duplicate something that
already existed in the comp.infosystems hierarchy. I also don't think
many people with enough knowledge will actually read the group,
therefore making it less useful or useless, destined to die before it
is conceived.

However, if anyone draws up a decent RFD, I'll vote for it. Maybe
it'll draw some of the problems away.

[SNIP]

> See my above post for at least one suggestion.  I've also suggested a
> comp.lang.perl.dbi, but even Tim Bunce was opposed to the idea.  Apparently,
> he doesn't mind seeing "Oracle DBD make test failed" on the mailing list at
> least 3 times a week.

It's always possible to filter on subjects, both on a mailing list and
on Usenet. I filter out about 30% of posts on subject, scoring them
down, or removing them alltogether. It really helps to weed out the
posts that I know I'm not going to be interested in.

> Ok - I won't post any more follow-ups. :)

I think I'll join you in that decision. 

Martien
-- 
                                | 
Martien Verbruggen              | In the fight between you and the
Trading Post Australia Pty Ltd  | world, back the world - Franz Kafka
                                | 


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

Date: Mon, 12 Nov 2001 20:39:14 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: error message
Message-Id: <toc0vt4b0tfuj0as7vl18fde9ps1nc7pq3@4ax.com>

Alfred Heer wrote:

>When I use the following script, I always get an error message:
>"Use of uninitialized value in pattern match (m//) at ... line 9"
>(line 9 = the line with "while( $_ = $ARGV[0], /^-/ ){	")

You should only do the second part of the test (the regex) if the first
part succeeds:

	while(@ARGV and $_ = $ARGV[0], /^-/) { ... }

or

	while(defined($_ = $ARGV[0]) and /^-/) { ... }

-- 
	Bart.


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

Date: 12 Nov 2001 14:48:59 -0800
From: nathan.franklin@idp.com (Nathan)
Subject: How do I search for values in an array and change them?
Message-Id: <cbd95c21.0111121448.7ac51252@posting.google.com>

Hi

I'm trying to search and replace a line in an array but am not really
sure where I've gone wrong.  The first bit I'm having trouble with is
searching the array @user for the username called $name.  The second
bit is I'm not sure why I can't replace a line in the array @list with
the newly created one.  Basically the idea is to take information from
a log file (userlist) and add entries for each user to find out their
total internet time and download amount.

#!/usr/bin/perl
@file=`cat /userlist`;
$output="User\tFull Name\tTotal Time\tTotal Download\tAmount Owing\n";

foreach $line (@file){
	chop $line;
	@details = split(/ /, $line);
	$name=$details[0];
	$fullname=`grep $name /etc/passwd|cut -d : -f 5`;
	$time=$details[3];
	$usage=$details[4];
	chop $fullname;
	if ( $user =~ /"$name"/ )  #if the user is not already in list add
	{
#		#now update the user totals
#		#find them in the $list array
#		$count=0;
#		#chomp $count;
#		$item=$users[0];
#		while ("$item" ne "$name")
#		{
#			++$count;
#		#	chomp $count;
#			$item=$users[$count];
#		}
#
#		#take them out of the list
#		$item2=$list[$count];
#		chop $item2;
		print "user already entered in list\n";
#		#break up the line to take the usage & time fields
#		@oldline = split(/\t/, $item2);
#		$newtime=$oldline[3];
#		#chop $newtime;
#		$newusage=$oldline[4];
#		#chop $newusage;
#		$newtime += $time;
#		$newusage += $usage;
		#add the new figures to the total
		$newitem="$name\t$fullname\t$newtime\t$newusage\n";
		$list=~ s/$newitem/$item/;
	}
	else
	{
		$nextline="$name\t$fullname\t$time\t$usage\n";
		push(@list, ($nextline)); #add this line to the array list
	        push(@user, ($name));     #add the userid to the array user
	}
}

print $output;
print @list;

I'm pretty new to perl so any advice or tips would be greatly
appreciated.
Thanks Nathan


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

Date: Mon, 12 Nov 2001 23:00:13 GMT
From: "Ron Hartikka" <ronh@iainc.com>
Subject: Re: How do I search for values in an array and change them?
Message-Id: <1wYH7.19621$4W.202671@typhoon.mw.mediaone.net>

try

if ( $user =~ /$name/ )

instead of

if ( $user =~ /"$name"/ )


"Nathan" <nathan.franklin@idp.com> wrote in message
news:cbd95c21.0111121448.7ac51252@posting.google.com...
> Hi
>
> I'm trying to search and replace a line in an array but am not really
> sure where I've gone wrong.  The first bit I'm having trouble with is
> searching the array @user for the username called $name.  The second
> bit is I'm not sure why I can't replace a line in the array @list with
> the newly created one.  Basically the idea is to take information from
> a log file (userlist) and add entries for each user to find out their
> total internet time and download amount.
>
> #!/usr/bin/perl
> @file=`cat /userlist`;
> $output="User\tFull Name\tTotal Time\tTotal Download\tAmount Owing\n";
>
> foreach $line (@file){
> chop $line;
> @details = split(/ /, $line);
> $name=$details[0];
> $fullname=`grep $name /etc/passwd|cut -d : -f 5`;
> $time=$details[3];
> $usage=$details[4];
> chop $fullname;
> if ( $user =~ /"$name"/ )  #if the user is not already in list add
> {
> # #now update the user totals
> # #find them in the $list array
> # $count=0;
> # #chomp $count;
> # $item=$users[0];
> # while ("$item" ne "$name")
> # {
> # ++$count;
> # # chomp $count;
> # $item=$users[$count];
> # }
> #
> # #take them out of the list
> # $item2=$list[$count];
> # chop $item2;
> print "user already entered in list\n";
> # #break up the line to take the usage & time fields
> # @oldline = split(/\t/, $item2);
> # $newtime=$oldline[3];
> # #chop $newtime;
> # $newusage=$oldline[4];
> # #chop $newusage;
> # $newtime += $time;
> # $newusage += $usage;
> #add the new figures to the total
> $newitem="$name\t$fullname\t$newtime\t$newusage\n";
> $list=~ s/$newitem/$item/;
> }
> else
> {
> $nextline="$name\t$fullname\t$time\t$usage\n";
> push(@list, ($nextline)); #add this line to the array list
>         push(@user, ($name));     #add the userid to the array user
> }
> }
>
> print $output;
> print @list;
>
> I'm pretty new to perl so any advice or tips would be greatly
> appreciated.
> Thanks Nathan




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

Date: Mon, 12 Nov 2001 20:09:53 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: IO::Socket write fail
Message-Id: <x77ksvlpgb.fsf@home.sysarch.com>

>>>>> "M" == Mark  <admin@asarian-host.net> writes:

  M> That works lovely. However, the client still does not receive the
  M> data. That is, the data gets send, but the client only receives the
  M> data after the daemon is killed (like when I add an "exit 0"
  M> directly after sending). You would think this is a buffer problem,
  M> right? So do I. But before I add the client, I add an "autoflush"
  M> to it; something like this:

  M>     foreach $client ($sel -> can_read (1)) {
  M>         if ($client == $sock) {
  M>             $client = $sock -> accept ();
  M>             nonblock ($client);
  M>             $client -> autoflush (1);
  M>             $sel -> add ($client);
  M>             $globs{$client} = $client;
  M>         } else {

recent versions of IO::Socket enable autoflush automatically so you
shouldn't need to do it yourself. what version of perl abd IO::* do you
have?

  M> You would think that would cause a print or send to the client to be
  M> received immediately. Unfortunately, it doesn't. I know I am very close;
  M> there is just one small piece of the puzzle missing.

  M> The "nonblock" sub, btw, looks like this:

  M> use Fcntl qw (F_GETFL F_SETFL O_NONBLOCK);

  M> $| = 1;

that only affects stdout (assuming you haven't called single arg select
before it)

  M> sub nonblock {
  M>     my $sockt = shift;
  M>     my $flags = fcntl ($sockt, F_GETFL, 0) || die $!;
  M>     fcntl ($sockt, F_SETFL, $flags | O_NONBLOCK) || die $!;
  M> }

IO::Socket has a blocking method to do that for you. again, check your
versions for that and upgrade if needed.


non-blocking writes are tricky. do you really need them? you must check
the result of the write call and make sure it sent all the data. you
then have to buffer the unsent data and send it the next time the socket
is writable. this requires a more complex system and you should think
about going to an OO one like Stem, POE or Event.pm. IO::Select is too
limited when handling complex asynch i/o situations.

for many client/server designs, blocking i/o is ok as long as the
protocol on the pipe works that way.

also you use send/recv and i think you should be using syswrite/sysread
which are better as you can control how much is read/written with them.
send/recv are just different api's for socket i/o. and in either case,
make sure you check the amount of data written to non-blocking sockets.

uri


-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
-- Stem is an Open Source Network Development Toolkit and Application Suite -
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Mon, 12 Nov 2001 13:36:02 -0700
From: Ron Reidy <rereidy@indra.com>
Subject: Re: Mail::Audit
Message-Id: <3BF032B2.DD1F5F52@indra.com>

Robert Wein wrote:
> 
> Hi Everybody
> 
> I am new to perl, so please forgive my basic question.
> 
> I have a single domain with only 1 POP account but unlimited aliases.  I
> wanted to use Mail::Audit to redirect the
> messages depending on the "To".  I tried setting it (below) up with the
> "To", but, as I feared, it doesn't work.
> Anyone have any ideas?  Thanks
> 
> #!/usr/local/bin/perl
> 
> use Mail::Audit;
> 
> my $item = Mail::Audit->new;
> my $from = $item->from();
> study $from;
> my $to = $item->to();
> my $cc = $item->cc();
> my $subject = $item->subject();
> chomp($from, $to, $subject);
> 
> if ($to = alias1@domain.com
>     $item->resend('rightaddress@alias1.com');
>     }
> 
> if ($to = alias2@domain.com
>     $item->resend(rightaddress@alias2ISP.com');
>     }
> 
> $item->accept();
I would try using the debugger on this code.
-- 
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.


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

Date: 12 Nov 2001 12:47:56 -0800
From: raptnor@msn.com (john)
Subject: Perl 6
Message-Id: <a3db0d59.0111121247.27e1a95@posting.google.com>

Hi, Im just another Perl hacker with a question to the Perl community.
 I use Perl for a large variety things at both work and at home.  I am
currently reading the Camel 3 (a vast improvement over 2) and while
reading have been thinking a lot about Perl 6.  My question is this: 
Why do we need a complete redesign of our language?

I have been keeping up with it as it has progressed pondering this
question.  I could understand a rewrite of its internals, as it needs
to be cleaned up.  During that rewrite I could see cleaning up some
area's of the syntax and adding new features that enhance Perl. 
However, I cannot see making fundamental changes.

The idea of Perl 6 started out of the need of excitement.  I think
programming in Perl is pretty damn exciting in itself.  What other
language offers you so much access to its internals?  What other
language offers you four programming models (procedural, functional,
oo, and declarative) that you can mix or keep separate?  What other
language lets you bless anything that Perl sees as data into an
Object?  Talk about data encapsulation.  What other language has the
level of access that Perl does to the system (outside of C and ASM)
excluding libraries?  What other language as an enormous amount of
useful code on the web in the form of objects, libraries, and scripts?
 Why do we need to redesign?

I dont want my native data types acting like objects.  If someone
wants them to be objects then they can create some new Objects that
wrap them and put them on CPAN.  I dont want perls functions to return
objects.  I like scalars, list, and hashes because they are easy to
process using generic procedures.  I dont want Perls OO mechanisms to
change.  Anyone who has created objects in Perl knows that they are
the most powerful and flexible implementation out there.  I dont want
Perl to become Python, Java, or C#.  Perl provides the capability to
do these things now for anybody who knows Perl, why do we need to
redesign the language?

On the redesign side, Im not sure that Parrot engine is the best way
to implement Perl.  Why do we want a generic VM?  Every VM Ive ever
studied is designed to efficiently model the language that it is
designed to run.  Java is based on the Smalltalk engines (object
focused), Scheme on the scheme machine (list focused), Microsofts IR
(which is object and procedurally focused at this time), and Forth
(stack based).  Parrot is in response to Perls current stack
architecture but stack machines arent all bad and the current
implementation should not be enough to rule out more effitient designs
of the same.  As an example, Forth can easily be compiled and
optimized for just about any platform and achieve great performance.
 
These are just some of the examples of things that I find concerning. 
Im afraid that the language that we enjoy working in is going to
change into something that we wont like and I dont think the Perl
elders have considered this as they weave the path of Perl 6.  Do we
even know if the RFCs are from valid Perl users?  How many people
dumped RFC's in that don't really know Perl?

I have found Perl to be an excellent teaching language.  People have a
very easy time picking it up.  Scheme has a teach scheme, I think we
need one for Perl.  Is that the excitement that the Perl elders are
looking for?
 
Im not trying to upset  or insult anyone in the Perl community.  I
dont want to start a flame war.  This was a flow of consciousness on a
topic that I've been thinking about lately and was just curious as to
what everyone else thinks.

~Raptnor


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

Date: Mon, 12 Nov 2001 21:02:39 GMT
From: friedman@math.utexas.edu (Chas Friedman)
Subject: Re: Perl 6
Message-Id: <3bf03790.61142617@news.itouch.net>

On 12 Nov 2001 12:47:56 -0800, raptnor@msn.com (john) wrote:

>Hi, Im just another Perl hacker with a question to the Perl community.
> I use Perl for a large variety things at both work and at home.  I am
>currently reading the Camel 3 (a vast improvement over 2) and while
>reading have been thinking a lot about Perl 6.  My question is this: 
>Why do we need a complete redesign of our language?
 ............
 I've read some of the discussions about how Perl6 will differ, and
for the most part my feeling has been that Perl is great, but maybe it
will get even better. The only thing that has worried me a bit is that
it has been stated that a lot of scripts will be broken by new
notation/constructs, but that utilities to convert old code will be
available. I'm not too enthusiastic about having to convert all the
existing code I use or have written. Also, what about all the existing
modules, etc? 
 The truth is that I don't know much about what the situation will be
and am just writing this hoping for reassurance from those that do
know!
                     cf


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

Date: Mon, 12 Nov 2001 22:09:20 +0100
From: "Tassilo v. Parseval" <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Perl 6
Message-Id: <9spdq0$lsa$04$1@news.t-online.com>

On Mon, 12 Nov 2001 21:02:39 GMT, Chas Friedman wrote:

>  I've read some of the discussions about how Perl6 will differ, and
> for the most part my feeling has been that Perl is great, but maybe it
> will get even better. The only thing that has worried me a bit is that
> it has been stated that a lot of scripts will be broken by new
> notation/constructs, but that utilities to convert old code will be
> available. I'm not too enthusiastic about having to convert all the
> existing code I use or have written. Also, what about all the existing
> modules, etc? 
>  The truth is that I don't know much about what the situation will be
> and am just writing this hoping for reassurance from those that do
> know!

We should take it as new and exciting times approaching. The migration
from Perl5 to Perl6 will be much smoother than from Perl4 to Perl5 some
years ago. We should not forget how many new concepts (scoping, OO to
name just two) had been introduced by this step. It has done no one any
harm. People are anxious since they are used to some of Perl's
peculiarities, yet we will be able to get used to newly introduced ones
(if any). More to that, think about people that will make their first
Perl-steps with Perl6. They will greatly benefit from some of the
re-design.

I am, however, especially curious about all the modules. The core
modules will probably be already ported by the time Perl6 is released,
but the hundreds of other modules certainly not. I think it'll be a
sportif competition amongst the module maintainers to migrate as quickly
as possible. 

Tassilo
-- 
Training is everything.  The peach was once a bitter almond; cauliflower is
nothing but cabbage with a college education.
		-- Mark Twain, "Pudd'nhead Wilson's Calendar"


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

Date: 12 Nov 2001 11:39:12 -0800
From: fabrizio_ravaneli@yahoo.com (fabrizio)
Subject: perl install
Message-Id: <2da5f71e.0111121139.ba048de@posting.google.com>

hi i am getting this error message when i run a perl script called
mauiws_addURI that a developer has written.
Can't locate LWP/UserAgent.pm in @INC (@INC contains:
/usr/local/lib/perl5/5.6.1/aix /usr/local/lib/perl5/5.6.1
/usr/local/lib/perl5/site_perl/5.6.1/aix
/usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl .
/u/dispatch/apps/psl/SCRIPT) at
/u/dispatch/apps/psl/SCRIPT/mauiws_lib.pl line 9.
BEGIN failed--compilation aborted at
/u/dispatch/apps/psl/SCRIPT/mauiws_lib.pl line 9.
Compilation failed in require at mauiws_addURI line 14.


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

Date: Mon, 12 Nov 2001 11:42:17 -0800
From: "Ron Hill" <hillr@ugs.com>
Subject: Re: perl install
Message-Id: <3bf02445$1@usenet.ugs.com>


"fabrizio" <fabrizio_ravaneli@yahoo.com> wrote in message
news:2da5f71e.0111121139.ba048de@posting.google.com...
> hi i am getting this error message when i run a perl script called
> mauiws_addURI that a developer has written.
> Can't locate LWP/UserAgent.pm in @INC (@INC contains:
[snipped]

Hello,

you need to install the LWP bundle from CPAN

Ron Hill




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

Date: Mon, 12 Nov 2001 20:57:42 +0100
From: "Tassilo v. Parseval" <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: perl install
Message-Id: <9sp9jm$348$02$1@news.t-online.com>

On 12 Nov 2001 11:39:12 -0800, fabrizio wrote:
> hi i am getting this error message when i run a perl script called
> mauiws_addURI that a developer has written.
> Can't locate LWP/UserAgent.pm in @INC (@INC contains:

As Ron pointed out, you need LWP::UserAgent. As root (and with a working
network connection) you have to do:

perl -MCPAN -e 'install LWP::UserAgent'

Depending on whether you run the above for the first time, you may get
asked a couple of questions for configuring CPAN. Most of these are
self-explanatory.

Tassilo
-- 
<Knghtbrd> Yorick: no problem with indexed color palettes for images, as
           long as you can pick the palette
<Yorick> Obviously the people creating quake were colour-blind but that
         doesn't mean you have to be


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

Date: Mon, 12 Nov 2001 13:11:43 -0800
From: "jennyw" <donotspam-jen@dangerousideas.com>
Subject: RegEx ack references ... I need a clue
Message-Id: <9spdr9$4r6$1@bob.news.rcn.net>

I'm trying to use regular expressions to match lines that begin with either
"Mailing-List:" or "Sender:" Moreover, I'm trying to capture the text that
immediately follows (the first part of an e-mail address) and assign it to a
variable.

Here is some sample code I'm using to test my regexes with:

$line ='Mailing-List: list ladyfestbayarea@yahoogroups.com; contact
ladyfestbayarea-owner@yahoogroups.com';
$line =~ /(^Mailing-List: list )([^ ]+)@/i;

print "1: $1\n";
print "2: $2\n";
print "3: $3\n";

Output:

1: Mailing-List: list
2: ladyfestbayarea
3:

When I change the regex to: /(^Mailing-List: list)|(^sender:.*)( [^ ]+)@/i,
I get this as output:

1: Mailing-List: list
2:
3:

Where did the third parenthetical set go?  How do I reference it?

Thanks!

Jen




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

Date: Mon, 12 Nov 2001 22:02:47 GMT
From: friedman@math.utexas.edu (Chas Friedman)
Subject: Re: RegEx ack references ... I need a clue
Message-Id: <3bf04679.64960652@news.itouch.net>

On Mon, 12 Nov 2001 13:11:43 -0800, "jennyw"
<donotspam-jen@dangerousideas.com> wrote:

>I'm trying to use regular expressions to match lines that begin with either
>"Mailing-List:" or "Sender:" Moreover, I'm trying to capture the text that
>immediately follows (the first part of an e-mail address) and assign it to a
>variable.
>
>Here is some sample code I'm using to test my regexes with:
>
>$line ='Mailing-List: list ladyfestbayarea@yahoogroups.com; contact
>ladyfestbayarea-owner@yahoogroups.com';
>$line =~ /(^Mailing-List: list )([^ ]+)@/i;
>
>print "1: $1\n";
>print "2: $2\n";
>print "3: $3\n";
>
>Output:
>
>1: Mailing-List: list
>2: ladyfestbayarea
>3:
>
>When I change the regex to: /(^Mailing-List: list)|(^sender:.*)( [^ ]+)@/i,
>I get this as output:
>
>1: Mailing-List: list
>2:
>3:
>
>Where did the third parenthetical set go?  How do I reference it?
>
>Thanks!
>
>Jen
>
Try
$line =~ /(?:(^Mailing-List: list)|(^sender:.*))( [^ ]+)@/;
                                   cf


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

Date: Mon, 12 Nov 2001 23:04:00 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: RegEx ack references ... I need a clue
Message-Id: <s3l0vtc4e48lsosdqjnnff4je7ue1l6j2r@4ax.com>

jennyw wrote:

>$line =~ /(^Mailing-List: list )([^ ]+)@/i;

>When I change the regex to: /(^Mailing-List: list)|(^sender:.*)( [^ ]+)@/i,

Are you the same person? Yup. You're still having problems with
grouping. When you add that alternative, you seem to have forgotten the
fact that the rest of the regex is ONLY attached to the second
alternative. If you want /(^Mailing-List: list)/ as an alternative to
/(^sender:.*)/, your need to group those two. BTW .* doesn't look right
to me, it's too greedy. (And don't you need a backslash in front of that
'@'?)

	/(?:(^Mailing-List: list)|(^sender:.*?))( [^ ]+)\@/i

(untested)

-- 
	Bart.


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

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


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