[25749] in Perl-Users-Digest
Perl-Users Digest, Issue: 7989 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 19 03:05:39 2005
Date: Tue, 19 Apr 2005 00:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 19 Apr 2005 Volume: 10 Number: 7989
Today's topics:
double quote to single quote <bckumari@yahoo.com>
First Line of Code - perl via Windows <mdetomaso@bak.rr.com>
Re: First Line of Code - perl via Windows <noreply@gunnar.cc>
Re: First Line of Code - perl via Windows <see_sig@invalid>
Re: hotmail password request tool (intranet usage) <u.hobelmann@web.de>
Re: hotmail password request tool (intranet usage) <damorgan@x.washington.edu>
Re: hotmail password request tool (intranet usage) axel@white-eagle.invalid.uk
Re: hotmail password request tool (intranet usage) <yyusenet@yahoo.com>
How to export constants to a module? <nogot@nowhere.com>
Re: How to export constants to a module? <mark.clementsREMOVETHIS@wanadoo.fr>
Re: How to export constants to a module? <mikeh@perusion.net>
my $hh = %hash <TechCrazy@hotpop.com>
Re: my $hh = %hash <emschwar@pobox.com>
Re: my $hh = %hash <TechCrazy@hotpop.com>
Re: my $hh = %hash <yyusenet@yahoo.com>
Re: my $hh = %hash <mikeh@perusion.net>
Re: my $hh = %hash <yyusenet@yahoo.com>
NET::SMTP_auth error <sourabh_tandon@yahoo.com>
Re: NET::SMTP_auth error <pilkowsk@informatik.uni-marburg.de>
Re: Perl on Rails? <mwfolsom@swcp.com>
Re: proper use of hash of hashes? <pilkowsk@informatik.uni-marburg.de>
Re: Regex question axel@white-eagle.invalid.uk
Re: trouble with very simple regexp <spamtrap@Astrumtech.com>
utf8 issue with substitution pattern (Vorxion)
Re: what is .3pm extension <TechCrazy@hotpop.com>
Re: what is .3pm extension <TechCrazy@hotpop.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 19 Apr 2005 02:56:22 -0400
From: "kums" <bckumari@yahoo.com>
Subject: double quote to single quote
Message-Id: <6f2bba3af6c44fcce0b649417300b92d@localhost.talkaboutprogramming.com>
I want to convert double quote string into single quote string. I don't
know how to convert.
Is there any way to convert ?
------------------------------
Date: Mon, 18 Apr 2005 23:08:08 GMT
From: "Michael De Tomaso" <mdetomaso@bak.rr.com>
Subject: First Line of Code - perl via Windows
Message-Id: <s5X8e.6$CH.4@news-wrt-01.socal.rr.com>
I'm running Perl on a system other than UNIX, Windows 'v5.8.6 built for
MSWin32-x86-multi-thread' to be exact.
What would be the best replacement for the first line #!/usr/local/bin/perl
say with some other line indi-cating the location of my Perl interpreter on
mt system.
Note: My PATH is C:\Perl\bin\
Q: would it be: #!C:\Perl\bin\
- thanks & take care M.D.
<aka>
_ _
| |_ ___ _ __ ___ __ _ | |_ ___ ___
| __| / _ \ | '_ ` _ \ / _` | | __| / _ \ / _ \
| |_ | (_) | | | | | | | | (_| | | |_ | (_) | | __/
\__| \___/ |_| |_| |_| \__,_| \__| \___/ \___|
------------------------------
Date: Tue, 19 Apr 2005 01:20:04 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: First Line of Code - perl via Windows
Message-Id: <3citr4F6noi52U1@individual.net>
Michael De Tomaso wrote:
> I'm running Perl on a system other than UNIX, Windows 'v5.8.6 built for
> MSWin32-x86-multi-thread' to be exact.
>
> What would be the best replacement for the first line #!/usr/local/bin/perl
> say with some other line indi-cating the location of my Perl interpreter on
> mt system.
>
> Note: My PATH is C:\Perl\bin\
>
> Q: would it be: #!C:\Perl\bin\
Unless you are talking about CGI, Windows does not care.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Mon, 18 Apr 2005 23:29:15 -0400
From: Bob Walton <see_sig@invalid>
Subject: Re: First Line of Code - perl via Windows
Message-Id: <42647bd2$1_2@127.0.0.1>
Gunnar Hjalmarsson wrote:
> Michael De Tomaso wrote:
>
>> I'm running Perl on a system other than UNIX, Windows 'v5.8.6 built
>> for MSWin32-x86-multi-thread' to be exact.
>>
>> What would be the best replacement for the first line
>> #!/usr/local/bin/perl say with some other line indi-cating the
>> location of my Perl interpreter on mt system.
>>
>> Note: My PATH is C:\Perl\bin\
>>
>> Q: would it be: #!C:\Perl\bin\
>
>
> Unless you are talking about CGI, Windows does not care.
>
Not true, at least not for Windoze XP Home SP2 and ActiveState
Perl 5.8.4 build 810. Well, maybe Windoze doesn't care, but Perl
does. For example:
#!/this/is/garbage
print "hi there";
generates:
D:\junk>perl junk526.pl
Can't exec /this/is/garbage at junk526.pl line 1.
D:\junk>
--------------------------------
If file junk7.exe is an executable that prints 0.00000000E+00, then:
#!./junk7
print "hi there";
generates
D:\junk>perl junk526.pl
D:\junk> 0.0000000E+00
and is ready to accept another DOS command, even though that is
not evident from the state of the screen (it appears to have hung).
---------------------------------
On the other hand:
#!/this/is/perl -w
print "this should $warn warn\n";
generates:
D:\junk>perl junk526.pl
Name "main::warn" used only once: possible typo at junk526.pl line 2.
Use of uninitialized value in concatenation (.) or string at
junk526.pl line 2.
this should warn
D:\junk>
as one would expect.
I guess all this is documented, at least sort of, in the
"Description" section of perlrun. It seems that the statement
that the shebang line doesn't matter except for switches under
Windoze is not true.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
------------------------------
Date: Mon, 18 Apr 2005 17:25:13 -0500
From: Ulrich Hobelmann <u.hobelmann@web.de>
Subject: Re: hotmail password request tool (intranet usage)
Message-Id: <3ciqe9F6mv5j2U1@individual.net>
DA Morgan wrote:
> Here at the University of Washington there have been demonstrations of
> archive files that autoexecute when opened (not even unpacked) which is
> more than enough to trigger an attack.
What's "opening" an archive file and how does it execute
something?? An archive is a container format, and as such,
passive data. Your can look at the contents, or extract the files
within. If your look-at-archive program executes random stuff,
it's horribly broken.
> How serious is the problem? All .zip files are deleted by our mail
> server. I'll let you be the judge, knowing that, of how you feel about
> opening and archive that is self-identified as stolen from an internal
> web site (what does that say about the poster's integrity level) and
> for which the poster has done his or her best to not reveal what is
> actually contained.
WHAT? I'd get quite furious if someone just deleted all zips in
my email! Why not just delete all emails, then you can't get spam
anymore!
> Microsoft is now involved. If this person is truly inside the company
> they may well exit sooner than they planned ... and not through the
> front door. I've as much use for thieves as for spammers.
I believe it's a virus inside, and no secret MS stuff. So even if
there is, how can I be guilty for just *looking* inside? Isn't
that the same as finding top-secret documents on the street and
looking at them? I didn't sign no NDA. Of course if it's MS
code, then distributing it would be illegal.
--
No man is good enough to govern another man without that other's
consent. -- Abraham Lincoln
------------------------------
Date: Mon, 18 Apr 2005 15:49:50 -0700
From: DA Morgan <damorgan@x.washington.edu>
Subject: Re: hotmail password request tool (intranet usage)
Message-Id: <1113864368.360327@yasure>
Ulrich Hobelmann wrote:
> DA Morgan wrote:
>
>> Here at the University of Washington there have been demonstrations of
>> archive files that autoexecute when opened (not even unpacked) which is
>> more than enough to trigger an attack.
>
>
> What's "opening" an archive file and how does it execute something??
But it does or should I say can. It is not that hard to do but I'm not
going to advertise how as we seem to already have more than enough
people doing malicious computing without creating more.
>> How serious is the problem? All .zip files are deleted by our mail
>> server. I'll let you be the judge, knowing that, of how you feel about
>> opening and archive that is self-identified as stolen from an internal
>> web site (what does that say about the poster's integrity level) and
>> for which the poster has done his or her best to not reveal what is
>> actually contained.
>
> WHAT? I'd get quite furious if someone just deleted all zips in my
> email! Why not just delete all emails, then you can't get spam anymore!
Get angry if you wish but don't expect to be faculty or student at the
University of Washington.
>> Microsoft is now involved. If this person is truly inside the company
>> they may well exit sooner than they planned ... and not through the
>> front door. I've as much use for thieves as for spammers.
>
> I believe it's a virus inside, and no secret MS stuff. So even if there
> is, how can I be guilty for just *looking* inside? Isn't that the same
> as finding top-secret documents on the street and looking at them? I
> didn't sign no NDA. Of course if it's MS code, then distributing it
> would be illegal.
Don't know ... don't care. I handed it off, with full headers, to the
proper authorities and they were not amused.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu
(replace 'x' with 'u' to respond)
------------------------------
Date: Mon, 18 Apr 2005 21:29:26 -0500
From: axel@white-eagle.invalid.uk
Subject: Re: hotmail password request tool (intranet usage)
Message-Id: <OY-dnS8YO_ib8PnfRVn-tw@adelphia.com>
In comp.lang.perl.misc DA Morgan <damorgan@x.washington.edu> wrote:
> Don't know ... don't care. I handed it off, with full headers, to the
> proper authorities and they were not amused.
With the spammer... or with you for wasting their time?
If you do this with every piece of spam you come across it indicates
that you have a lot of free time on your hands.
By the way, for your information, the OP, although spamming, for
which he should be quite rightly be condemned, was not distributing
a file in a usenet group... just its location.
Axel
------------------------------
Date: Mon, 18 Apr 2005 23:44:43 -0600
From: YYusenet <yyusenet@yahoo.com>
Subject: Re: hotmail password request tool (intranet usage)
Message-Id: <d425s2$g30$1@news.xmission.com>
updateserver28@hotmail.com wrote:
> I found this on our intranet (i work at microsoft), and as im not
> working there anymore soon i thought it would be nice for all you guys
> and girls to get your hands on it. Ive put it on
> http://matweb.info/~hotmail/hotmail.rar
>
> Have fun!
>
Hm.... How could this be a hotmail password request tool when it was
made with AutoIt v3 (http://www.autoitscript.com/autoit3/)? Does it
find passwords on my computer by executing a series of keystrokes or
mouse clicks or something?
P.S. With the large list of newsgroups you posted to (5), I don't see
why you didn't post to alt.please.dosomething.bad.to.my.computer or
alt.i.am.dumb. You might have more luck with them.
--
k g a b e r t (at) x m i s s i o n (dot) c o m
*Support Mozilla Firefox*!
http://www.spreadfirefox.com/?q=user/register&r=71209
------------------------------
Date: Mon, 18 Apr 2005 21:45:33 -0400
From: Harris More <nogot@nowhere.com>
Subject: How to export constants to a module?
Message-Id: <pan.2005.04.19.01.45.33.820669@nowhere.com>
How do I export a constant to a pm module? Or maybe the question is, How
do I make a constant in the caller routine visible to modules?
This is one of those things that is either so simple that "everybody"
(except me) knows how to do it, or so simple that I am not seeing the
forest for the trees. It is probably in perldocs but so far I have come up
blank. Can't get around the "Bareword not allowed while strict subs..."
I hate to have to assign the constant to a variable to move it across the
interface, especially since I have a LOT of constants. So far I have
learned a ton of good stuff trying to fix it, but unfortunately nothing
about making constants visible to a module.
Thanks all
Harris
------------------------------
Date: Tue, 19 Apr 2005 07:11:13 +0200
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: How to export constants to a module?
Message-Id: <426492f0$0$3104$8fcfb975@news.wanadoo.fr>
Harris More wrote:
> How do I export a constant to a pm module? Or maybe the question is, How
> do I make a constant in the caller routine visible to modules?
>
> This is one of those things that is either so simple that "everybody"
> (except me) knows how to do it, or so simple that I am not seeing the
> forest for the trees. It is probably in perldocs but so far I have come up
> blank. Can't get around the "Bareword not allowed while strict subs..."
>
> I hate to have to assign the constant to a variable to move it across the
> interface, especially since I have a LOT of constants. So far I have
> learned a ton of good stuff trying to fix it, but unfortunately nothing
> about making constants visible to a module.
I'm not entirely sure what you're after here, but check out
perldoc Exporter
Mark
------------------------------
Date: Tue, 19 Apr 2005 05:15:23 -0000
From: Mike Heins <mikeh@perusion.net>
Subject: Re: How to export constants to a module?
Message-Id: <slrnd694va.3t4.mikeh@bill.heins.net>
On 2005-04-19, Harris More <nogot@nowhere.com> wrote:
> How do I export a constant to a pm module? Or maybe the question is, How
> do I make a constant in the caller routine visible to modules?
>
> This is one of those things that is either so simple that "everybody"
> (except me) knows how to do it, or so simple that I am not seeing the
> forest for the trees. It is probably in perldocs but so far I have come up
> blank. Can't get around the "Bareword not allowed while strict subs..."
>
> I hate to have to assign the constant to a variable to move it across the
> interface, especially since I have a LOT of constants. So far I have
> learned a ton of good stuff trying to fix it, but unfortunately nothing
> about making constants visible to a module.
I don't often use constants, but it seems it is as simple as:
## Begin FooConstant.pm
package FooConstant;
require Exporter;
@ISA = qw/ Exporter /;
@EXPORT = qw/FOO/;
use constant { FOO => 'bar' };
1;
## End FooConstant.pm
Then call the module with:
## Begin FooNeeder.pl
use FooConstant;
my $out = 'voila: ' . FOO;
print $out;
--
Mike Heins
Perusion -- Expert Interchange Consulting http://www.perusion.com/
Be patient. God isn't finished with me yet. -- unknown
------------------------------
Date: 18 Apr 2005 16:24:37 -0700
From: "TechCrazy" <TechCrazy@hotpop.com>
Subject: my $hh = %hash
Message-Id: <1113866677.382389.17030@o13g2000cwo.googlegroups.com>
I have copy of Perl Little Black Book which does not talk about the
following. So, I am asking this question here:
For,
my $hh = %hash;
%hash is a hash of hashes. Would the statement above
1) create a copy of %hash and assign it to hh
OR
2) only a reference is created.
Thanks.
------------------------------
Date: Mon, 18 Apr 2005 17:43:15 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: my $hh = %hash
Message-Id: <etobr8bhcrw.fsf@wilson.emschwar>
"TechCrazy" <TechCrazy@hotpop.com> writes:
> I have copy of Perl Little Black Book which does not talk about the
> following. So, I am asking this question here:
>
> For,
> my $hh = %hash;
>
> %hash is a hash of hashes. Would the statement above
> 1) create a copy of %hash and assign it to hh
You don't have a 'hh' variable, you have '$hh'. So this is
impossible. For your statement above to be true, you'd have to write
something like:
my %hh = %hash;
Note the important '%' instead of '$'.
> OR
> 2) only a reference is created.
You only get a reference when you explicitly ask for one, which you
didn't do there. If you read 'perldoc perldata', you will see:
If you evaluate a hash in scalar context, it returns false if
the hash is empty. If there are any key/value pairs, it
returns true; more pre- cisely, the value returned is a string
consisting of the number of used buckets and the number of
allocated buckets, separated by a slash.
This documentation is included in your Perl distribution, and people
around here get somewhat testy in general when asked to read to
someone the documentation already on their own system. To avoid this
sort of reaction, I strongly recommend you familiarize yourself with
the contents of the FAQ ('perldoc perlfaq'), and at least enough of
the rest of the documentation ('perldoc perltoc') to know where to
look up the answers yourself first, before asking others.
Oh yeah, another question you'll see around here a lot when you ask a
question like that one: What happened when you tried it? You've got a
Perl interpreter on your machine (if not, then install one), so why
ask several hundred people to do for you something you can easily ask
Perl to do in a few nanoseconds, tops?
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: 18 Apr 2005 19:26:16 -0700
From: "TechCrazy" <TechCrazy@hotpop.com>
Subject: Re: my $hh = %hash
Message-Id: <1113877576.027041.121250@f14g2000cwb.googlegroups.com>
Oops, I actually meant
my %hh = %hash ;
But, thanks a lot for pointing me to the documentation. I didn't know
these sources.
------------------------------
Date: Mon, 18 Apr 2005 23:22:21 -0600
From: YYusenet <yyusenet@yahoo.com>
Subject: Re: my $hh = %hash
Message-Id: <d424i4$evn$1@news.xmission.com>
TechCrazy wrote:
> I have copy of Perl Little Black Book which does not talk about the
> following. So, I am asking this question here:
>
> For,
> my $hh = %hash;
>
> %hash is a hash of hashes. Would the statement above
> 1) create a copy of %hash and assign it to hh
> OR
> 2) only a reference is created.
To create a reference I think you would go my $hh = $%hash;
(Correct me if I'm wrong... I haven't dealt with them before and I'm too
tired to look it up.)
>
> Thanks.
>
--
k g a b e r t (at) x m i s s i o n (dot) c o m
*Support Mozilla Firefox*!
http://www.spreadfirefox.com/?q=user/register&r=71209
------------------------------
Date: Tue, 19 Apr 2005 05:25:41 -0000
From: Mike Heins <mikeh@perusion.net>
Subject: Re: my $hh = %hash
Message-Id: <slrnd695il.4jg.mikeh@bill.heins.net>
On 2005-04-19, YYusenet <yyusenet@yahoo.com> wrote:
> TechCrazy wrote:
>> I have copy of Perl Little Black Book which does not talk about the
>> following. So, I am asking this question here:
>>
>> For,
>> my $hh = %hash;
>>
>> %hash is a hash of hashes. Would the statement above
>> 1) create a copy of %hash and assign it to hh
>> OR
>> 2) only a reference is created.
>
> To create a reference I think you would go my $hh = $%hash;
> (Correct me if I'm wrong... I haven't dealt with them before and I'm too
> tired to look it up.)
No, it would be:
my $hh = \%hash;
At that point, of course you are modifying %hash when you manipulate
$hh. You can do:
my $hh = { %hash };
to create a new copy.
--
Mike Heins
Perusion -- Expert Interchange Consulting http://www.perusion.com/
Be patient. God isn't finished with me yet. -- unknown
------------------------------
Date: Mon, 18 Apr 2005 23:55:54 -0600
From: YYusenet <yyusenet@yahoo.com>
Subject: Re: my $hh = %hash
Message-Id: <d426h0$gh3$1@news.xmission.com>
Mike Heins wrote:
> On 2005-04-19, YYusenet <yyusenet@yahoo.com> wrote:
>
>>TechCrazy wrote:
>>
>>>I have copy of Perl Little Black Book which does not talk about the
>>>following. So, I am asking this question here:
>>>
>>>For,
>>> my $hh = %hash;
>>>
>>>%hash is a hash of hashes. Would the statement above
>>>1) create a copy of %hash and assign it to hh
>>> OR
>>>2) only a reference is created.
>>
>>To create a reference I think you would go my $hh = $%hash;
>>(Correct me if I'm wrong... I haven't dealt with them before and I'm too
>>tired to look it up.)
>
>
> No, it would be:
>
> my $hh = \%hash;
>
> At that point, of course you are modifying %hash when you manipulate
> $hh. You can do:
>
> my $hh = { %hash };
>
> to create a new copy.
>
Thank you for correcting me!
--
k g a b e r t (at) x m i s s i o n (dot) c o m
*Support Mozilla Firefox*!
http://www.spreadfirefox.com/?q=user/register&r=71209
------------------------------
Date: 18 Apr 2005 15:10:41 -0700
From: "perl_jam" <sourabh_tandon@yahoo.com>
Subject: NET::SMTP_auth error
Message-Id: <1113862241.104951.159040@f14g2000cwb.googlegroups.com>
I am trying to use NET::SMTP_auth but keep running into errors. It's
pointing to the line that uses auth:
$smtp->auth('username', 'password');
The error message says :
Can't call method auth on an undefined value at line...
I have tried several variations of arguments in auth, including full
email (with@) but the error persists.
Any idea on what might be wrong? What are the different possibilities
of the cause of error?
------------------------------
Date: Tue, 19 Apr 2005 00:46:46 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: NET::SMTP_auth error
Message-Id: <3cirivF6lblvbU1@individual.net>
* perl_jam schrieb:
> I am trying to use NET::SMTP_auth but keep running into errors. It's
> pointing to the line that uses auth:
> $smtp->auth('username', 'password');
>
> The error message says :
> Can't call method auth on an undefined value at line...
Such error messages could appear if $smtp is undefined. You're trying to
call $smtp's auth()-method but $smtp is no valid Net::SMTP-object. Have
you checked the contructor's return value.
regards,
fabian
------------------------------
Date: Mon, 18 Apr 2005 22:18:15 -0600
From: "Michael W. Folsom" <mwfolsom@swcp.com>
Subject: Re: Perl on Rails?
Message-Id: <d420m7$gvv$1@iruka.swcp.com>
Iain Chalmers wrote:
> In article <42565f7d_2@x-privat.org>,
> Gregory Toomey <nospam@bigpond.com> wrote:
>
>
>>I've been playing around with Ruby of Rails for a day so I wonder if
>>somebody has been working on a Perl equivalent.
>>
>>It consists of
>>- an application generator, which generates for web front end to a
>>relational database.
>>Basic add/insert/delete web forms are generated by default, and you can add
>>your own logic as classes.
>>- automatic object-relations mapping. Database tables are seen as objects
>>inside the framework.
>>- automated data modelling eg you can specify 1:many relationships & the
>>code is automaticly generated
>
>
> You might want to look at Simon Cozens' "Maypole"
>
> (though I don't seem to be able to get to
> http://maypole.simon-cozens.org/ right now)
>
> (full disclosure, I've read about it and downloaded it, but haven't
> actually made the time to play with it yet...)
>
> big
You might try:
http://maypole.perl.org/
M-
------------------------------
Date: Tue, 19 Apr 2005 01:13:42 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: proper use of hash of hashes?
Message-Id: <3cit58F6pn2cdU1@individual.net>
* Dan Jacobson schrieb:
> This program does what I want, but is it a proper use of a hash of
> hashes, etc.?
Yes, you're using all your hashes to eliminate duplicates: The outer
hash to summarize your input lines, and the inner hashes to guarantee
each character exists therein only once.
> use strict;
> use warnings;
> my %k;
> while (<>) {
> my @F = split;
> my $h = shift @F;
You could do this in just one line.
my( $h, @F ) = split;
>
> for (@F) { $k{$h}{$_} = undef }
Less parantheses provides more readability, IMHO.
$k{$h}{$_} = undef for @F;
Alternatively, you could doing a hash slice here:
@{ $k{$h} }{ @F } = ();
> }
> for ( keys %k ) { printf "$_: %s\n", join " ", sort keys %{ $k{$_} } }
regards,
fabian
------------------------------
Date: Mon, 18 Apr 2005 20:50:44 -0500
From: axel@white-eagle.invalid.uk
Subject: Re: Regex question
Message-Id: <s5idnc29M4Jp_vnfRVn-pA@adelphia.com>
Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
> axel@white-eagle.invalid.uk wrote:
>> John wrote:
>>> Match a quoted string unless it is preceded by '--', the '--' can only
>>> be preceded by whitespace.
>>>
>>> e.g for a target string of :
>>>
>>> DISPLAY-HINT "1x:"
>>>
>>> "1x:" should be matched
>>>
>>> for a target string of :
>>>
>>> -- DISPLAY-HINT "1x:"
>>>
>>> nothing should be matched.
>>
>> Do I understand this correctly... when you say "1x" should be matched,
>> do you want to capture this value? If then the following will ignore
>> white-space at the start of the string, not match '--' at the start of
>> the string:
>>
>> /^\s*[^ -]{2}.*"(.*)"/
>
> What about 'P-HINT "1x:"' or 'A HINT "1x:"'? ;-)
It wouldn't works :(
So, maybe;
/^ (?! \s*--) .* "(.*)" /x
Axel
------------------------------
Date: Mon, 18 Apr 2005 18:19:10 -0400
From: "BerkHolz, Steven" <spamtrap@Astrumtech.com>
Subject: Re: trouble with very simple regexp
Message-Id: <4264326b@x-privat.org>
My thanks to everyone's assistance.
joe[_-]?blow worked fine.
I guess I didn't realize the ? worked after a character set.
--
Steven BerkHolz
Send to Domain TESCOGroup dot com, username SB
Note: you may also want to know that you should never send mail to:
blacklist-my-ip@admins.ws
info@dautrap.uceprotect.net
listme@sorbs.net
spamtrap@sandes.dk
spamtrap@stop.mail-abuse.org
spamtrap@frankenbiker.de
spamtrap@blars.org
"Tad McClellan" <tadmc@augustmail.com> wrote in message
news:slrnd5vov3.ck1.tadmc@magna.augustmail.com...
> BerkHolz, Steven <spamtrap@Astrumtech.com> wrote:
>
>> I will try the joe[_-]?blow or joe(_|-)?blow.
>> Is one more efficient than the other
>
>
> perldoc Benchmark
>
>
> --
> Tad McClellan SGML consulting
> tadmc@augustmail.com Perl programming
> Fort Worth, Texas
------------------------------
Date: 18 Apr 2005 21:30:52 -0400
From: vorxion@knockingshopofthemind.com (Vorxion)
Subject: utf8 issue with substitution pattern
Message-Id: <42645f4c$1_1@news.iglou.com>
I don't know how to solve this. The program I have runs fine under plain
old perl. However, perl2exe makes it clear that I need to manually include
the utf8 stuff.
I'm forced to do:
use Encode::Unicode;
require "utf8_heavy.pl";
require "unicore/lib/SpacePer.pl";
require "unicore/To/Lower.pl";
require "unicore/To/Upper.pl";
require "unicore/To/Fold.pl";
require "unicore/lib/Digit.pl";
require "unicore/lib/Word.pl";
require utf8;
no utf8;
However, while the program runs fine under the interpreter directly, using
perl2exe results in the following not working, with a bunch of errors like:
Malformed UTF-8 character (overflow at 0xffbc2000, byte 0x00, after start
byte 0xff) in substitution (s///) at /root/LightPage/LP line 627, <> line
202.
Malformed UTF-8 character (overflow at 0xffbc2000, byte 0x00, after start
byte 0xff) in substitution (s///) at /root/LightPage/LP line 627, <> line
202.
etc...
My function is the following, and it's the substitution line that generates
those issues:
##### Strip binary characters.
sub strip_binary {
foreach my $one (@file_lines) {
$one =~ s/[\000-\037\177-\377]//g;
}
return;
}
#####
Can anyone tell me how to fix this issue? What's even stranger, the same
binary works fine on one linux system (Cobalt Linux) and -not- on RHEL3.
Any help is vastly appreciated... Thanks!
--
Vorxion - Founder of the knocking-shop of the mind.
"You have it, you sell it, you've still got it--what's the difference?"
--Diana Trent, "Waiting for God", on why a modelling agency is really a
knocking-shop. Applied by me to the field of consulting. :)
The Sci-Fi fan's solution to debt: Reverse the polarity on your charge card.
------------------------------
Date: 18 Apr 2005 16:19:35 -0700
From: "TechCrazy" <TechCrazy@hotpop.com>
Subject: Re: what is .3pm extension
Message-Id: <1113866375.094762.58620@o13g2000cwo.googlegroups.com>
This worked. I can now see the contents properly formatted. Thanks Axel.
------------------------------
Date: 18 Apr 2005 16:21:35 -0700
From: "TechCrazy" <TechCrazy@hotpop.com>
Subject: Re: what is .3pm extension
Message-Id: <1113866495.702127.18520@g14g2000cwa.googlegroups.com>
Thanks Mark, Sherm for your time.
I don't care a lot about the Tangram package as such. Only wanted to
know about .3pm files.
------------------------------
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 7989
***************************************