[31177] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2422 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 17 00:09:49 2009

Date: Sat, 16 May 2009 21:09:12 -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           Sat, 16 May 2009     Volume: 11 Number: 2422

Today's topics:
    Re: comma operator QoS@invalid.net
    Re: comma operator <tadmc@seesig.invalid>
    Re: comma operator <jurgenex@hotmail.com>
    Re: comma operator sln@netherlands.com
    Re: comma operator sln@netherlands.com
    Re: comma operator <frank@example.invalid>
    Re: DBI and fork <xhoster@gmail.com>
    Re: FAQ 7.14 What is variable suicide and how can I pre <brian.d.foy@gmail.com>
    Re: FAQ 7.27 How can I comment out a large block of per jidanni@jidanni.org
    Re: FAQ 8.4 How do I print something out in color? <ben@morrow.me.uk>
        Pattern matching  <someone@somewhere.nb.ca>
    Re: Pattern matching  <tadmc@seesig.invalid>
    Re: Pattern matching <jurgenex@hotmail.com>
    Re: perl 5 grammar <mvdwege_public@myrealbox.com>
    Re: perl 5 grammar <whynot@pozharski.name>
    Re: perl 5 grammar <whynot@pozharski.name>
    Re: perl 5 grammar <nat.k@gm.ml>
    Re: perl 5 grammar <m@rtij.nl.invlalid>
    Re: s/(The N)e(urdsburg Affair)/$1$2/ looks dumb sln@netherlands.com
    Re: s/(The N)e(urdsburg Affair)/$1$2/ looks dumb sln@netherlands.com
        validating file names <oldyork90@yahoo.com>
    Re: writing get_script as an external routine callable  <frank@example.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 16 May 2009 14:09:13 GMT
From: QoS@invalid.net
Subject: Re: comma operator
Message-Id: <dOzPl.1658$5F2.1055@nwrddc01.gnilink.net>


Andrew DeFaria <Andrew@DeFaria.com> wrote in message-id:  <4a0e4d17$0$87067$815e3792@news.qwest.net>

> 
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
>   <style type="text/css">
> body {
>   font:			Helvetica, Arial, sans-serif;
> }
> p {
>   font:			Helvetica, Arial, sans-serif;
> }
> .standout {
>   font-family:		verdana,
> 			arial,
> 			sans-serif;
>   font-size:		12px;
>   color:		#993333;
>   line-height:		13px;
>   font-weight:		bold;
>   margin-bottom:	10px;
> }
> .code {
>   border-top:		1px solid #ddd;
>   border-left:		1px solid #ddd;
>   border-right:		2px solid #000;
>   border-bottom:	2px solid #000;
>   padding:		10px;
>   margin-top:		5px;
>   margin-left:		5%;
>   margin-right:		5%;
>   background:		#ffffea;
>   color:		black;
>   -moz-border-radius:	10px;
> }
> .codedark {
>   border-top:		10px solid #03f;
>   border-left:		1px solid #ddd;
>   border-right:		2px solid grey;
>   border-bottom:	2px solid grey;
>   padding:		10px;
>   margin-top:		5px;
>   margin-left:		5%;
>   margin-right:		5%;
>   background:		black;
>   color:		yellow;
>   -moz-border-radius:	10px;
> }
> #code {
>   color:		black;
>   font-size:		14px;
>   font-family:		courier;
>   padding-left:		5px;
> }
> #line-number {
>   color:		#804000;
>   font-family:		Arial;
>   font-size:		14px;
>   padding-right:	5px;
>   border-right:		1px dotted #804000;
> }
> blockquote[type=cite] {
>   padding:	0em .5em .5em .5em	!important;
>   border-right:	2px  solid blue		!important;
>   border-left:	2px solid blue		!important;
> }
> blockquote[type=cite]
> blockquote[type=cite] {
>   border-right:	2px solid maroon	!important;
>   border-left:	2px solid maroon	!important;
> }
> blockquote[type=cite]
> blockquote[type=cite]
> blockquote[type=cite] {
>   border-right:	2px solid teal		!important;
>   border-left:	2px solid teal		!important;
> }
> blockquote[type=cite]
> blockquote[type=cite]
> blockquote[type=cite]
> blockquote[type=cite] {
>   border-right:	2px solid purple	!important;
>   border-left:	2px solid purple	!important;
> }
> blockquote[type=cite]
> blockquote[type=cite]
> blockquote[type=cite]
> blockquote[type=cite]
> blockquote[type=cite] {
>   border-right:	2px solid green		!important;
>   border-left:	2px solid green		!important;
> }
>   </style>
> </head>
> <body>
> Franken Sense wrote:
> <blockquote id="mid_n9xz6jtv6q9l__abdg4l179oq6__dlg_40tude_net"
>  cite="mid:n9xz6jtv6q9l$.abdg4l179oq6$.dlg@40tude.net" type="cite">In
> Dread Ink, the Grave Hand of Uri Guttman Did Inscribe:<br>
>   <blockquote id="StationeryCiteGenerated_1" type="cite">and finally
> WTF is franken sense asking dumb sidebar questions and getting answers.
> he needs to focus on learning perl and not obscure side issues like
> comma ops and lvalues (i bet he doesn't even know what the term lvalue
> means)<br>
>   </blockquote>
> Fuck off, Uri. I'll bet you're an asshole in every time zone.<br>
> </blockquote>
> I'm shooting for that! Perhaps if I stood at the North Pole and spun
> around... <span class="moz-smiley-s5"><span> :-D </span></span><br>
> <div class="moz-signature">-- <br>
> <a href="http://defaria.com">Andrew DeFaria</a><br>
> <small><font color="#999999">Think honk if you're telepathic.</font></small>
> </div>
> </body>
> </html>

Whats with all the html?  This is nntp.

BTW to the OP please dont have thin skin here;
while the response may have seemed harsh,
the intentions were benevolent.





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

Date: Sat, 16 May 2009 09:10:42 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: comma operator
Message-Id: <slrnh0tib2.pvr.tadmc@tadmc30.sbcglobal.net>

QoS@invalid.net <QoS@invalid.net> wrote:
>
> Andrew DeFaria <Andrew@DeFaria.com> wrote in message-id:  <4a0e4d17$0$87067$815e3792@news.qwest.net>
>
>> 
>> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>> <html>

> Whats with all the html?


It has been posting that way for years.

Please do not feed it.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Sat, 16 May 2009 08:56:34 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: comma operator
Message-Id: <0fot05t0djsjon9rmv8a3ioa35b3q1n73e@4ax.com>

QoS@invalid.net wrote:
>Andrew DeFaria <Andrew@DeFaria.com> wrote in message-id:  <4a0e4d17$0$87067$815e3792@news.qwest.net>
>
>> 
>> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>> <html>
>> <head>
>>   <style type="text/css">
[...]
>Whats with all the html?  This is nntp.

You must be new here, everyone else has plonked him a loooooonnnng time
ago because of this.

jue


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

Date: Sat, 16 May 2009 19:59:59 -0700
From: sln@netherlands.com
Subject: Re: comma operator
Message-Id: <2bvu055bpaenie4a9kp5a4lopo7qfm7fjc@4ax.com>

On Sat, 16 May 2009 08:56:34 -0700, Jürgen Exner <jurgenex@hotmail.com> wrote:

>QoS@invalid.net wrote:
>>Andrew DeFaria <Andrew@DeFaria.com> wrote in message-id:  <4a0e4d17$0$87067$815e3792@news.qwest.net>
>>
>>> 
>>> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>>> <html>
>>> <head>
>>>   <style type="text/css">
>[...]
>>Whats with all the html?  This is nntp.
>
>You must be new here, everyone else has plonked him a loooooonnnng time
>ago because of this.
>
I didn't filter this guy, nor anybody, especially you tweedle-dee

-sln



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

Date: Sat, 16 May 2009 20:02:55 -0700
From: sln@netherlands.com
Subject: Re: comma operator
Message-Id: <ldvu05tv1vniidrns16ojasieet9vco06p@4ax.com>

On Sat, 16 May 2009 09:10:42 -0500, Tad J McClellan <tadmc@seesig.invalid> wrote:

>QoS@invalid.net <QoS@invalid.net> wrote:
>>
>> Andrew DeFaria <Andrew@DeFaria.com> wrote in message-id:  <4a0e4d17$0$87067$815e3792@news.qwest.net>
>>
>>> 
>>> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>>> <html>
>
>> Whats with all the html?
>
>
>It has been posting that way for years.
>
>Please do not feed it.

What is 'it'?

It
From Wikipedia, the free encyclopedia
Jump to: navigation, search
 Look up it in
Wiktionary, the free dictionary. 
This article contains special characters. Without proper rendering support, you may see question marks, boxes, or other symbols. 
It or IT may refer to:

It (pronoun), a third-person neuter pronoun in English. 
As an abbreviation:

Information technology, a broad subject concerned with aspects of managing, editing and processing information 
it, the ISO 639 alpha-2 short code for the Italian language 
IT, the ISO 3166-1 alpha-2 and FIPS 10-4 country code for Italy 
IT, Iran Time, the time zone used in Iran, UTC+3:30 (also IRST). 
 .it, the Internet country code top-level domain ccTLD for Italy. 
The Irish Times 
Income tax 
The IATA code for Kingfisher Airlines and Irtysh Avia 
Institute of Technology, in the educational system of Ireland 
Impulse Tracker, music sequencer software for MS-DOS 
IEEE Transactions on Information Theory, a scientific journal published by the Institute of Electrical and Electronic Engineers 
Internet television, television distributed via the Internet 
Internal Translator, an early compiler developed by Alan Perlis for the IBM 650 in 1956 
Inclusive Tour, a package holiday that includes accommodation in addition to transportation 
International Times, an underground newspaper in London 
A type of electrical earthing system 
A metalinguistic marker in the Sanskrit grammar of Panini 
A series of enduro motorcycles from Yamaha (e.g. IT175, IT250, IT490) 
Intercity Transit, a public transportation service for the cities of Lacey, Olympia, Tumwater, and Yelm, Washington. 
IT, one of the code names by which the Segway personal transporter was known during its development 
Invisibolt Technology, a version of set-through guitar neck join by B.C. Rich 
Inferotemporal cortex, the highest-order cortical visual processing area of the brain. 
(it), an abbreviation for intrathecal injection 
IT (file format), an audio file format. 
IT, the acronym-logo for heavy metal band Insidiöus Törment. 
As a name:

Cousin Itt, a monster character in the TV series The Addams Family. 
IT, the villain in Madeleine L'Engle's science fiction novel A Wrinkle in Time. 
IT, the sand fairy known as Psammead in Edith Nesbit's book Five Children and It. 
The name of a high-speed vehicle in the South Park episode The Entity. 
IT, a superintelligence in the science fiction series Perry Rhodan. 
It is the stage name of Tony Särkkä, the vocalist for the black metal band Abruptum. 
It, a boss from the videogame Resident Evil 4. 
IT, an malevolent evil force haunting a small town in Stephen King's horror novel It and its film by the same name 
iT, a model of neighborhood electric vehicle also known as the Dynasty EV 
As a title:

It (novel), a horror novel by Stephen King 
It (1990 film), a film version of the Stephen King novel 
It, the first album by British pop band Pulp. 
It, a song by Prince from his 1987 album, Sign o' the Times. 
It (1927 film), a 1927 romantic comedy film starring Clara Bow 
It girl, a young woman famed for her good looks 
It! (1966 film), a 1966 horror film 
Es (film) (English title: It), a 1966 West German film directed by Ulrich Schamoni 
It (Phish festival), a two-day festival by the jam band Phish, held in August 2003 in Limestone, Maine, and the subsequent DVD (It (video)) and concert download (Live Phish Downloads: It) 
It., the final track on the Genesis album The Lamb Lies Down on Broadway 
A Child Called "It", an autobiography by Dave Pelzer 
It! The Terror from Beyond Space, a 1958 science fiction film 
it Records, a record label 
IT (XM), an annual special aired on XM Satellite Radio 
It! (story) a story by Theodore Sturgeon featuring the earliest plant-based swamp monster in literature. 
from It (pronoun):

A euphemism for sexual intercourse 
The distinguished player in tag and related chasing games 
In other languages:

it, fire in the Charrúa language. 

[edit] See also
Gender-neutral pronoun 
ITT 
Id 

-sln


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

Date: Sat, 16 May 2009 21:44:16 -0700
From: Franken Sense <frank@example.invalid>
Subject: Re: comma operator
Message-Id: <cjtcj0n467ge.1sp50m1vgjv72$.dlg@40tude.net>

In Dread Ink, the Grave Hand of Lawrence Statton Did Inscribe:

>> WTF

For the record, it is uri, the person half my size and halfway around the
world, who dropped the f-bomb, ungrammatically, first.

Lawrence is the type of person to killfile a person with whom he has had no
interaction.

Makes you wonder what his motive is, because it has nothing to do with me.
-- 
Frank

I do personal attacks only on people who specialize in personal attacks..
~~ Al Franken, Playboy interview


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

Date: Sat, 16 May 2009 16:15:46 -0700
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: DBI and fork
Message-Id: <4a0f4f8b$0$19962$ed362ca5@nr5-q3a.newsreader.com>

shurikgefter@gmail.com wrote:
> I create a DBI connection and after that run fork() command
> 
> In the child process I close the DBI connection.

Why do you do that?  Have you read the part in the docs that discuss 
InactiveDestroy?

> 
> Does it affected on parent process?

Maybe, maybe not.  It depends on the driver, and on what the parent 
tries to do.  If the parent does nothing but call POSIX:_exit, then
it probably won't be affected.

Xho


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

Date: Sun, 17 May 2009 07:53:44 +0400
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 7.14 What is variable suicide and how can I prevent it?
Message-Id: <170520090753442866%brian.d.foy@gmail.com>

In article <573vd6-ro5.ln1@osiris.mauzo.dyndns.org>, Ben Morrow
<ben@morrow.me.uk> wrote:

> Quoth frank@example.invalid:
> > In Dread Ink, the Grave Hand of PerlFAQ Server Did Inscribe:
> > 
> > > 7.14: What is variable suicide and how can I prevent it?
> > > 
> > >     This problem was fixed in perl 5.004_05, so preventing it means
> > >     upgrading your version of perl. ;)
> <snip>
> > 
> > Does it bother perl to hit the same variable in a loop when scoped as my?

> Perhaps this FAQ could be retired?

I'll add it to the list of candidates for the old-FAQ home :)


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

Date: Sun, 17 May 2009 10:09:05 +0800
From: jidanni@jidanni.org
To: brian@stonehenge.com
Subject: Re: FAQ 7.27 How can I comment out a large block of perl code?
Message-Id: <87fxf4h45a.fsf@jidanni.org>

PerlFAQ Server <brian@stonehenge.com> writes:
> 7.27: How can I comment out a large block of perl code?
Also mention if you are in a hurry, the least you need is probably only
something like
=a
        open_bomb_bay_doors();
=cut


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

Date: Sun, 17 May 2009 04:40:36 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: FAQ 8.4 How do I print something out in color?
Message-Id: <kid4e6-uoc1.ln1@osiris.mauzo.dyndns.org>


Quoth PerlFAQ Server <brian@stonehenge.com>:
> 
> 8.4: How do I print something out in color?
> 
>     In general, you don't, because you don't know whether the recipient has
>     a color-aware display device. If you know that they have an ANSI
>     terminal that understands color, you can use the Term::ANSIColor module
>     from CPAN:
> 
>             use Term::ANSIColor;
>             print color("red"), "Stop!\n", color("reset");
>             print color("green"), "Go!\n", color("reset");
> 
>     Or like this:
> 
>             use Term::ANSIColor qw(:constants);
>             print RED, "Stop!\n", RESET;
>             print GREEN, "Go!\n", RESET;

This FAQ could do with mentioning Win32::Console::ANSI, to get ANSI
color escapes on Win32. Maybe something like

    On Win32, the native console doesn't understand ANSI escapes, but
    you can use the Win32::Console::ANSI module to translate ANSI
    sequences into something it can understand. If you want your code to
    be portable to Win32 systems, you will need to include

        BEGIN {
            if ($^O eq "MSWin32" and -t STDOUT) {
                require Win32::Console::ANSI;
            }
        }

    or

        use if $^O eq "MSWin32" && -t STDOUT, "Win32::Console::ANSI";

    before C<use Term::ANSIColor;>.

Ben



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

Date: Sat, 16 May 2009 23:38:20 -0300
From: "Guy" <someone@somewhere.nb.ca>
Subject: Pattern matching 
Message-Id: <4a0f788d$0$23742$9a566e8b@news.aliant.net>

I found this example, which you may recognize, they start off with data, 
notice the indentation:

Skipper
    blue_shirt
    hat
Professor
    sunscreen
    water_bottle
Gilligan
    red_shirt
    hat

Then, as they read the lines of data, they want to determine if the data is 
the person's name, or an item belonging to that person. They use the 
following:

if (/^(\S.*)/) {...

This will determine whether or not there is a non-white space (person name) 
at the begining of the line. Would the following achieve the same, in this 
case? If so, is there an advantage to their pattern?

if (/^\S/) {...

Thanks,
Guy




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

Date: Sat, 16 May 2009 21:47:36 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Pattern matching 
Message-Id: <slrnh0uum8.2o3.tadmc@tadmc30.sbcglobal.net>

Guy <someone@somewhere.nb.ca> wrote:

> I found this example, which you may recognize, 


Errr, yes I do.


> they start off with data, 
> notice the indentation:
>
> Skipper
>     blue_shirt
>     hat
> Professor
>     sunscreen
>     water_bottle
> Gilligan
>     red_shirt
>     hat
>
> Then, as they read the lines of data, they want to determine if the data is 
> the person's name, or an item belonging to that person. They use the 
> following:
>
> if (/^(\S.*)/) {...
>
> This will determine whether or not there is a non-white space (person name) 
> at the begining of the line. 


 ... and additionally saves the line (minus newline) into the $1 variable.


> Would the following achieve the same, 


That depends on whether the $1 variable is subsequently used or not.


> in this 
> case? 


You have not shown enough of "this case" to be able to answer your question.


> If so, is there an advantage to their pattern?


It saves the line (minus newline) into the $1 variable.

That would be an advantage if the code later makes use of 
the $1 variable's value.


> if (/^\S/) {...


That does not put anything into the $1 variable.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Sat, 16 May 2009 20:24:46 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Pattern matching
Message-Id: <oo0v05h71fd2tbab5dh0g2d29o2m57gk7o@4ax.com>

"Guy" <someone@somewhere.nb.ca> wrote:
>I found this example, which you may recognize, they start off with data, 
>notice the indentation:
>
>Skipper
>    blue_shirt
>    hat
>Professor
>    sunscreen
>    water_bottle
>Gilligan
>    red_shirt
>    hat
>
>Then, as they read the lines of data, they want to determine if the data is 
>the person's name, or an item belonging to that person. They use the 
>following:
>
>if (/^(\S.*)/) {...
>
>This will determine whether or not there is a non-white space (person name) 
>at the begining of the line. Would the following achieve the same, in this 
>case? 
>
>if (/^\S/) {...

For the part of the code you showed to us: yes

>If so, is there an advantage to their pattern?

It also captures the whole name if there is a name

jue


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

Date: Sat, 16 May 2009 11:37:26 +0200
From: Mart van de Wege <mvdwege_public@myrealbox.com>
Subject: Re: perl 5 grammar
Message-Id: <86pre9o0bt.fsf@gareth.avalon.lan>

Mike Samuel <mikesamuel@gmail.com> writes:

<snip>

> Ecmascript has the same property where a regular lexical grammar is
> impossible since the meaning of '/' depends on the production.
> But in Ecmascript, there is a lexical grammar that is correct for all
> programs a non-malicious coder is likely to write.  There are a few
> places where this breaks down like (a++/b/i) vs (a = ++/b/i) but the
> latter is useless.
>
> But in perl, these syntactic irregularities show up frequently in
> production code?
>
> Is there a 95% solution that seems to work reasonably well?
>
I personally find that both Emacs CPerl mode and Eclipse
E.P.I.C. deal pretty well with Perl. 

Mart

-- 
"We will need a longer wall when the revolution comes."
--- AJS, quoting an uncertain source.


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

Date: Sat, 16 May 2009 15:36:03 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: perl 5 grammar
Message-Id: <slrnh0tcpp.dik.whynot@orphan.zombinet>

On 2009-05-15, Ben Morrow <ben@morrow.me.uk> wrote:
> Quoth Mike Samuel <mikesamuel@gmail.com>:
>> I maintain the syntax highlighter for code.google.com and perl support
>> is rather lacking.
>> 
>> I know perl has a complex grammar, but can someone point me at a
>> simple lexical grammar for perl 5 that will allow me to at least
>> identify comment, string, and regex boundaries?
>
> I find vim's syntax highlighting perfectly adequate, and it's not too
> complex (unlike using PPI or the code from cperl-mode). It's possible to
> confuse it, but most 'ordinary' code is highlighted correctly. 

That's true if F<syntax/perl.vim> is off vim-scripts.sf.net.  However
for F<perl.vim> distributed with Debian's Lenny (and I suppose that
ubuntu thing too), that 'ordinary code' is a way limited.  OP seems to
be from Mac world, so I can't comment what would be 'ordinary code' for
his ordinary perl.vim.


-- 
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom


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

Date: Sat, 16 May 2009 15:47:24 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: perl 5 grammar
Message-Id: <slrnh0tdf1.dik.whynot@orphan.zombinet>

On 2009-05-16, Jürgen Exner <jurgenex@hotmail.com> wrote:
> Tad J McClellan <tadmc@seesig.invalid> wrote:
>>Jürgen Exner <jurgenex@hotmail.com> wrote:
>>> Comments are easy: anything following a # sign in the same line or
>>> anything enclosed as POD.
>>
>>
>>But not as easy as you describe:
>>
>>   $str =~ m#no comment here#;
>>
>>   print "no#comment#here#either\n";
>>
>>   print q#not a comment#;
>
> Oh man, why do you always have to find those pesky special cases? 
> Thanks for pointing this out, you are absolutely right, of course.

He just kept C<$#x> thing for another turn.  I think, that if hash-sign
has leading space, than it will comment

	{4484:3} [0:255]$ perl -wle 'print q|abc| =~ s # / '
	Substitution pattern not terminated at -e line 1.


-- 
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom


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

Date: Sat, 16 May 2009 11:48:02 -0700
From: Nathan Keel <nat.k@gm.ml>
Subject: Re: perl 5 grammar
Message-Id: <CTDPl.84937$3k7.30979@newsfe17.iad>

Eric Pozharski wrote:

> On 2009-05-16, Jürgen Exner <jurgenex@hotmail.com> wrote:
>> Tad J McClellan <tadmc@seesig.invalid> wrote:
>>>Jürgen Exner <jurgenex@hotmail.com> wrote:
>>>> Comments are easy: anything following a # sign in the same line or
>>>> anything enclosed as POD.
>>>
>>>
>>>But not as easy as you describe:
>>>
>>>   $str =~ m#no comment here#;
>>>
>>>   print "no#comment#here#either\n";
>>>
>>>   print q#not a comment#;
>>
>> Oh man, why do you always have to find those pesky special cases?
>> Thanks for pointing this out, you are absolutely right, of course.
> 
> He just kept C<$#x> thing for another turn.  I think, that if
> hash-sign has leading space, than it will comment
> 
> {4484:3} [0:255]$ perl -wle 'print q|abc| =~ s # / '
> Substitution pattern not terminated at -e line 1.
> 
> 

The hash sign isn't the cause of the problem there.  Replace it with
anything else, and you'll still see the same error.


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

Date: Sat, 16 May 2009 23:57:21 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: perl 5 grammar
Message-Id: <1fp3e6-cih.ln1@news.rtij.nl>

On Fri, 15 May 2009 11:43:25 -0700, Jürgen Exner wrote:

> Comments are easy: anything following a # sign in the same line ...

And even that is not true (and many existing syntax highlighters get this 
wrong as well):

while (<>) {
	/^#/ and next;
        ...
}


M4


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

Date: Sat, 16 May 2009 20:10:18 -0700
From: sln@netherlands.com
Subject: Re: s/(The N)e(urdsburg Affair)/$1$2/ looks dumb
Message-Id: <dpvu05tcj7e594jvhloodg3pvou5r5psbg@4ax.com>

On Thu, 14 May 2009 20:34:08 -0700, Nathan Keel <nat.k@gm.ml> wrote:

>jidanni@jidanni.org wrote:
>
>> Sure I can do
>> s/(The N)e(urdsburg Affair)/$1$2/;
>> but something tells me that there ought to be a smarter looking way to
>> get the same functionality. Something like
>> s/The N(e)urdsburg Affair/... but what?
>
>Why would you capture (e) and not use it?
>
>Just
>
>s/The Neurdsburg Affair/The Nurdsburg Affair/
>
>Or whatever makes the best sense, if that's how you really want to do
>it.

Why not capture something when you already know what it is?
Why not a single letter in the sequence.
Maybe $-[1] is something you need to know. Maybe you want to 
rip out or assign substr style.

Been at this very long?

-sln


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

Date: Sat, 16 May 2009 20:11:53 -0700
From: sln@netherlands.com
Subject: Re: s/(The N)e(urdsburg Affair)/$1$2/ looks dumb
Message-Id: <q20v05hmqj05mb0n1r3td96amgv8ce20mu@4ax.com>

On Fri, 15 May 2009 10:30:59 -0500, Ted Zlatanov <tzz@lifelogs.com> wrote:

>On Thu, 14 May 2009 11:00:28 +0800 jidanni@jidanni.org wrote: 
>
>j> Sure I can do
>j> s/(The N)e(urdsburg Affair)/$1$2/;
>j> but something tells me that there ought to be a smarter looking way to
>j> get the same functionality. Something like
>j> s/The N(e)urdsburg Affair/... but what?
>
>I've learned, with experience, to beware "smart" ways of solving simple
>problems.  They usually become unmanageable messes, all for the sake of
>stroking the programmer's ego.  I've been guilty of this too.
>
>It's almost always (99.9% of the time) better to just do what others
>would expect you to do, even if it's not emphatically clever.  As the
>famous quote goes, code as if the person who will maintain your code is
>a homicidal maniac who knows where you live.
>
>Ted

I like this.

-sln


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

Date: Sat, 16 May 2009 14:37:49 -0700 (PDT)
From: okey <oldyork90@yahoo.com>
Subject: validating file names
Message-Id: <32f63245-264d-449d-a13f-7e09032c12b9@f16g2000vbf.googlegroups.com>

We've generated our own small collection of expressions which tell us
what is and is not a legal file name in uSWindows and UNIX.  But we
were wondering, has anyone published a collection of expressions to
that purpose - validating file names?



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

Date: Sat, 16 May 2009 21:51:05 -0700
From: Franken Sense <frank@example.invalid>
Subject: Re: writing get_script as an external routine callable by C
Message-Id: <1vf8t7pu5gwtv$.5esq4gueffsa$.dlg@40tude.net>

In Dread Ink, the Grave Hand of Uri Guttman Did Inscribe:

>>>>>> "FS" == Franken Sense <frank@example.invalid> writes:
> 
>   FS> C:\MinGW\source>perldoc File::Slurp
>   FS> No documentation found for "File::Slurp".
> 
> duh! you install it from cpan!
> 
> uri

I'm curious how you treat your clients.  I was looking for documentation.

Do you tell them to go back to college?  lose weight?

As OP, I certainly didn't ask about the dumb sidebar issue of File::Slurp.  
-- 
Frank

I said that Sean Hannity took residence up Newt Gingrich's butt from 94 to
98. I got that from British intelligence. It turns out he only took up
residence in 95.
~~ Al Franken


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

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 V11 Issue 2422
***************************************


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