[22832] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5053 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 28 18:06:04 2003

Date: Wed, 28 May 2003 15:05:09 -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, 28 May 2003     Volume: 10 Number: 5053

Today's topics:
    Re: a Bayesian intelligent e-mail autoresponder? <pkent77tea@yahoo.com.tea>
    Re: About file uploading on win32 platform (Malcolm Dew-Jones)
    Re: Advise Needed (Gilgames)
    Re: better way to do this than a hash? (david)
    Re: better way to do this than a hash? <noreply@gunnar.cc>
    Re: better way to do this than a hash? (Tad McClellan)
    Re: Bioperl? <dragaoon@sappers.no>
    Re: Bioperl? <uri@stemsystems.com>
    Re: DMake (newbie) <nobull@mail.com>
    Re: Doing substitutions in a while loop (while /.../g) <mpapec@yahoo.com>
    Re: Doing substitutions in a while loop (while /.../g) <apollock11@hotmail.com>
    Re: Doing substitutions in a while loop (while /.../g) <nobull@mail.com>
    Re: Expanding a newcommand in latex (Randy Kobes)
        Help: Completely Delete HOH key ($family)?? (Not a Ring (entropy123)
    Re: Help: Completely Delete HOH key ($family)?? (Not a  <nobull@mail.com>
        Help: Elements missing when I pass HoH and Array to sub (entropy123)
    Re: Help: Elements missing when I pass HoH and Array to <noreply@gunnar.cc>
    Re: How does find sort? (Tad McClellan)
    Re: html tables <mpapec@yahoo.com>
        linklint.pl  (website linkchecker) and onclick (zzapper)
    Re: Making Perl scripts executable on Win32 (Steven Danna)
        MIME:Entity Who are you error <b.gaber@pwgsc.gc.ca>
        regular expression help (Christopher Fahey)
    Re: regular expression help <Ben_Vargo@Yahoo.com>
    Re: regular expression help <tzz@lifelogs.com>
    Re: STDOUT print not showing up (Jan)
    Re: STDOUT print not showing up <nobull@mail.com>
        Test SNMP modules <cpan@martin.lorensen.dk>
    Re: uninitialized value in eval block? (Tad McClellan)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 28 May 2003 20:20:03 GMT
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: a Bayesian intelligent e-mail autoresponder?
Message-Id: <pkent77tea-FD4328.21102028052003@dev.rsn.selsyn.co.uk>

In article <6869c57c.0305271849.6c3b8ab2@posting.google.com>,
 larix_occidentalis@yahoo.com (Western Larch) wrote:

> Yeff <yeff@myrealbox.com> wrote:
> > On 26 May 2003 07:03:56 -0700, totojepast wrote:
> > > Please can you tell me if anybody has tried to use ifile or a similar
> > > Bayesian for an automatic e-mail autoresponder?
> > 
> > If I grok what you're trying to do (automatically identify and bounce 
> > spam?) then all I can say is that the concept is *evil*.
> > 
> > "Evil, pure and simple from the eighth dimension!"
> > 
> > You're doubling the amount of traffic generated by the spam and probably 
> > bouncing your messages to bogus addresses (not the people who actually sent 
> > the spam).
> 
> Relax, dude. Why not take the proposal as a springboard for 
> further development? No need to get bent out of shape.
> 
> How about this: instead of replying to every apparent spam message,
> reply only to the ones which look like they might possibly be non-spam.
> So if every message is assigned a score, and the scores above a 
> threshold are thrown out as spam, then messages near but just above
> the threshold would merit a reply.

That sounds pretty good. Another approach (maybe covered elsewehere in 
this thread) is to have your MTA return a 500 code to the sender when a 
spam is detected. I expect this ends up generating return messages of 
some kind, somewhere, and some of those might be to bogus addresses. 
Other people set up their MTA to simply dev-null spam. It's a hard 
problem to solve, given the way email works. I know many people who love 
SpamAssassin though (which is perl I think)

P

-- 
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply


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

Date: 28 May 2003 10:21:06 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: About file uploading on win32 platform
Message-Id: <3ed4f002@news.victoria.tc.ca>

Roman Khutkyy (beromko@yahoo.com) wrote:
: I'm trying to test the script that uploads file( .jpeg .gif) from user
: mashine to server on Windows XP. And i've read in wise books that file
: (data) sent through multipart/form-data form will be in Perl's STDIN - but
: when i try to print the content of STDIN i get an empty string. Can anybody
: tell how to fetch the data from miltipart fom?

From "multipart/form-data" this sounds like a CGI program, where the user
sends the data using an HTML form.

The perl program should use the CGI module

Read perldoc CGI



	#!perl

	use CGI -various-options-can-go-here ;



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

Date: 28 May 2003 20:35:10 GMT
From: gilgames@aol.coma (Gilgames)
Subject: Re: Advise Needed
Message-Id: <20030528163510.14936.00000475@mb-m14.aol.com>

<<

1. Can I get my hands on a free Perl set of software so as to learn the
ropes, if not, whats the best package for a low-end user (as
in...needs/wants a few functions but does not know where to start)
2. If there is a good range to choose from, what should I aim for as a
beginner
3. Any other useful tips you may have
>>

1./ Perl is free. http://perl.com

2./ Go to the local library, check out the available perl books, find the one
which fits to you, and go over of it


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

Date: 28 May 2003 12:50:41 -0700
From: dwlepage@yahoo.com (david)
Subject: Re: better way to do this than a hash?
Message-Id: <b09a22ae.0305281150.27c51ede@posting.google.com>

Winfried Koenig <w.koenig@acm.org> wrote in message news:<3ED3E225.6000102@acm.org>...
> david wrote:
> > 	#If the line contains a token reference
> > 	if (/\.TOK\.0/) {
> > 		         foreach $key (keys(%uid)) {
> >                                 $search = $key;
> >                                 $replace = $uid{"$key"};
> >                                 s/$search/$replace/g;
> > 				#exit foreach once matched
> >                                 next;
> >                 }
> >                 #Next comes here
> >                 
> >                 s/(DG\-)|(STII\-)|(S\/N\:)//g;
> >         }
> 
> the foreach loop may be your main problem. Is it possible
> to replace the loop with something like:
> 
>      s/\b(\w+\.TOK\.0)/ $uid{$1} || $1/eg;
> 
> Winfried Koenig

Thanks for all of the advice. I do have a few additional q's related -

I understand that this line "$keyname = length $1 > 0 ?  "$1.TOK.0" :
'';
" checks for the value of the keyname being 'non-null' but what does
the ? do in this line?

Thanks!


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

Date: Wed, 28 May 2003 21:53:24 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: better way to do this than a hash?
Message-Id: <bb34qr$58q97$1@ID-184292.news.dfncis.de>

david wrote:
> I understand that this line
> "$keyname = length $1 > 0 ?  "$1.TOK.0" : '';"
> checks for the value of the keyname being 'non-null' but what does
> the ? do in this line?

http://www.perldoc.com/perl5.8.0/pod/perlop.html#Conditional-Operator

/ Gunnar

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



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

Date: Wed, 28 May 2003 16:19:55 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: better way to do this than a hash?
Message-Id: <slrnbda9vr.1qv.tadmc@magna.augustmail.com>

david <dwlepage@yahoo.com> wrote:


> I understand that this line "$keyname = length $1 > 0 ?  "$1.TOK.0" :
> '';


It has the same effect as:

   if ( length $1 > 0 )
      { $keyname = "$1.TOK.0" }
   else
      { $keyname = '' }


> " checks for the value of the keyname being 'non-null' but what does
> the ? do in this line?


Provide a value that is to be assigned when the condition is "true".


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


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

Date: Wed, 28 May 2003 08:16:47 -0700
From: "Bertt" <dragaoon@sappers.no>
Subject: Re: Bioperl?
Message-Id: <bb2k41$7qt$1@news.astound.net>

entropy123 wrote:
>> Haven't you asked this question a couple of times already?
>>
>>
>>
>> Abigail
>
> Abigail,
>
> Yes and no. I've not tried the Bioperl route so far. The Graph module
> on CPAN may/may not be sufficient for my needs - right now I think its
> not....so I decided to see if there is a 'BioPerl' module which I can
> implement.

Don't worry too much about abby, she/he/it used to be a real helpful person
around here before sliding down the abyssful trollistic ceaspit ;p

Really though, I've never seen your previous question answered, and it has
been a while so there absolutely no harm in asking again in a different way.
Don't let adigail push you way either ;p

--
Bertt




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

Date: Wed, 28 May 2003 15:50:23 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Bioperl?
Message-Id: <x7n0h7hxz8.fsf@mail.sysarch.com>

>>>>> "B" == Bertt  <dragaoon@sappers.no> writes:

  >> Abigail,
  >> 
  >> Yes and no. I've not tried the Bioperl route so far. The Graph module
  >> on CPAN may/may not be sufficient for my needs - right now I think its
  >> not....so I decided to see if there is a 'BioPerl' module which I can
  >> implement.

  B> Don't worry too much about abby, she/he/it used to be a real
  B> helpful person around here before sliding down the abyssful
  B> trollistic ceaspit ;p

that last phrase is more like moronzilla style. calling abigail a troll
is a good ans ure way to get most regulars to killfile you. now who is
the troll?

  B> Really though, I've never seen your previous question answered, and
  B> it has been a while so there absolutely no harm in asking again in
  B> a different way.

  B> Don't let adigail push you way either ;p

and your very helpful answer is? not much perl content here. and abigail
did discuss graph stuff and modules with the OP. i don't see much
pushing away. you have much to learn and i doubt you will learn it here.

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: 28 May 2003 18:20:11 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: DMake (newbie)
Message-Id: <u9of1n7zuc.fsf@wcl-l.bham.ac.uk>

"Daniel L Newhouse" <daniel_newhouse@earthlink.net> writes:

> Subject: Re: DMake (newbie)
                     ^^^^^^^^
> I want to build version 5.8.0 of Perl on Win98SE using Visual C++ 6.0 SP 5
> and version 4.1 of dmake.

My advice is don't.

If you consider yourself a newbie you shouldn't be trying to build
Perl on Windows.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Wed, 28 May 2003 17:16:12 +0200
From: Matija Papec <mpapec@yahoo.com>
Subject: Re: Doing substitutions in a while loop (while /.../g)
Message-Id: <r7k9dvklqap6nj0ikeh242be9neleg2n3c@4ax.com>

X-Ftn-To: Arvin Portlock 

Arvin Portlock <apollock11@hotmail.com> wrote:
> >>     ## Here, somehow replace $1 with $subst_val
> >> }
>
>    $text =~ s/<!-- ([^<>]+) -->/ '<!-- ' . pop(@array) . ' -->' /ge;
>
>Hmmm, so if I want to do something more complicated than
>pop ()--much more complicated as is generally the case--I can
>use a subroutine:
>
>$text =~ s/<!--([^<>]+)-->/'<!--' . &complicated_sub($1) . '-->'/ge;
>
>This never occurred to me. Thanks! This is a pretty useful tool
>for me to be adding to my arsenal.

You can also do nested substitution but this is rarely needed.

$text =~ s{<!--([^<>]+)-->}{

  my $foo = $1;
  $foo =~ s{....}{
    #do_something
  }e;

  '<!--' . &complicated_sub($foo) . '-->';
}ge;



-- 
Matija


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

Date: Wed, 28 May 2003 09:17:02 -0700
From: Arvin Portlock <apollock11@hotmail.com>
Subject: Re: Doing substitutions in a while loop (while /.../g)
Message-Id: <bb2nk5$bt$1@agate.berkeley.edu>

> $text =~ s/<!--([^<>]+)-->/'<!--' . &complicated_sub($1) . '-->'/ge;
>
> Yes.
>
> (but don't use the ampersand on function calls, see perlsub.pod)

Is there harm in using the amperand? Or is it just the perl way?
Don't I have to predeclare my subroutines in order to skip the
ampersand?



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

Date: 28 May 2003 18:18:15 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Doing substitutions in a while loop (while /.../g)
Message-Id: <u9smqz7zxk.fsf@wcl-l.bham.ac.uk>

Arvin Portlock <apollock11@hotmail.com> writes:

> > $text =~ s/<!--([^<>]+)-->/'<!--' . &complicated_sub($1) . '-->'/ge;
> >
> > Yes.
> >
> > (but don't use the ampersand on function calls, see perlsub.pod)
> 
> Is there harm in using the amperand?

Only if the function has a prototype and you don't want to disable it.
Most functions don't have prototypes so if you get into the habit of
always pointlessly disabling them it won't cause harm - until that is
you happen to want to use a function that does have a prototype.  You
will then forget to not disable the prototye and your code will not
work as expected.

> Don't I have to predeclare my subroutines in order to skip the
> ampersand?

No.  You only have to predeclare your subroutines if they have
prototypes or if you want to call them without either & or ().


-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 28 May 2003 16:55:35 GMT
From: randy@theoryx5.uwinnipeg.ca (Randy Kobes)
Subject: Re: Expanding a newcommand in latex
Message-Id: <slrnbd9pmc.i19.randy@theoryx5.uwinnipeg.ca>

On Wed, 28 May 2003 16:29:28 +0200, 
   Michele Dondi <bik.mido@tiscalinet.it> wrote:
>On 24 May 2003 07:15:40 +0200, gnalle@ruc.dk (Niels L. Ellegaard)
>wrote:
>
>>When I write latex I make frequent use of newcommands such as
>>\newcommand{\pt}[3]{\left(\frac{\partial#2}{\partial#1}\right)_{#3}}
>>
>>Sadly I have problems if I wish to share my tex-file with other
>>people. Therefore I am looking for a perlscript that can produce a new
>
>This is utter nonsense. I've never heard of anyone having problems
>sharing LaTeX docs because of a \newcommand.

This is getting off topic, but there are a few
legitimate reasons to want to expand \newcommand:

- some latex to xxx converters don't handle \newcommand
directives well, but work just fine when these are expanded;

- some journals which accept LaTeX submissions, for their
own reasons, have a policy of not wanting \newcommand
definitions in the file (this may be related to the previous 
reason).

- some people prefer not to have \newcommands, so that
copying blocks of LaTeX code from one document to another 
is easier.

-- 
best regards,
randy kobes


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

Date: 28 May 2003 09:34:51 -0700
From: email_entropy123@yahoo.com (entropy123)
Subject: Help: Completely Delete HOH key ($family)?? (Not a Ring/Cycle Question :) )
Message-Id: <90cdce37.0305280834.567045fe@posting.google.com>

Hey all,

Ok, I have a %HoH{}{} and in my code:

%copy{}{} = %HoH{}{};

According to my own criteria I want to delete $copy{$x}{$y} ...in
other words I want no reference to the fact that $copy{$x}{$y} ever
extisted or that there was a relationship between $x and $y. so:

delete $copy{$family}{$role};

However when I print out my %copy{}{} the $copy{$family}{$role} value
is gone and so is the relationship but $family is still part of the
output even if there are no longer any $role assigned to it in the
hash.

And my printing subroutine (straight from CPAN):
sub print_hash {
    my (%HoH) = @_;
    my $family, $role;
	foreach $family ( keys %HoH ) {
	    print "$family: { ";
	    for $role ( keys %{ $HoH{$family} } ) {
		print "$role=HoH{$family}{$role} ";
	    }
	    print "}\n";
	}
}



Here is a snippet of the output:

O20: { P19=HoH{O20}{P19} P23=HoH{O20}{P23} }
C16: { C11=HoH{C16}{C11} O18=HoH{C16}{O18} }
N15: { }
O21: { }

N15 and O21 no longer have any $role elements assigned to them, yet
they still print out. I guess my question boils down to how to delete
$family elements when there is no longer a $role attached to that
family, but keep $family if there is still a $role besides the one I
just deleted...

Thanks!

entropy


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

Date: 28 May 2003 17:59:30 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Help: Completely Delete HOH key ($family)?? (Not a Ring/Cycle Question :) )
Message-Id: <u9znl780st.fsf@wcl-l.bham.ac.uk>

email_entropy123@yahoo.com (entropy123) writes:

> delete $copy{$family}{$role};

>                     ... my question boils down to how to delete
> $family elements when there is no longer a $role attached to that
> family, but keep $family if there is still a $role besides the one I
> just deleted...

I think you just managed to boil your question down to the point at
which it becomes self-answering.

delete $copy{$family}{$role};
delete $copy{$family} unless %{$copy{$family}};

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 28 May 2003 12:25:30 -0700
From: email_entropy123@yahoo.com (entropy123)
Subject: Help: Elements missing when I pass HoH and Array to subroutine at same time...
Message-Id: <90cdce37.0305281125.57f34154@posting.google.com>

Hey all,

Ok, have a repetitive task and am working on building a subroutine....

$value = hoh_pass(%suphoh,@array); #I pass the HOH and the array to
the sub

sub hoh_pass {
  my (%HoH, @ret) = @_;  
  &print_hash(%HoH); #printing out the HOH results in missing
elements?

}

Now, HOH and @ret have elements in common and some of those elements
go missing when I pass them to the sub...

Any advice? perldoc and the rest don't seem to have this one...

Thanks!
entropy


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

Date: Wed, 28 May 2003 21:21:27 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Help: Elements missing when I pass HoH and Array to subroutine at same time...
Message-Id: <bb32ur$5cipq$1@ID-184292.news.dfncis.de>

entropy123 wrote:
> Ok, have a repetitive task and am working on building a subroutine....
> 
> $value = hoh_pass(%suphoh,@array); #I pass the HOH and the array to
> the sub
> 
> sub hoh_pass {
>   my (%HoH, @ret) = @_;  
>   &print_hash(%HoH); #printing out the HOH results in missing
> elements?
> 
> }
> 
> Now, HOH and @ret have elements in common and some of those elements
> go missing when I pass them to the sub...
> 
> Any advice? perldoc and the rest don't seem to have this one...

They sure have. See for instance 
http://www.perldoc.com/perl5.8.0/pod/perlsub.html#Pass-by-Reference

/ Gunnar

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



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

Date: Wed, 28 May 2003 16:22:15 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: How does find sort?
Message-Id: <slrnbdaa47.1qv.tadmc@magna.augustmail.com>

Sherman Willden <sherman.willden@hp.com> wrote:

> Thanks, John. 


John who?


> You're reply is very helpful


What did he say that was helpful?


It is customary to quote a bit of text (and provide attribution)
when you are going to comment on it.


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


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

Date: Wed, 28 May 2003 19:31:36 +0200
From: Matija Papec <mpapec@yahoo.com>
Subject: Re: html tables
Message-Id: <hjp9dvo9bvhpb4njpn1iinjte685t2d9ao@4ax.com>

X-Ftn-To: Ron Savage 

"Ron Savage" <ron@savage.net.au> wrote:
>> I'm not in position to use additional modules, but I'll take a look at
>CPAN.
>> Do you have some favorite module?
>
>HTML::TreeBuilder is a fine module.


Looks interesting.. why do you use empty foreach loop in find_nested_content
and why nearby sub is always returning zero?


>-----><8-----
>#!/usr/bin/perl
>#
># Name:
># test-html-treebuilder.pl.
>#
># Author:
># Ron Savage
># http://savage.net.au/index.html.
>
>use strict;
>use warnings;
>
>use HTML::TreeBuilder;
>
># -----------------------------------------------
>
>sub find_nested_content
>{
> my($root) = @_;
>
> print "Looking for nested content. \n";
> print "\n";
>
> my($first_tr, $last_tr);
>
> for ($root -> look_down(
> sub
> {
>  # Find the 1st & last <tr>s, so we can report them.
>
>  return 0 if ($_[0] -> tag() ne 'tr');
>
>  (! $first_tr) && ($first_tr = $_[0]);
>
>  $last_tr = $_[0];
>
>  return 0;
> }))
> {
> }
>
> print "Text of 1st tr in nested table:  ", $first_tr -> as_text(), ". \n"
>if ($first_tr);
> print "\n";
> print "Text of last tr in nested table: ", $last_tr -> as_text(), ". \n" if
>($last_tr);
> print "\n";
>
>} # End of find_nested_content.



-- 
Matija


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

Date: 28 May 2003 12:44:44 -0700
From: david@tvis.co.uk (zzapper)
Subject: linklint.pl  (website linkchecker) and onclick
Message-Id: <f677762.0305281144.6927ab6@posting.google.com>

Hi,

http://www.linklint.org/

Linklint hasnt been updated since aug 2001.

Does anyone know the tool well enough to suggest how I can modify the
above to recognise links of the type

onClick="window.location.href='store/wigs.html'"

zzapper
--

vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"

http://www.vim.org/tips/tip.php?tip_id=305  Best of Vim Tips


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

Date: 28 May 2003 13:50:33 -0700
From: MissingWords@hotmail.com (Steven Danna)
Subject: Re: Making Perl scripts executable on Win32
Message-Id: <e78d8c5a.0305281250.526217ee@posting.google.com>

experiment62002@yahoo.com (John) wrote in message news:<803d536c.0305271712.26b69bfc@posting.google.com>...
> I've just installed Perl 5.8 on a machine running Windows XP Home, and
> right now I have to explicitly call Perl (e.g. C:\> perl script.pl) to
> execute a script.  Just typing the name of the script opens the file
> in Notepad, which I assume is the default action.  I was hoping to
> find out how to make my Perl scripts exectable, preferably
> system-wide, or at the very least if there is something akin to "chmod
> 755" that I can use on individual files.  Thanks.


   This is actually fairly easy to do.  First of all, if you use the
ActiveState perl distribution it will do this automatically for you. 
But if you need to do it yourself simply add perl to your PATH
variable.  Doing this is simple:

1. Goto the Control Panel
2. Goto System (if you are in category view, system is in the
Performance and Maintenance Category)
3. Select the advanced tab
4. Click the Enviromental Variable Buttons
5. Select Path in the system variables scroll box
6 Click edit
7. add the path of perl.exe(usually C:\Perl\bin\) followed by a
semicolon.  Be sure to add the path after the final simicolon in the
edit field. So usually it would look like this: ...[bunch of other
paths];C:\Perl\bin\;

Steven Danna


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

Date: Wed, 28 May 2003 11:16:08 -0400
From: Brian <b.gaber@pwgsc.gc.ca>
Subject: MIME:Entity Who are you error
Message-Id: <3ED4D2B8.9D58E408@pwgsc.gc.ca>

I am trying to get MIME::Entity on a Linux v8, Perl v5.8.0 system.  I
have been successful in getting this working on several AIX servers in
the past.  I have installed the required modules and try to test with
this simple script:

#!/usr/bin/perl

$emailAdmin = "brian.gaber\@myorgsdomainname";
$subject = "Test";

&sndMail ($emailAdmin, $subject);

sub sndMail {

   use MIME::Entity;

   my $email = $_[0];
   my $hostname = "email_test";

for ($i=0;$i<=10;$i++) {
   $loop[$i] = "Index = $i\n";
}

   # Create the top-level, and set up the mail headers:
   $top = build MIME::Entity Type     => "text/plain",
                             Encoding => "quoted-printable",
                             Data     => "@loop",
                            -From     => $hostname,
                            -To       => $email,
                            -Subject  => $_[1];

   # Message is ready to send, send using sendmail

   open SENDMAIL, "|sendmail -t";
   $top->print(\*SENDMAIL);
   close SENDMAIL;
}

The system responds with this message:

Who are you:  Permission Denied.

Thanks for assistance.



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

Date: 28 May 2003 08:20:08 -0700
From: ChristopherFahey@mad.scientist.com (Christopher Fahey)
Subject: regular expression help
Message-Id: <6f1fbcb7.0305280720.56a9a747@posting.google.com>

i am working on a pattern to break out last names from a full name
that will work with patronymic and multi-word last names.  It works
fine for regular full names and names that are patronymic but has
problems when the name has the initials for the first and middle name
with or without the patronymic attribute.  can anyone take a look at
what i have here and give me a suggestion on what to fix?

for instance it can handle "martin st. louis" and "elmer jay fudd"
correctly but has problems with "b. j. thomas".


(.+\.?\b)((A'|A[fgiklmnprsuz]|Au[sx]|Ben|D'|Da|Dal|Dall'|D
ell'|Dalla|Dalle|Das|De|Dela|De la|De
Los|Dei|Del|Dello|Degli|De[norstu]|Di|Di[a
e]|Dos|Een|Ene|Ei|Ein|Eine|Eit|El|Els|En|Et|Ett|Gl|Gli|H[aein]|Hai|Heis|Hen|Het|
Hin|Hinar|Hinir|Hinn|Hoi|Im|Isa|Ka|Ke|L'|L[aeilou]|Las|Les|Lhi|Lis|Los|Lou|Mia|N
[ai]|Nje|Ny|O'|'O|Oi|Os|San|Si|St\.?|'T|Ta|Te|Ten|Ter|To|Um|Uma|Un|Un[aeos]|Us|V
an|Van de|Van den|Van der|Ver|Vom|Von|Von den|Von der|Von
zu|Ye|Yn|Yr|Zu|Zu[mr]|
[A-Z]{2,}\-|[A-Z]{1,}\')?\s+\w{2,})


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

Date: Wed, 28 May 2003 16:07:30 -0400
From: "The_Shadow" <Ben_Vargo@Yahoo.com>
Subject: Re: regular expression help
Message-Id: <bb34u7$7o8$1@mailgate2.lexis-nexis.com>

Not sure exactly what you are trying to accomplish but I think you want to
break the name into it's inidividual parts?
Try this code:

my $name = "b. j. thomas JR";

my @line = split (/\s+/, $name);
if (! $line[2]) {
$name = "$line[1],$line[0]";
} elsif (! $line[3]) {
$name = "$line[2],$line[0] $line[1]";
} else {
$name = "$line[2] $line[3],$line[0] $line[1]";
}
print "$name\n";

The_Shadow
E-Mail: Ben_Vargo@Yahoo.com

"Christopher Fahey" <ChristopherFahey@mad.scientist.com> wrote in message
news:6f1fbcb7.0305280720.56a9a747@posting.google.com...
> i am working on a pattern to break out last names from a full name
> that will work with patronymic and multi-word last names.  It works
> fine for regular full names and names that are patronymic but has
> problems when the name has the initials for the first and middle name
> with or without the patronymic attribute.  can anyone take a look at
> what i have here and give me a suggestion on what to fix?
>
> for instance it can handle "martin st. louis" and "elmer jay fudd"
> correctly but has problems with "b. j. thomas".
>
>
> (.+\.?\b)((A'|A[fgiklmnprsuz]|Au[sx]|Ben|D'|Da|Dal|Dall'|D
> ell'|Dalla|Dalle|Das|De|Dela|De la|De
> Los|Dei|Del|Dello|Degli|De[norstu]|Di|Di[a
>
e]|Dos|Een|Ene|Ei|Ein|Eine|Eit|El|Els|En|Et|Ett|Gl|Gli|H[aein]|Hai|Heis|Hen|
Het|
>
Hin|Hinar|Hinir|Hinn|Hoi|Im|Isa|Ka|Ke|L'|L[aeilou]|Las|Les|Lhi|Lis|Los|Lou|M
ia|N
>
[ai]|Nje|Ny|O'|'O|Oi|Os|San|Si|St\.?|'T|Ta|Te|Ten|Ter|To|Um|Uma|Un|Un[aeos]|
Us|V
> an|Van de|Van den|Van der|Ver|Vom|Von|Von den|Von der|Von
> zu|Ye|Yn|Yr|Zu|Zu[mr]|
> [A-Z]{2,}\-|[A-Z]{1,}\')?\s+\w{2,})




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

Date: Wed, 28 May 2003 17:00:42 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: regular expression help
Message-Id: <4nisrueqh1.fsf@marley.bwh.harvard.edu>

On 28 May 2003, ChristopherFahey@mad.scientist.com wrote:
> i am working on a pattern to break out last names from a full name
> that will work with patronymic and multi-word last names.  It works
> fine for regular full names and names that are patronymic but has
> problems when the name has the initials for the first and middle
> name with or without the patronymic attribute.  can anyone take a
> look at what i have here and give me a suggestion on what to fix?
> 
> for instance it can handle "martin st. louis" and "elmer jay fudd"
> correctly but has problems with "b. j. thomas".
> 
> 
> (.+\.?\b)((A'|A[fgiklmnprsuz]|Au[sx]|Ben|D'|Da|Dal|Dall'|D
> ell'|Dalla|Dalle|Das|De|Dela|De la|De
> Los|Dei|Del|Dello|Degli|De[norstu]|Di|Di[a
> e]|Dos|Een|Ene|Ei|Ein|Eine|Eit|El|Els|En|Et|Ett|Gl|Gli|H[aein]|Hai|Heis|Hen|Het|
> Hin|Hinar|Hinir|Hinn|Hoi|Im|Isa|Ka|Ke|L'|L[aeilou]|Las|Les|Lhi|Lis|Los|Lou|Mia|N
> [ai]|Nje|Ny|O'|'O|Oi|Os|San|Si|St\.?|'T|Ta|Te|Ten|Ter|To|Um|Uma|Un|Un[aeos]|Us|V
> an|Van de|Van den|Van der|Ver|Vom|Von|Von den|Von der|Von
> zu|Ye|Yn|Yr|Zu|Zu[mr]| [A-Z]{2,}\-|[A-Z]{1,}\')?\s+\w{2,})

"j." does not match anything in your second group.

I'd recommend something like Parse::RecDescent for patterns that are
this complex.  With Parse::RecDescent, you could have simple,
understandable rules that combine into a single rule.  P::RD supports
the Perl regular expression syntax inside its rules, so you don't have
to learn a new syntax to use it.  For something like your example, you
would do (untested, see the P::RD docs, this is just to show you the
general syntax and design you could use):

name: first inter last # this is your top rule
first: initial(s) || name # using the (s) modifier on a rule means 1..n
last: multi_name || initial(s) || name
inter: patronymic(s) || initial(s) || name

patronymic: /Au[sx]/ || /Ben/ || ...etc...

name: /.+\b/ # or \S+
initial: /[A-Za-z]\./
multi_name: ...your design...

You seem to have different rules for first and last names (any
character for the first, vs. \w for the last), and the names are very
European-centric, but I'm sure you know what you're doing :)

Ted


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

Date: 28 May 2003 10:17:27 -0700
From: jan_buys@hotmail.com (Jan)
Subject: Re: STDOUT print not showing up
Message-Id: <11971c2c.0305280917.5fbaec3c@posting.google.com>

A bit more info on this problem :

As suggested I used 'use warnings;', but that didn't help.

But my problem seems to be solved when I use STDERR as output device. 
Cool, but not enough... it's dirty.  So might something be 'blocking'
STDOUT ?  Any hints or references to the right manpages may help.

By the way.  Setting $| to a true value doesn't do the trick either.

Jan


jan_buys@hotmail.com (Jan) wrote in message news:<11971c2c.0305270934.1d337c62@posting.google.com>...
> Hello,
> 
> Feeling a bit newbie here for asking such stupid question.
> 
> I have a problem when printing to a default STDOUT command-line
> window.  What I basically do is print a bunch of info to STDOUT and in
> the end I ask a question to the user of the script.  (I use the normal
> print command and some HERE documents for that).
> 
> Problem is : the text is not showing up in the console (normal cmd.exe
> console) and the script just waits for an answer to the question
> (which, of course, is not visible).  Only when I answer it, all text
> output that should have been printed prior to waiting for answer is
> printed.  Not quite userfriendly, unless you're clairvoyant, which
> most common users are not.
> 
> I've been looking at the code for hours and at exactly similar scripts
> I made in the past, but I cannot find the problem.  Does this ring a
> bell somewhere ?
> 
> Thanks for any answer you might come up with,
> Jan
> 
> info : I'm using Activeperl 5.6.x for w32 and CQperl (5.0.x something)
> for these scripts.  OS is W2k Pro


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

Date: 28 May 2003 18:24:20 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: STDOUT print not showing up
Message-Id: <u9k7cb7znf.fsf@wcl-l.bham.ac.uk>

jan_buys@hotmail.com (Jan) vomits TOFU:

> A bit more info on this problem :
> 
> As suggested I used 'use warnings;', but that didn't help.
> 
> But my problem seems to be solved when I use STDERR as output device. 
> Cool, but not enough... it's dirty.  So might something be 'blocking'
> STDOUT ?  Any hints or references to the right manpages may help.

Please produce a _minimal_ but _complete_ script that you have actually
run and found to produce the symptoms you describe and post it here
unaltered.

Please do not top-post - it is considered rude.

These hints and many more can be found in the posting guidelines.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Wed, 28 May 2003 20:14:27 +0200
From: "Martin Lorensen" <cpan@martin.lorensen.dk>
Subject: Test SNMP modules
Message-Id: <n%6Ba.3216$Wm.176@news.get2net.dk>

Hi!

I am writing some modules/scripts which I would like to test. The problem is
that they do SNMP request to external equipments that's not always there -
at least not if this is distributed later e.g.. using CPAN.

Is there a simple way for the test-script to fork a perl snmpd which could
emulate the right responses to the right requests? I haven't been able to
find anything like that in the Net::SNMP and SNMP modules.

I thought about something reverse of Net::Daemon::Test specialized for
SNMP....

Any ideas?

Regards,
 Martin Lorensen




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

Date: Wed, 28 May 2003 16:33:01 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: uninitialized value in eval block?
Message-Id: <slrnbdaaod.1qv.tadmc@magna.augustmail.com>

SeeMySig <spam.me.senseless@sitting.duck> wrote:
> In the process of removing all warning violations from my CGI script, I 
> find the following gets passed during warningsToBrowser(1):
> 
><!-- warning: Use of uninitialized value in concatenation (.) or string 
> at (eval 18) line 32. -->
> 
> Lines 18 is: use strict;


There was no mention of line 18, so I don't know why you are are
showing us line 18.


> Line 32 is: $ENV{PATH} = "/bin:/usr/sbin"; # to keep -T happy!


Is that line 32 in your program or the 32nd line in the 18th eval()
that your program does?

If the former, then I don't know why you are showing us that one either.


> so they are unlikely culprits, 


Yes, especially since they have nowhere been implicated as the culprits. :-)


> The question is, where do I look for the source of the violation in eval 
> 18 line 32?


step 1) determine what the 18th eval() is that your program is evaluating.

step 2) count in that eval to the 32nd line.

step 3) look for undef values near there


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


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

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


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