[29098] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 342 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 15 16:09:55 2007

Date: Sun, 15 Apr 2007 13:09:08 -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           Sun, 15 Apr 2007     Volume: 11 Number: 342

Today's topics:
    Re: Absolute Path errors <nikos1337@gmail.com>
    Re: Absolute Path errors <bik.mido@tiscalinet.it>
    Re: Absolute Path errors <tadmc@augustmail.com>
    Re: How to transparently download multiple files? <edMbj@aes-intl.com>
        is laziness a programer's virtue? <xah@xahlee.org>
    Re: is laziness a programer's virtue? <ken@theoryyalgebra.com>
    Re: is laziness a programer's virtue? <randomgeek@cyberspace.net>
    Re: is laziness a programer's virtue? <zefria@gmail.com>
    Re: is laziness a programer's virtue? <kay.schluehr@gmx.net>
    Re: is laziness a programer's virtue? <john.thingstad@chello.no>
    Re: is laziness a programer's virtue? <xah@xahlee.org>
    Re: looking for some size optimization <1usa@llenroc.ude.invalid>
        perl.h seems to interfere with fopen or stdio.h <anerbenartzi@gmail.com>
    Re: perl.h seems to interfere with fopen or stdio.h <wahab-mail@gmx.de>
    Re: Regular expression <tadmc@augustmail.com>
    Re: Running perl scripts on the fly jrosik@gmail.com
    Re: Script to know who clicked a link? <bik.mido@tiscalinet.it>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 15 Apr 2007 07:35:11 -0700
From: "skieros" <nikos1337@gmail.com>
Subject: Re: Absolute Path errors
Message-Id: <1176647711.067529.153490@y5g2000hsa.googlegroups.com>

On Apr 15, 12:48 pm, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:
> On 2007-04-12 09:56, Michele Dondi <bik.m...@tiscalinet.it> wrote:
>
> > In particular the URL you expect for it does NOT make any sense, for
> >http://index.plis not a reasonable URL in any way.
>
> Oh, it's perfectly reasonable - for a specific server in Poland :-).

how come? :)




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

Date: Sun, 15 Apr 2007 19:05:30 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Absolute Path errors
Message-Id: <6nm423d4s207vtrkvr9g2u9hno2ighs04f@4ax.com>

On 15 Apr 2007 07:35:11 -0700, "skieros" <nikos1337@gmail.com> wrote:

>> Oh, it's perfectly reasonable - for a specific server in Poland :-).
>
>how come? :)

The tld for Poland is pl and index.pl is a valid hostname. It even
actually exists:

  kirk:~ [19:05:27]$ host index.pl
  index.pl has address 195.116.236.13
  index.pl mail is handled by 40 alterratp.interkom.pl.
  index.pl mail is handled by 10 mx.interkom.net.pl.
  index.pl mail is handled by 10 mx.interkom.pl.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Sun, 15 Apr 2007 15:31:35 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Absolute Path errors
Message-Id: <slrnf252t7.2ru.tadmc@tadmc30.august.net>

skieros <nikos1337@gmail.com> wrote:
> On Apr 15, 12:48 pm, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:
>> On 2007-04-12 09:56, Michele Dondi <bik.m...@tiscalinet.it> wrote:
>>
>> > In particular the URL you expect for it does NOT make any sense, for
>> >http://index.plis not a reasonable URL in any way.
>>
>> Oh, it's perfectly reasonable - for a specific server in Poland :-).
>
> how come? :)


perl -MWWW::Mechanize -e "print WWW::Mechanize->new->head('http://index.pl')->as_string"

HTTP/1.1 200 OK
Connection: close
Date: Sun, 15 Apr 2007 19:30:24 GMT
Accept-Ranges: bytes
ETag: "1399f-38-848e3c80"
Server: Apache/2.0.47 (Debian GNU/Linux) mod_ssl/2.0.47 OpenSSL/0.9.6c
Content-Length: 56
Content-Type: text/html
Last-Modified: Tue, 27 Jul 2004 14:00:02 GMT
Client-Date: Sun, 15 Apr 2007 20:30:19 GMT
Client-Peer: 195.116.236.13:80
Client-Response-Num: 1



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


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

Date: Sun, 15 Apr 2007 08:39:54 -0700
From: Ed Jay <edMbj@aes-intl.com>
Subject: Re: How to transparently download multiple files?
Message-Id: <0mh423hhf3in5eisr94nscopgnb0sek59c@4ax.com>

Charlton Wilbur scribed:

>>>>>> "EJ" == Ed Jay <edMbj@aes-intl.com> writes:
>
>    EJ> BTW, I'll say one thing for your oftentimes verbose posts,
>    EJ> you're an excellent writer. :-)
>
>Logorrhea should not be mistaken for excellence.  
>
I agree, as I'm sure you'd agree that the difference is purely subjective
and oftentimes dependent upon preconceived biases. 
-- 
Ed Jay (remove 'M' to respond by email)


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

Date: 15 Apr 2007 09:25:19 -0700
From: "Xah Lee" <xah@xahlee.org>
Subject: is laziness a programer's virtue?
Message-Id: <1176654319.273907.167280@q75g2000hsh.googlegroups.com>

Laziness, Perl, and Larry Wall

Xah Lee, 20021124

In the unix community there's quite a large confusion and wishful
thinking about the word laziness. In this post, i'd like to make some
clarifications.

American Heritage Dictionary third edition defines laziness as:
=E2=80=9CResistant to work or exertion; disposed to idleness.=E2=80=9D

When the sorcerer Larry Wall said =E2=80=9CThe three chief virtues of a
programmer are: Laziness, Impatience and Hubris=E2=80=9D, he used the word
=E2=80=9Claziness=E2=80=9D to loosely imply =E2=80=9Cnatural disposition th=
at results in being
economic=E2=80=9D. As you can see now, =E2=80=9CResistant to work or exerti=
on=E2=80=9D is
clearly not positive and not a virtue, but =E2=80=9Cnatural disposition that
results in economy=E2=80=9D is a good thing if true.

When Larry Wall said one of programer's virtue is laziness, he wants
the unix morons to conjure up in their brains the following
proposition as true: =E2=80=9CResistant to work or exertion is a natural hu=
man
disposition and such disposition actually results behaviors being
economic=E2=80=9D. This statement may be true, which means that human lazin=
ess
may be intuitively understood from evolution. However, this statement
is a proposition on all human beings, and is not some =E2=80=9Cvirtue=E2=80=
=9D that
can be applied to a group of people such as programers.

Demagogue Larry Wall is smart in creating a confusion combined with
wishful thinking. By making subtle statements like this, he semi-
intentionally confuses average programers to think that it is OK to be
not thorough, it is OK to be sloppy, it is OK to disparage computer
science. (like the incompetent unixers and perlers are)

Can you see the evil and its harm in not understanding things clearly?
This laziness quote by Wall is a tremendous damage to the computing
industry. It is a source among others that spurs much bad fashion
trends and fuckups in the industry. It is more damaging than any
single hack or virus. It is social brain-washing at work, like the
diamond company De Beers' tremendously successful sales slogan: =E2=80=9CA
Diamond is Forever=E2=80=9D or Apple's grammatically fantastic =E2=80=9CThi=
nk
Different=E2=80=9D.

The most fundamental explanation of why Larry Wall's sophistry are
damaging to society is simply this: What he said is not true and they
are widely spread and conceived as worthwhile. This is a form of mis-
information. This is a manifestation of Love without Knowledge as i
expounded before, with subtle but disastrous consequences (already).

[DISCLAIMER: all mentions of real persons are opinion only.]

----
This post is archived at:
http://xahlee.org/UnixResource_dir/writ/perl_laziness.html

  Xah
  xah@xahlee.org
=E2=88=91 http://xahlee.org/



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

Date: Sun, 15 Apr 2007 13:36:43 -0400
From: Ken Tilton <ken@theoryyalgebra.com>
Subject: Re: is laziness a programer's virtue?
Message-Id: <OotUh.14$Uh6.11@newsfe12.lga>



Xah Lee wrote:
> Laziness, Perl, and Larry Wall
> 
> Xah Lee, 20021124
> 
> In the unix community there's quite a large confusion and wishful
> thinking about the word laziness. In this post, i'd like to make some
> clarifications.
> 
> American Heritage Dictionary third edition defines laziness as:
> “Resistant to work or exertion; disposed to idleness.”
> 
> When the sorcerer Larry Wall said “The three chief virtues of a
> programmer are: Laziness, Impatience and Hubris”, he used the word
> “laziness” to loosely imply “natural disposition that results in being
> economic”. As you can see now, “Resistant to work or exertion” is
> clearly not positive and not a virtue, but “natural disposition that
> results in economy” is a good thing if true.
> 
> When Larry Wall said one of programer's virtue is laziness, he wants
> the unix morons to conjure up in their brains the following
> proposition as true: “Resistant to work or exertion is a natural human
> disposition and such disposition actually results behaviors being
> economic”. This statement may be true, which means that human laziness
> may be intuitively understood from evolution. However, this statement
> is a proposition on all human beings, and is not some “virtue” that
> can be applied to a group of people such as programers.

Xah, you are losing your sense of humor. Wall listed the usually 
pejorative "lazy" as a virtue simply to grab the reader, make them 
think, and simply to entertain better. Surely The Great Xah understands 
the virtue of flamboyant writing and does not want every word yanked 
from context and slid under the microscope for dissection.

kzo

-- 
http://www.theoryyalgebra.com/

"Algebra is the metaphysics of arithmetic." - John Ray

"As long as algebra is taught in school,
there will be prayer in school." - Cokie Roberts

"Stand firm in your refusal to remain conscious during algebra."
    - Fran Lebowitz

"I'm an algebra liar. I figure two good lies make a positive."
    - Tim Allen



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

Date: Sun, 15 Apr 2007 13:22:46 -0500
From: Dan Bensen <randomgeek@cyberspace.net>
Subject: Re: is laziness a programer's virtue?
Message-Id: <evtq87$hli$1@wildfire.prairienet.org>

Xah Lee wrote:
> Laziness, Perl, and Larry Wall
> When the sorcerer Larry Wall said “The three chief virtues of a
> programmer are: Laziness, Impatience and Hubris”, he used the word
> “laziness” to loosely imply “natural disposition that results in being
> economic”.

Programming by definition is the process of automating repetitive 
actions to reduce the human effort required to perform them.  A good 
programmer faced with a hard problem always looks for ways to make 
his|her job easier by delegating work to a computer.  That's what Larry 
means.  Automation is MUCH more effective than repetition.

-- 
Dan
www.prairienet.org/~dsb/


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

Date: 15 Apr 2007 12:00:15 -0700
From: "Daniel Gee" <zefria@gmail.com>
Subject: Re: is laziness a programer's virtue?
Message-Id: <1176663615.592055.45720@l77g2000hsb.googlegroups.com>

You fail to understand the difference between passive laziness and
active laziness. Passive laziness is what most people have. It's
active laziness that is the virtue. It's the desire to go out and /
make sure/ that you can be lazy in the future by spending just a
little time writing a script now. It's thinking about time
economically and acting on it.



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

Date: 15 Apr 2007 12:08:01 -0700
From: "Kay Schluehr" <kay.schluehr@gmx.net>
Subject: Re: is laziness a programer's virtue?
Message-Id: <1176664081.454781.46060@n76g2000hsh.googlegroups.com>

On Apr 15, 6:25 pm, "Xah Lee" <x...@xahlee.org> wrote:
> Laziness, Perl, and Larry Wall
>
> Xah Lee, 20021124
>
> In the unix community there's quite a large confusion and wishful
> thinking about the word laziness. In this post, i'd like to make some
> clarifications.
>
> American Heritage Dictionary third edition defines laziness as:
> =E2=80=9CResistant to work or exertion; disposed to idleness.=E2=80=9D
>
> When the sorcerer Larry Wall said =E2=80=9CThe three chief virtues of a
> programmer are: Laziness, Impatience and Hubris=E2=80=9D, he used the word
> =E2=80=9Claziness=E2=80=9D to loosely imply =E2=80=9Cnatural disposition =
that results in being
> economic=E2=80=9D. As you can see now, =E2=80=9CResistant to work or exer=
tion=E2=80=9D is
> clearly not positive and not a virtue, but =E2=80=9Cnatural disposition t=
hat
> results in economy=E2=80=9D is a good thing if true.
>
> When Larry Wall said one of programer's virtue is laziness, he wants
> the unix morons to conjure up in their brains the following
> proposition as true: =E2=80=9CResistant to work or exertion is a natural =
human
> disposition and such disposition actually results behaviors being
> economic=E2=80=9D. This statement may be true, which means that human laz=
iness
> may be intuitively understood from evolution. However, this statement
> is a proposition on all human beings, and is not some =E2=80=9Cvirtue=E2=
=80=9D that
> can be applied to a group of people such as programers.
>
> Demagogue Larry Wall is smart in creating a confusion combined with
> wishful thinking. By making subtle statements like this, he semi-
> intentionally confuses average programers to think that it is OK to be
> not thorough, it is OK to be sloppy, it is OK to disparage computer
> science. (like the incompetent unixers and perlers are)
>
> Can you see the evil and its harm in not understanding things clearly?
> This laziness quote by Wall is a tremendous damage to the computing
> industry. It is a source among others that spurs much bad fashion
> trends and fuckups in the industry. It is more damaging than any
> single hack or virus. It is social brain-washing at work, like the
> diamond company De Beers' tremendously successful sales slogan: =E2=80=9CA
> Diamond is Forever=E2=80=9D or Apple's grammatically fantastic =E2=80=9CT=
hink
> Different=E2=80=9D.
>
> The most fundamental explanation of why Larry Wall's sophistry are
> damaging to society is simply this: What he said is not true and they
> are widely spread and conceived as worthwhile. This is a form of mis-
> information. This is a manifestation of Love without Knowledge as i
> expounded before, with subtle but disastrous consequences (already).
>
> [DISCLAIMER: all mentions of real persons are opinion only.]
>
> ----
> This post is archived at:http://xahlee.org/UnixResource_dir/writ/perl_laz=
iness.html
>
>   Xah
>   x...@xahlee.org
> =E2=88=91http://xahlee.org/

I like Larry Wall, despite being not a Perl programmer, and when he
secretly subverts the american, protestant working ethos I like him
even better :)



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

Date: Sun, 15 Apr 2007 22:43:09 +0200
From: "John Thingstad" <john.thingstad@chello.no>
Subject: Re: is laziness a programer's virtue?
Message-Id: <op.tqueh7i2pqzri1@pandora.upc.no>

On Sun, 15 Apr 2007 18:25:19 +0200, Xah Lee <xah@xahlee.org> wrote:

> Laziness, Perl, and Larry Wall
>
> Xah Lee, 20021124
>
> In the unix community there's quite a large confusion and wishful
> thinking about the word laziness. In this post, i'd like to make some
> clarifications.
>
> American Heritage Dictionary third edition defines laziness as:
> “Resistant to work or exertion; disposed to idleness.”
>

In this context I think you can safely take it to mean:
Don't work hard, work smart.

Avoid repetitious work. If somthing seems to elaborate find a more  
efficient way.

In a course I took on verifiable programming I found working with Hoare  
logic
extremely tedious. So I started using rewriting loops as recursive  
procedures and
using induction instead. It took about a quarter of the time as the  
invariant of a loop
fell out rather naturally this way. I failed the course, but when I took  
the course
over again a year later I noticed that the book had been rewritten and now  
half the book
was dedicated to Generator Induction. (Seems the professor noticed I  
failed in a interesting
way and figured out it was not so stupid after all.) Naturally I had no  
problems the second time ;)

This is just one example but it should convey the idea.

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


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

Date: 15 Apr 2007 12:58:11 -0700
From: "Xah Lee" <xah@xahlee.org>
Subject: Re: is laziness a programer's virtue?
Message-Id: <1176667091.415819.152890@n76g2000hsh.googlegroups.com>

Dear Ken,

I want to thank you for your spirit in supporting and leading the lisp
community, in spreading lisp the language both in what you have done
technically as well as evangelization, as well as the love and
knowledge attitude towards newsgroup communities in general, in part
thru your numerous replies to my posts in the past years. (as opposed
to, the motherfucking pack of driveling and fuckface ignoramuses that
are predominate personalities in newsgroups, including some of the
fucking asshole intolerant bigwigs in the lisp newsgroup who think
themselves as the holder of justice and goodness (which has
contributed significantly to the stagnation of lisp).)

Thank you.

For those reading this, i also want to mention, that although i think
Perl is a motherfucking language on earth, and its leader and
=E2=80=9Cinventor=E2=80=9D Larry Wall has done massive damage to the comput=
ing world,
but Perl the community is in fact very tolerant in general (which is
to Larry's credit), when compared to the motherfucking Pythoners (who
knew SHIT) as well as many of the self-appointed lisp bigwig
characters.

[disclaimer: my statement about Larry Wall is opinion only.]

With Knowledge, and, Love.

  Xah
  xah@xahlee.org
=E2=88=91 http://xahlee.org/

On Apr 15, 10:36=C2=A0am, Ken Tilton <k...@theoryyalgebra.com> wrote:
> XahLeewrote:
> > Laziness, Perl, and Larry Wall
>
> >XahLee, 20021124
>
> > In the unix community there's quite a large confusion and wishful
> > thinking about the word laziness. In this post, i'd like to make some
> > clarifications.
>
> > American Heritage Dictionary third edition defines laziness as:
> > =E2=80=9CResistant to work or exertion; disposed to idleness.=E2=80=9D
>
> > When the sorcerer Larry Wall said =E2=80=9CThe three chief virtues of a
> > programmer are: Laziness, Impatience and Hubris=E2=80=9D, he used the w=
ord
> > =E2=80=9Claziness=E2=80=9D to loosely imply =E2=80=9Cnatural dispositio=
n that results in being
> > economic=E2=80=9D. As you can see now, =E2=80=9CResistant to work or ex=
ertion=E2=80=9D is
> > clearly not positive and not a virtue, but =E2=80=9Cnatural disposition=
 that
> > results in economy=E2=80=9D is a good thing if true.
>
> > When Larry Wall said one of programer's virtue is laziness, he wants
> > the unix morons to conjure up in their brains the following
> > proposition as true: =E2=80=9CResistant to work or exertion is a natura=
l human
> > disposition and such disposition actually results behaviors being
> > economic=E2=80=9D. This statement may be true, which means that human l=
aziness
> > may be intuitively understood from evolution. However, this statement
> > is a proposition on all human beings, and is not some =E2=80=9Cvirtue=
=E2=80=9D that
> > can be applied to a group of people such as programers.
>
> Xah, you are losing your sense of humor. Wall listed the usually
> pejorative "lazy" as a virtue simply to grab the reader, make them
> think, and simply to entertain better. Surely The GreatXahunderstands
> the virtue of flamboyant writing and does not want every word yanked
> from context and slid under the microscope for dissection.
>
> kzo



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

Date: Sun, 15 Apr 2007 14:38:55 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: looking for some size optimization
Message-Id: <Xns99136C5327E6Aasu1cornelledu@127.0.0.1>

espie@lain.home (Marc Espie) wrote in
news:evt5dp$24ar$1@biggoron.nerim.net: 

> I'm looking at a script that handles a huge amount of data...
> basically, the filenames from +4000 packages in order to recognize
> conflicts. 
> 
> Currently, it builds a big hash through a loop that constructs
> $all_conflict like this:
> 
>         my $file= File::Spec->canonpath($self->fullname());
>      push ${$all_conflict->{$file}}, $pkgname;
> 
 ...

> 
> I'm looking for bright ideas to try and reduce the size used...
> without being too detrimental in terms of speed...

I would consider using a database. If you want to keep everything self-
contained, SQLite is a good choice. Building the database might take some 
time but it should not be too demanding in terms of memory footprint. You 
can then run SELECTs to see conflicting names.

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html



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

Date: 15 Apr 2007 07:16:29 -0700
From: "talan" <anerbenartzi@gmail.com>
Subject: perl.h seems to interfere with fopen or stdio.h
Message-Id: <1176646589.813512.140230@y80g2000hsf.googlegroups.com>

Hi. I'm using ActivePerl and Visual Studio C++ on a win32 machine.
I'm starting to work with embedded perl (in my C++ program).  I get a
run-time error on the line with "fopen".  Any clues?  Thanks:

#include "EXTERN.h"
#include "perl.h"
#pragma comment(lib, "perl58.lib")  //link with perl library

int main(int argc, char* argv[]) {
	FILE* fp = fopen("showtime.pl", "w");
	fclose(fp);
	return 0;
}



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

Date: Sun, 15 Apr 2007 16:24:53 +0200
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: perl.h seems to interfere with fopen or stdio.h
Message-Id: <evtcul$2rr$1@mlucom4.urz.uni-halle.de>

talan wrote:
> Hi. I'm using ActivePerl and Visual Studio C++ on a win32 machine.
> I'm starting to work with embedded perl (in my C++ program).  I get a
> run-time error on the line with "fopen".  Any clues?  Thanks:
> 
> #include "EXTERN.h"
> #include "perl.h"
> #pragma comment(lib, "perl58.lib")  //link with perl library
> 
> int main(int argc, char* argv[]) {
> 	FILE* fp = fopen("showtime.pl", "w");
> 	fclose(fp);
> 	return 0;
> }

I linked perl58 into executables in several projects
produced by VC++6 (VS98) and VS2005. Never ever
there was any problem mit MS' stdio, so I guess
you should check for the existence or writeability
of "showtime.pl".

What exactly are you trying to do on
write-opening a perl script?


Regards

M.


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

Date: Sun, 15 Apr 2007 15:23:22 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Regular expression
Message-Id: <slrnf252dq.2ru.tadmc@tadmc30.august.net>

Peter J. Holzer <hjp-usenet2@hjp.at> wrote:
> On 2007-04-10 21:17, guillaume.carbonneau@gmail.com <guillaume.carbonneau@gmail.com> wrote:


>> $string =~ s/(>.*)(computer)(.*<)/\1my \2\3/igms;


> The "m" doesn't seem to have any effect either.


"m" only affects the ^ and $ anchors.

So it is a no-op for patterns that do not contain those anchors.

(but no sensible person would adopt code that generates easy-to-avoid
 warnings anyway.)


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


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

Date: 15 Apr 2007 11:21:59 -0700
From: jrosik@gmail.com
Subject: Re: Running perl scripts on the fly
Message-Id: <1176661319.313604.11190@b75g2000hsg.googlegroups.com>

Yes Len, I need to do more complex things. The scenario can look like
this:

1. I open a text editor - for example Notepad, Wordpad, Word.
2. I paste some text into this text editor.
3. I press a magic key - let's say I double press the Shift key.
4. A magic window appears and I enter the following script:
  while (<>) {
    next if (/Start ignoring HERE/) .. (/End ingnoring HERE/);
    s/AAA(\d+)(.+?)BBB(\d+)/AAA$3$2BBB$1/;
    print;
  }
5. I execute the script.
6. Now there are two text editor windows - one with the source text

Another variant of the 4th step could be just the removal of comment
marks from the line beginnings:
4.
  while (<>) {
    s/^> >//;
    print;
  }

I am trying to accomplish the most simple way to filter text data
using perl script.

The text data usually come from a "text editor" (it also can be a web
form). I need to pick the data -> process it -> put it back as
simple / fast as possible.

The problem with common perl filtering process is that:
- I need to save the source data somewhere,
- I need to save the perl script somewhere,
- I need to execute the perl script .. "perl script.pl data.txt",
- I need to capture the output,

Regards,
Jiri Rosicky

l v napsal:
> jrosik@gmail.com wrote:
> > Hi all,
> >
> > I would like to run perl scripts as in the following scenario:
> >
> > 1. I open a text editor - for example Notepad, Wordpad, Word.
> > 2. I paste some text into this text editor.
> > 3. I press a magic key - let's say I double press the Shift key.
> > 4. A magic window appears and I enter the following script:
> >   while (<>) {
> >     s/you/You/;
> >     print;
> >   }
> > 5. I execute the script.
> > 6. Now there are two text editor windows - one with the source text
> > and another with the output text.
> >
> > Is this possible?
> >
> > One note: I have not saved any document during my scenario!
> >
> > Regards,
> > Jiri Rosicky
> >
>
> Are you trying to run more complex Perl scripts than what you listed in
> step 4?  If not, the magic key in notepad is Control-H.
>
> What are you really trying to accomplish?
>
> --
>
> Len



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

Date: Sun, 15 Apr 2007 18:51:41 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Script to know who clicked a link?
Message-Id: <kol423tr7hqo21tvgvcrcmsnef3ij8vvcm@4ax.com>

On Sun, 15 Apr 2007 13:04:02 +0200, "Peter J. Holzer"
<hjp-usenet2@hjp.at> wrote:

>> Yes: it depends on the actual forum. And yes: you probably want to do
>> this in JS if the site permits that
>
>Which forum would allow that (I mean intentionally - of course lots of
>forums don't sanitize their input properly)? I'd certainly give such a
>site a wide berth.

Which reminds me of the MySpace Worm story that happened to read some
time ago:

http://blog.outer-court.com/archive/2005-10-14-n81.html
http://namb.la/popular/tech.html

>> - it's obvious that this must be done on the client of the person who
>> clicks the link!
>
>Or on the server where the link resides. Doing something like 
>
>print a({-href => ("$url?name=" . remote_user)}, click here)
>
>is easy. But of course you can do that only on your own server(s).

Indeed it's still not entirely clear to me what that the OP wants to
do. But AIUI it's about posting a link in a forum of which he has no
control (I measn, as an admin or a webmaster) and being reported the
forum's username of people who click on said link. I hope not to have
understood correctly.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

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


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