[25032] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7282 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 21 14:08:01 2004

Date: Thu, 21 Oct 2004 11:05:05 -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           Thu, 21 Oct 2004     Volume: 10 Number: 7282

Today's topics:
        case INsensitive regular expressions (sabinosa)
    Re: How do I print http 404 not found header? <noreply@gunnar.cc>
    Re: How do I print http 404 not found header? lesley_b_linux@yahoo.co.yuk
    Re: How do I print http 404 not found header? <flavell@ph.gla.ac.uk>
    Re: How do I print http 404 not found header? lesley_b_linux@yahoo.co.yuk
    Re: How do I print http 404 not found header? lesley_b_linux@yahoo.co.yuk
    Re: How to I get an user email address, if I know the d <nobull@mail.com>
    Re: How to I get an user email address, if I know the d (Mav)
        How to redefine warnings on recursion level (Gerhard M)
    Re: How to redefine warnings on recursion level <mritty@gmail.com>
    Re: Mail::Sender - Attaching output from pipe <noreply@gunnar.cc>
    Re: Meaning of "Malformed UTF-8 character"? <elektrophyte-yahoo>
    Re: Meaning of "Malformed UTF-8 character"? <flavell@ph.gla.ac.uk>
    Re: Net::FTP and Passive mode problems <spamtrap@dot-app.org>
    Re: perl to english <mritty@gmail.com>
    Re: perl to english <ioneabu@yahoo.com>
    Re: Regex, how do I replace quotation pairs into <LI> & (Gerhard M)
    Re: Regular Expression for HTML Tags and Special Charac <tadmc@augustmail.com>
        Remote Permissions Problem <dsgSPAMFILTER@alum.dartmouth.org>
    Re: source a config file <mritty@gmail.com>
    Re: source a config file <nobull@mail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 21 Oct 2004 10:05:27 -0700
From: maurof78@aol.com (sabinosa)
Subject: case INsensitive regular expressions
Message-Id: <e2d435fa.0410210905.14d25ea9@posting.google.com>

Hi everyone,
  I am working with a RegularExpressionValidator in Visual Studio.NET.
I would like to define a custom regular expression that ignores the
letter case and therefore is case INsensitive.  I have seen that the
syntax might be something like "(?i)" or "/i".  However, when I try to
use that as part of my regular expression (ex.  (?i)^(CSV|ZIP|TXT)$)
the result is a javascript error.  The error says:  "Syntax error in
regular expression"
(^(CSV|ZIP|TXT)$/i does not work)

Any idea what I am doing wrong?  Thanks in advance for your responses!


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

Date: Thu, 21 Oct 2004 18:15:26 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How do I print http 404 not found header?
Message-Id: <2tq6buF22rmoaU1@uni-berlin.de>

Tad McClellan wrote:
> This is already being done, but it only works if they actually
> read the Posting Guidelines.

The likelihood for that would increase if the link to the web page with 
the guidelines was appended to each message.

( I have suggested that before, and you turned me down, Tad. Just 
wondering if you have changed your mind. ;-) )

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


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

Date: 21 Oct 2004 18:12:11 +0100
From: lesley_b_linux@yahoo.co.yuk
Subject: Re: How do I print http 404 not found header?
Message-Id: <m3ekjst2qc.fsf@helmholtz.local>

Tad McClellan <tadmc@augustmail.com> writes:

> lesley_b_linux@yahoo.co.yuk <lesley_b_linux@yahoo.co.yuk> wrote:
> > "Alan J. Flavell" <flavell@ph.gla.ac.uk> writes:
> 
> >> With respect, one -is- supposed to familiarise oneself with the 
> >> relevant Perl FAQs before posting here (see the regular "posting 
> >> guidelines" which appear here). 
> 
> > Fair comment about familiarising oneself with the FAQ's.
> > 
> > I would like a pointer being published in this NG, 
> 
> 
> Have you see the Posting Guidelines that Alan referred you to?

With respect the URL Alan posted me to was one about CGI in FAQ 9 which itself
contains further CGI URLs one of which Alan also referred me to.

FAQ 2 on the other hand contains information about newsgroups on the web but
it does not contain posting guidelines.
> 
> 
> > either monthly or
> > fortnightly 
> 
> 
> The guidelines are posted here twice each week.
I must have missed it then.  Under what subject line?  I can see the stats posting
with subject line "Statistics for comp.lang.perl.misc".  Via google I've been
able to go through the subject headers of the previous week's posts. (14th Oct
to 21st Oct) .  I haven't found anything yet that mentions Posting Guidelines
in the subject line yet or anything other text that makes me think the message
contains a posting guideline for this NG.

I can also see the FAQ: articles which seem to be posts of the individual Perl
FAQ items, and which appear to be under review.

Just to make sure we are clear on this and not talking about different things,
can we differentiate between the Perl FAQ (which, imho, is a FAQ or set of FAQs
about the language) and Posting guidelines for comp.lang.perl.misc ?

Putting comp.lang.perl.misc into google gives some URLs which give posting
guidelines the URL of which was previously posted this week in this NG by
myself elsewhere.  In fact it's a document I am sure you are well aware of.
(http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.text)

> 
> 
> > to the URL http://www.perldoc.com/perl5.8.0/pod/perlfaq.html and
> 
> 
> Why make them go out on the 'net when the same data is already
> on their very own disk?
> 
> 
> > perhaps also saying " Use any or all of 'man perl', 'man perlfaq', 'man
> > perldoc' 
> 
> 
> Those only work on some operating systems so they will ADD to
> the confusion of those that don't have "man".
> 
> A general-purpose OS-agnostic pointer is better.

I agree and I did point out that weakness in my suggestions in my previous
post.
> 
> 
> > and 'perldoc perldoc' to view up to date information that comes with
> > your distribution."
> 
> 
> The Posting Guidelines already say that.

As far as I can tell at the moment there hasn't been a post of the posting
guidelines this week.  I'll go back a few more weeks in the archive if I have
to and will let you know when I find the last post of the Posting Guidelines.
 
<snip>
> This is already being done, but it only works if they actually
> read the Posting Guidelines.

When I have found the ones that are posted *here* bi-weekly I'll read them.
At the moment the only posting guidelines I have are the ones you wrote,
URL already quoted, and which I hope are the same.

Regards

L.


P.S.  Just in case, posting the guidelines twice after reading this post or
just after having posted the post I am replying to, just won't do. ;-)


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

Date: Thu, 21 Oct 2004 18:14:07 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: How do I print http 404 not found header?
Message-Id: <Pine.LNX.4.61.0410211805360.2773@ppepc56.ph.gla.ac.uk>

On Thu, 21 Oct 2004, Tad McClellan wrote:

> > "Alan J. Flavell" <flavell@ph.gla.ac.uk> writes:
> 
> > to the URL http://www.perldoc.com/perl5.8.0/pod/perlfaq.html and
> 
> Why make them go out on the 'net when the same data is already
> on their very own disk?

I don't disagree with that idea.  I'm always in a bit of a quandry 
when citing an FAQ in postings here.  At least I know that a URL will 
be recognised as a web URL, and that (in the above form) it will point 
to the specific version of the FAQ that I had in mind, no matter which 
version of Perl the questioner may have access to on the machine that 
they use. 

And then there's the problem with ActiveState Perl users, who get a 
convenient "Start menu" item pointing to HTML-ified documentation, but 
who I've often found will respond to mention of "perldoc" with a 
"huh?".



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

Date: 21 Oct 2004 18:17:04 +0100
From: lesley_b_linux@yahoo.co.yuk
Subject: Re: How do I print http 404 not found header?
Message-Id: <m38ya0t2i7.fsf@helmholtz.local>

Tad McClellan <tadmc@augustmail.com> writes:

> lesley_b_linux@yahoo.co.yuk <lesley_b_linux@yahoo.co.yuk> wrote:
> > "Alan J. Flavell" <flavell@ph.gla.ac.uk> writes:
> 
> >> With respect, one -is- supposed to familiarise oneself with the 
> >> relevant Perl FAQs before posting here (see the regular "posting 
> >> guidelines" which appear here). 
> 
> > Fair comment about familiarising oneself with the FAQ's.
> > 
> > I would like a pointer being published in this NG, 
> 
> 
> Have you see the Posting Guidelines that Alan referred you to?
> 
> 
> > either monthly or
> > fortnightly 
> 
> 
> The guidelines are posted here twice each week.

Found them on 19th October 2004. 

Regards

L.


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

Date: 21 Oct 2004 18:35:04 +0100
From: lesley_b_linux@yahoo.co.yuk
Subject: Re: How do I print http 404 not found header?
Message-Id: <m34qkot1o7.fsf@helmholtz.local>

"Alan J. Flavell" <flavell@ph.gla.ac.uk> writes:

> On Thu, 21 Oct 2004, Tad McClellan wrote:
> 
> > > "Alan J. Flavell" <flavell@ph.gla.ac.uk> writes:
> > 
> > > to the URL http://www.perldoc.com/perl5.8.0/pod/perlfaq.html and
> > 
> > Why make them go out on the 'net when the same data is already
> > on their very own disk?
> 
> I don't disagree with that idea.  I'm always in a bit of a quandry 
> when citing an FAQ in postings here.  At least I know that a URL will 
> be recognised as a web URL, and that (in the above form) it will point 
> to the specific version of the FAQ that I had in mind, no matter which 
> version of Perl the questioner may have access to on the machine that 
> they use. 
> 
> And then there's the problem with ActiveState Perl users, who get a 
> convenient "Start menu" item pointing to HTML-ified documentation, but 
> who I've often found will respond to mention of "perldoc" with a 
> "huh?".

Oh dear :-{  Doesn't really help does it.
Perhaps, one of the unfortunate aspects of Perl's increasing popularity will
be that different providers of language packages will come up with different
solutions to the 'documentation problem' (and any other 'problems' out there).

Not being rude to Sophos, but how can anyone be sure that the Perl they
provide in their product contains the Perl that is provided by http://www.perl.org/ ?
If anyone out there has ActiveState, does Sophos or ActiveState guarantee any
parity?

Regards

L.


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

Date: Thu, 21 Oct 2004 18:07:02 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: How to I get an user email address, if I know the domain/username
Message-Id: <cl8q30$9ag$1@sun3.bham.ac.uk>



Anno Siegel wrote:

> Mav <mluvw47@yahoo.com> wrote in comp.lang.perl.misc:
> 
>>Hi,
>>   Using Perl, Windows, if I know the person domain name(or the whole
>>user domain) and userid, like (google/foo). is that a way to return
>>that person the email address progrom? I am on the same domain.
>>
>>  I found out on windows, I can right click on any folder,
>>Sharing -> Sharing this folder -> Permission -> Add
>>on the box "Enter the object names to select:"
>>If I enter something like google/foo, and Check name, that will return
>>me the email.
>>
>>  Is that a way I can write I program to do to find out the email
>>address?
> 
> 
> That has nothing to do with Perl.  Ask a group that concerns itself
> with email.

It has even less to do with e-mail.

This is really a question about the NT5 domain (aka active directory) API.

There are modules in the Win32::* hierachy that will get you stuff from 
NT4 domains and presumably will operate with NT5 domains in NT4 backward 
compatability mode.  But the thing that the OP is seeing for that looks 
like an e-mail address is the NT5 domain user name.  (It's not actually 
an e-mail address but it may work as one sometimes depending on your 
setup).  I doubt you could get this via the NT4 interface.

There may now be modules for talking directly to the NT5 domain system.

Failing that you can use LDAP.

There is a place in the NT5 domain user record for the actual e-mail 
address.



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

Date: 21 Oct 2004 10:54:16 -0700
From: mluvw47@yahoo.com (Mav)
Subject: Re: How to I get an user email address, if I know the domain/username
Message-Id: <dfaafecd.0410210954.e86a8e4@posting.google.com>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<cl7tbt$fqc$1@mamenchi.zrz.TU-Berlin.DE>...
> Mav <mluvw47@yahoo.com> wrote in comp.lang.perl.misc:
> > Hi,
> >    Using Perl, Windows, if I know the person domain name(or the whole
> > user domain) and userid, like (google/foo). is that a way to return
> > that person the email address progrom? I am on the same domain.
> > 
> >   I found out on windows, I can right click on any folder,
> > Sharing -> Sharing this folder -> Permission -> Add
> > on the box "Enter the object names to select:"
> > If I enter something like google/foo, and Check name, that will return
> > me the email.
> > 
> >   Is that a way I can write I program to do to find out the email
> > address?
> 
> That has nothing to do with Perl.  Ask a group that concerns itself
> with email.
> 
> Anno

I want to write a perl script to figure out the email address.

Thanks,
Mav


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

Date: 21 Oct 2004 10:11:06 -0700
From: notruf_1102003@yahoo.de (Gerhard M)
Subject: How to redefine warnings on recursion level
Message-Id: <942c5b0d.0410210911.69255635@posting.google.com>

first of all an simple program:

  use Math::BigInt;
  use warnings;

  my $v = new Math::BigInt;
  sub faculty ($);

  $v= faculty($ARGV[0]);
  print $v,"\n";

  sub faculty ($) {
        my $v=shift;
        return ( $v>1 ? $v*faculty($v -1) : 1 );
  }

If executing with argument 99 there's no problem, but if using 100 as
argument i'll get the warning:
Deep recursion on subroutine "main::faculty" at recursive.pl line 13.

1) How can i redefine the recursion level to keep down this warning?
2) Is it possible to add a level of recursion to die the program
(instead to warn)?

regards
gerhard


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

Date: Thu, 21 Oct 2004 18:01:28 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: How to redefine warnings on recursion level
Message-Id: <YPSdd.3818$EL5.1324@trndny09>

"Gerhard M" <notruf_1102003@yahoo.de> wrote in message
news:942c5b0d.0410210911.69255635@posting.google.com...
> first of all an simple program:
>
>   use Math::BigInt;
>   use warnings;
>
>   my $v = new Math::BigInt;
>   sub faculty ($);
>
>   $v= faculty($ARGV[0]);
>   print $v,"\n";
>
>   sub faculty ($) {
>         my $v=shift;
>         return ( $v>1 ? $v*faculty($v -1) : 1 );
>   }
>
> If executing with argument 99 there's no problem, but if using 100 as
> argument i'll get the warning:
> Deep recursion on subroutine "main::faculty" at recursive.pl line 13.
>
> 1) How can i redefine the recursion level to keep down this warning?

perldoc perldiag says:
    (W recursion) This subroutine has called itself (directly or
indirectly)
    100 times more than it has returned.  This probably indicates an
    infinite recursion, unless you're writing strange benchmark
programs, in
    which case it indicates something else.

If you're sure that your program should be recursing over 100 times,
then simply turn off this warnings:

no warnings 'recursion';

> 2) Is it possible to add a level of recursion to die the program
> (instead to warn)?

Check out %SIG as described in perldoc perlvar


I think the question has to be asked - why are you doing this?  If this
was just a sample to show us the warning message, that's fine.  But if
this is how you're actually calculating a factoral (which is the
mathematical term for what you're doing - not "faculty"), have you
considered an iterative algorithm instead?

my $fact = 1;
$fact *= $_ for (1..100);
print "100! = $fact\n";

Paul Lalli




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

Date: Thu, 21 Oct 2004 18:08:46 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Mail::Sender - Attaching output from pipe
Message-Id: <2tq5veF23op34U1@uni-berlin.de>

bengee wrote:
> Gunnar Hjalmarsson wrote:
>> Tad McClellan wrote:
>>> 
>>> You are on your own!
>> 
>> Indeed.
>> 
>> It may be appropriate to quote the last para in the Mail::Sender
>> POD:
>> 
>> "This program is free software; you can redistribute it and/or
>> modify it under the same terms as Perl itself. There is only one
>> aditional condition, you may NOT use this module for SPAMing!
>> NEVER! (see http://spam.abuse.net/ for definition)"
> 
> Are you trying to say that i'll be using this to SPAM? If that's the
> case then you're WRONG!

I realize that now. I misunderstood Tad completely and jumped at
conclusions, and for that I apologize.

> I'll be sending emails out to people who are signed up to use my
> service.

Fine. Nevertheless, you seem to have things to explain before you can
expect any help from this group.

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


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

Date: Thu, 21 Oct 2004 10:08:36 -0700
From: DM <elektrophyte-yahoo>
Subject: Re: Meaning of "Malformed UTF-8 character"?
Message-Id: <4177ed43$0$794$2c56edd9@news.cablerocket.com>

Alan J. Flavell wrote:
> On Wed, 20 Oct 2004, it was written:
> 
> 
>>I'm using Perl 5.8.0 on RH Enterprise Linux. I'm trying to match this pattern:
>>
>>$pattern = "href=.*?\\.pdf\[^>]*?>";
>>
>>I'm seeing many of these errors:
>>
>>Malformed UTF-8 character (unexpected continuation byte 0x96, with no
>>preceding start byte) in pattern match (m//) at
>>/home/emicha/bin/moveFileType.pl line 79, <INFILE> line 149.
> 
> 
> The error is self-explanatory, in its own terms.  Sounds as if you're 
> not familiar with those terms yet...

True. I don't know what a "start byte" or "continuation byte" are.

> 
> Hmmm, 5.8.0.  My hunch is that you've got utf8 in your locale, but 
> your data isn't really in utf8.  See earlier discussions of this issue 
> in (e.g) redhat 9, where the problem frequently arose.

Since this is RH Enterprise Linux, based on RH 9, that is likely. I'll check the 
earlier discussions.

> 
> 
>>And a few of these:
>>
>>Malformed UTF-8 character (unexpected non-continuation byte 0x20, immediately
>>after start byte 0xe9) in pattern match (m//) at
>>/home/emicha/bin/moveFileType.pl line 79, <INFILE> line 51.
> 
> 
> Again, self-explanatory in its own terms, but if the data is defective 
> like this, we need to see where the data came from.

The data is a bunch of HTML files that were produced at various times using a 
variety of software on a variety of platforms. However, the majority were 
produced using Dreamweaver for the Mac. I believe the files mostly use the 
"Latin-1" encoding, but I'm not 100% sure.

> 
> 
>>Any help in interpreting/resolving these would be greatly appreciated.
> 
> 
> The quick fix is to try taking the utf8 out of your locale.
> 
> Beyond that, I'd say we'd need a minimal but complete example which 
> reproduces that problem and which we can run for ourselves, as a 
> starting point to explain to you what's going wrong and how to fix it.


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

Date: Thu, 21 Oct 2004 18:54:00 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Meaning of "Malformed UTF-8 character"?
Message-Id: <Pine.LNX.4.61.0410211838170.2773@ppepc56.ph.gla.ac.uk>

On Thu, 21 Oct 2004, it was written:

> > > Malformed UTF-8 character (unexpected continuation byte 0x96, with no
> > > preceding start byte) in pattern match (m//) at
> > > /home/emicha/bin/moveFileType.pl line 79, <INFILE> line 149.
> > 
> > The error is self-explanatory, in its own terms.  Sounds as if you're not
> > familiar with those terms yet...
> 
> True. I don't know what a "start byte" or "continuation byte" are.

That's soon remedied.  Take for example this tutorial here:

http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8

and look at the second and third bullets.  The third bullet says

 The first byte of a multibyte sequence that represents a non-ASCII 
 character is always in the range 0xC0 to 0xFD and it indicates how 
 many bytes follow for this character. All further bytes in a 
 multibyte sequence are in the range 0x80 to 0xBF. This allows easy 
 resynchronization and makes the encoding stateless and robust against 
 missing bytes.

In that sense, the "start byte" of a properly formed sequence
would be one in the range 0xC0 to 0xFD, and its value would indicate
how many continueation bytes are expected to follow.

If your data contains byte sequences which fail these tests, then it 
cannot possibly be utf-8 encoding, and the rules of the game say that 
(if it was supposed to be utf-8) it must be declared invalid (in order 
to eliminate possible security compromises by presenting spoof data).

I think you should now be able to see what the error reports were 
complaining about in your data.

Of course, in your case it proves nothing more than that the original
assumption, that this was utf-8 encoding, was wrong.   Perl (5.8.0) 
has made that assumption based on what it found in the locale, which, 
as we discussed before, for RH8 and 9 contains utf8.

You find more about this in the Perl context by reading perldoc 
uniintro and perldoc unicode, or their corresponding webified versions 
at e.g http://www.perldoc.com/perl5.8.0/pod.html

It turned out to cause so much confusion that later versions of Perl 
took out this default assumption.

> The data is a bunch of HTML files that were produced at various 
> times using a variety of software on a variety of platforms. 
> However, the majority were produced using Dreamweaver for the Mac. I 
> believe the files mostly use the "Latin-1" encoding, but I'm not 
> 100% sure.

Right.  You're probably expecting to process it as a bunch of bytes, 
rather than having Perl try to do its clever unicode-ish stuff on it.

> > The quick fix is to try taking the utf8 out of your locale.
> > 
> > Beyond that, I'd say we'd need a minimal but complete example 
> > which reproduces that problem and which we can run for ourselves, 
> > as a starting point to explain to you what's going wrong and how 
> > to fix it.

I think that still stands.

Good luck.


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

Date: Thu, 21 Oct 2004 11:37:07 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Net::FTP and Passive mode problems
Message-Id: <v96dnRvSK-g5SurcRVn-pw@adelphia.com>

Hostile17 wrote:

> So why, when I've told it to use Passive, is it waiting for a timeout
> and only _then_ issuing the PASV message?

The Net::FTP docs mention that it's also influenced by a FTP_PASSIVE 
environment variable. Does the script behave differently when you use 
this instead of the method parameter?

sherm--

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


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

Date: Thu, 21 Oct 2004 15:41:21 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: perl to english
Message-Id: <BMQdd.9156$oU3.7371@trndny04>

"Uri Guttman" <uri@stemsystems.com> wrote in message
news:x7mzyg15oq.fsf@mail.sysarch.com...
> >>>>> "w" == wana  <ioneabu@yahoo.com> writes:
>
>   w> use strict;
>   w> use Exporter;
>
> use base 'Exporter' ;
>
>   w> use vars qw /$VERSION @ISA @EXPORT @EXPORT_OK/;
>
> no need for @ISA with use base.
> no need for @EXPORT_OK as you don't use it.
>
>   w> @ISA       = qw /Exporter/;
>
> handled by use base

I have to admit I didn't know about this.  (I knew about base, it just
didn't occur to me to use it here, in contrast to Exporter's docs).  I
wonder if it might be worth suggesting the documentation for Exporter.pm
be updated to reflect this method?

Paul Lalli




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

Date: Thu, 21 Oct 2004 12:25:37 -0400
From: wana <ioneabu@yahoo.com>
Subject: Re: perl to english
Message-Id: <10nfou8atsq1o2d@news.supernews.com>

Uri Guttman wrote:

>>>>>> "w" == wana  <ioneabu@yahoo.com> writes:
> 
>   w> use strict;
>   w> use Exporter;
> 
> use base 'Exporter' ;
> 
>   w> use vars qw /$VERSION @ISA @EXPORT @EXPORT_OK/;
> 
> no need for @ISA with use base.
> no need for @EXPORT_OK as you don't use it.
> 
>   w> @ISA       = qw /Exporter/;
> 
> handled by use base
> 
>   w> @EXPORT    = qw /LoadFromFile SaveToFile
>   w>                 Trim ReplaceInFile read_dir/;
> 
> our @EXPORT
> 
>   w> @EXPORT_OK = qw //;
> 
> why have that if it is empty?
> 

Thanks for all the advice!  The above package related stuff honestly was cut
and paste from a cpan module just to make things work since I have not
fully learned that stuff yet.  That is my goal for the week is to review
and learn more on modules and pod.  It's just so hard to find the time. 
There is so much stuff I want to do with Perl right away and so much to
read and learn.

Thanks again,

wana


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

Date: 21 Oct 2004 09:56:46 -0700
From: notruf_1102003@yahoo.de (Gerhard M)
Subject: Re: Regex, how do I replace quotation pairs into <LI> & </LI>?
Message-Id: <942c5b0d.0410210856.760e456b@posting.google.com>

"Kelvin" <thefatcat28@hotmail.com> wrote in message news:<41778d70$1@news.starhub.net.sg>...
> Tried ___s/\".*?\"/<li>.*?<\/li>/g;___ but not working.

hi kevin 

try 
s#"([^"]*)"#<li>$1</$1>#g

matches " (any text but quotes) " 
and places (any text..) between <li> and </li>

gerhard


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

Date: Thu, 21 Oct 2004 10:56:32 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Regular Expression for HTML Tags and Special Characters
Message-Id: <slrncnfn1g.7o7.tadmc@magna.augustmail.com>

Bart Lateur <bart.lateur@pandora.be> wrote:
> Tad McClellan wrote:
> 
>>Regular Expressions do not have the power required to parse a
>>Context Free grammar, such as HTML.
> 
> I doubt if HTML actually is a context free grammar. There are no
> recursive rules, AFAIK.


tables can nest arbitrarily deep:

   <table>
      <tbody>
         <tr>
            <td>
               <table>
                  start all over again...


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


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

Date: Thu, 21 Oct 2004 11:15:32 -0400
From: "David Gale" <dsgSPAMFILTER@alum.dartmouth.org>
Subject: Remote Permissions Problem
Message-Id: <2tq222F213ev1U1@uni-berlin.de>

At my office, we have a central file server which employees pull data from
to their own computers to work on.  For QA purposes, we don't want them to
be able to modify the information on the file server except for when they're
pulling down/putting up the data.

I've got a perl script which runs through various checks to make sure
they're allowed to modify that data, and then uses 'system("scp"....)' to
pull the data down.  Once it is verified to have reached their system, it is
removed from the server (ensuring one copy of the data exists).

What we'd like to do is set the directories on the server to be
non-executable, and have the download script chmod it right before the copy.
Problem is, the employee most likely will not be the owner of the directory
at the point of copy request.

We've thought of a couple of options, none of which seem ideal.  One would
be to do:
system("ssh $user@$server unlock $dir");
system("scp $user@$server:$dir")

which would work (unlock being a program that runs as root and issues the
chmod command), but would require the user to type in their password twice.
To get around that, I thought to ask them for their password and then use
expect to do these two commands, but (having not used expect much), I can't
figure out how to tell if the scp is successful or not.

Any help (either in coming up with a better solution, or in getting expect
to work) would be appreciated!

Thanks,
-D.

PS: I'm sure someone's going to suggest setting up ssh keys for passwordless
access, but our sysadmin doesn't want to do that, since that would give
anyone who managed to crack one box passwordless access to the server.




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

Date: Thu, 21 Oct 2004 15:23:45 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: source a config file
Message-Id: <5wQdd.6677$Ug4.3913@trndny01>

<carloschoenberg@yahoo.com> wrote in message
news:8c526b62.0410210601.408583f@posting.google.com...
> "A. Sinan Unur" <usa1@llenroc.ude.invalid> wrote in message
news:<Xns9588BD6C3B50Casu1cornelledu@132.236.56.8>...
> > If all you want is to be able to refer to variables etc in the
MyConfig
> > namespace, you why not just use a proper module (with no exporter):
>
> Is there any trickery that will make this work if I don't know the
> name of the config file at compile time? For example if it's being
> given as a command-line argument.

Without using Exporter, this is the best I could come up with:

package Mytest;
use strict;
use warnings;

our $foo = "Hello World";

1;

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

#!/usr/bin/perl
use strict;
use warnings;

my $package = shift or die "Usage: $0 <Package>\n";
require $package . ".pm";

no strict 'refs';
my $bar = ${${$package.'::'}{foo}};
print "Bar: $bar\n";
__END__

Basically, we access the symbol table by creating the name of the table
( "Mytest::"), using that string as a symref, dereferencing it and
obtaining the 'foo' entry, and then grabbing the scalar value out of
that typeglob.

Nasty, nasty stuff.

All things considered, I'd use Exporter.

Paul Lalli




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

Date: Thu, 21 Oct 2004 18:07:49 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: source a config file
Message-Id: <cl8q4f$9ag$2@sun3.bham.ac.uk>

carloschoenberg@yahoo.com wrote:

> Here's one way I tried to do it, based on a random suggestion found on
> the net:
> 
> $ cat a
> $x="hi";
> 
> $ cat b
> use strict;
> use warnings;
> 
> { package MyConfig; do './a'; }
> 
> print "$MyConfig::x\n";
> 
> But this happens:
> $ perl b
> Name "MyConfig::x" used only once: possible typo at b line 6.
> hi

You can simply 'no warnings qw(once)' [1] or make sure you mention all
your config parameters at least twice (adding a dummy mention if necessary).

[1] This warning not really all that valuable when you've got 'use
strict' anyhow.




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

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


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