[25103] in Perl-Users-Digest
Perl-Users Digest, Issue: 7353 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 3 06:05:32 2004
Date: Wed, 3 Nov 2004 03:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 3 Nov 2004 Volume: 10 Number: 7353
Today's topics:
Re: Check POP3 E-mail (krakle)
FAQ 6.17: Why don't word-boundary searches with "\b" wo <comdog@panix.com>
FAQ 7.14: How can I pass/return a {Function, FileHandle <comdog@panix.com>
Re: Global @INC <vetro@online.no>
Indexing word documents with perl? (Elhanan Maayan)
Jumping to machine code <nospam@example.com>
Re: Jumping to machine code <andrew@bryson.co.nz>
Re: Jumping to machine code <nospam@example.com>
Re: Partly OT: name suggestion <vetro@online.no>
Performance: longest prefix length <a@ry.ca>
Re: Performance: longest prefix length <tassilo.von.parseval@rwth-aachen.de>
Re: Performance: longest prefix length (Anno Siegel)
Re: Performance: longest prefix length <tassilo.von.parseval@rwth-aachen.de>
Re: Perl CGI project ideas <1usa@llenroc.ude.invalid>
Re: perl self generating program (Yahav Bar yosef)
Re: perl self generating program <bernard.el-haginDODGE_THIS@lido-tech.net>
Re: perl self generating program <sholden@flexal.cs.usyd.edu.au>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 2 Nov 2004 22:58:57 -0800
From: krakle@visto.com (krakle)
Subject: Re: Check POP3 E-mail
Message-Id: <237aaff8.0411022258.4b37ab88@posting.google.com>
"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message news:<Xns9595BC995A87asu1cornelledu@132.236.56.8>...
> wana <ioneabu@yahoo.com> wrote in
> news:10og3oan8mlj02e@news.supernews.com:
>
> > Tihana wrote:
> >
> >> How to check E-mail in POP3 mailbox,
> >> if there have world "Congratulation" in subject.
> >>
> >> TNX
> >
> > This might work. I modified the example from Mail::POP3Client docs.
> > I did not test so it may be wrong.
>
> Why post it then?
>
> > #! /usr/bin/perl
> >
> > use strict;
> > use warnings;
> > my @message = ();
>
> There is no need to explictly initialize my variables.
How about for resetting purposes in mod_perl?
------------------------------
Date: Wed, 3 Nov 2004 11:03:01 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 6.17: Why don't word-boundary searches with "\b" work for me?
Message-Id: <cmadt4$e6s$1@reader1.panix.com>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.
--------------------------------------------------------------------
6.17: Why don't word-boundary searches with "\b" work for me?
Two common misconceptions are that "\b" is a synonym for "\s+" and that
it's the edge between whitespace characters and non-whitespace
characters. Neither is correct. "\b" is the place between a "\w"
character and a "\W" character (that is, "\b" is the edge of a "word").
It's a zero-width assertion, just like "^", "$", and all the other
anchors, so it doesn't consume any characters. perlre describes the
behavior of all the regex metacharacters.
Here are examples of the incorrect application of "\b", with fixes:
"two words" =~ /(\w+)\b(\w+)/; # WRONG
"two words" =~ /(\w+)\s+(\w+)/; # right
" =matchless= text" =~ /\b=(\w+)=\b/; # WRONG
" =matchless= text" =~ /=(\w+)=/; # right
Although they may not do what you thought they did, "\b" and "\B" can
still be quite useful. For an example of the correct use of "\b", see
the example of matching duplicate words over multiple lines.
An example of using "\B" is the pattern "\Bis\B". This will find
occurrences of "is" on the insides of words only, as in "thistle", but
not "this" or "island".
--------------------------------------------------------------------
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-2002 Tom Christiansen and Nathan
Torkington, and other contributors as noted. All rights
reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
------------------------------
Date: Wed, 3 Nov 2004 05:03:01 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 7.14: How can I pass/return a {Function, FileHandle, Array, Hash, Method, Regex}?
Message-Id: <cm9oq5$92i$1@reader1.panix.com>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.
--------------------------------------------------------------------
7.14: How can I pass/return a {Function, FileHandle, Array, Hash, Method, Regex}?
With the exception of regexes, you need to pass references to these
objects. See "Pass by Reference" in perlsub for this particular
question, and perlref for information on references.
See ``Passing Regexes'', below, for information on passing regular
expressions.
Passing Variables and Functions
Regular variables and functions are quite easy to pass: just pass in
a reference to an existing or anonymous variable or function:
func( \$some_scalar );
func( \@some_array );
func( [ 1 .. 10 ] );
func( \%some_hash );
func( { this => 10, that => 20 } );
func( \&some_func );
func( sub { $_[0] ** $_[1] } );
Passing Filehandles
As of Perl 5.6, you can represent filehandles with scalar variables
which you treat as any other scalar.
open my $fh, $filename or die "Cannot open $filename! $!";
func( $fh );
sub func {
my $passed_fh = shift;
my $line = <$fh>;
}
Before Perl 5.6, you had to use the *FH or "\*FH" notations. These
are "typeglobs"--see "Typeglobs and Filehandles" in perldata and
especially "Pass by Reference" in perlsub for more information.
Passing Regexes
To pass regexes around, you'll need to be using a release of Perl
sufficiently recent as to support the "qr//" construct, pass around
strings and use an exception-trapping eval, or else be very, very
clever.
Here's an example of how to pass in a string to be regex compared
using "qr//":
sub compare($$) {
my ($val1, $regex) = @_;
my $retval = $val1 =~ /$regex/;
return $retval;
}
$match = compare("old McDonald", qr/d.*D/i);
Notice how "qr//" allows flags at the end. That pattern was compiled
at compile time, although it was executed later. The nifty "qr//"
notation wasn't introduced until the 5.005 release. Before that, you
had to approach this problem much less intuitively. For example,
here it is again if you don't have "qr//":
sub compare($$) {
my ($val1, $regex) = @_;
my $retval = eval { $val1 =~ /$regex/ };
die if $@;
return $retval;
}
$match = compare("old McDonald", q/($?i)d.*D/);
Make sure you never say something like this:
return eval "\$val =~ /$regex/"; # WRONG
or someone can sneak shell escapes into the regex due to the double
interpolation of the eval and the double-quoted string. For example:
$pattern_of_evil = 'danger ${ system("rm -rf * &") } danger';
eval "\$string =~ /$pattern_of_evil/";
Those preferring to be very, very clever might see the O'Reilly
book, *Mastering Regular Expressions*, by Jeffrey Friedl. Page 273's
Build_MatchMany_Function() is particularly interesting. A complete
citation of this book is given in perlfaq2.
Passing Methods
To pass an object method into a subroutine, you can do this:
call_a_lot(10, $some_obj, "methname")
sub call_a_lot {
my ($count, $widget, $trick) = @_;
for (my $i = 0; $i < $count; $i++) {
$widget->$trick();
}
}
Or, you can use a closure to bundle up the object, its method call,
and arguments:
my $whatnot = sub { $some_obj->obfuscate(@args) };
func($whatnot);
sub func {
my $code = shift;
&$code();
}
You could also investigate the can() method in the UNIVERSAL class
(part of the standard perl distribution).
--------------------------------------------------------------------
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-2002 Tom Christiansen and Nathan
Torkington, and other contributors as noted. All rights
reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
------------------------------
Date: Wed, 03 Nov 2004 09:19:31 +0100
From: "Vetle Roeim" <vetro@online.no>
Subject: Re: Global @INC
Message-Id: <opsgvqqtp63hk3cf@quickfix.opera.com>
On Tue, 2 Nov 2004 12:26:50 -0800, William Ahern
<william@wilbur.25thandClement.com> wrote:
[...]
> The problem I'm trying to solve is more-or-less a practical one here at
> work. We have lots of code I'd like to break apart into sensible modules
> so
> we can reuse out collective efforts. And I'd like to keep the barrier low
> for the rest of the team, so that I can simply say: `use Foo::Bar`,
> instead
> of, `First, edit your @INC path to include /some/long/obscure/path....'.
> Also, including the path in the code is a pain because then it's
> difficult
> to do automatic regression testing using modules in another alternate
> location.
Some (all?) shells have system wide configuration files that are read
before the users own configuration files. If your team members use the
same server, then you could set PERLLIB there.
[...]
--
It's not a bug, it's the future.
------------------------------
Date: 3 Nov 2004 01:02:42 -0800
From: emaayan@hotmail.com (Elhanan Maayan)
Subject: Indexing word documents with perl?
Message-Id: <ec817d75.0411030102.155a41e6@posting.google.com>
hi..
is there a way (or a tutorial/article) that describes methods for perl
to index word that more or less have the same structure(resume
documents),
each word documents should have a subject,description,author keywords
that would be extracted and inserted into it's properties fields by
perl.
------------------------------
Date: Wed, 03 Nov 2004 15:46:47 +0800
From: Derek Fountain <nospam@example.com>
Subject: Jumping to machine code
Message-Id: <41888be4$0$32221$5a62ac22@per-qv1-newsreader-01.iinet.net.au>
I have a string in my Perl which contains the machine code for a short
program I want to run. I want Perl to jump to it. It's the last thing my
script will do, so I don't care about returning safely, etc. Ideally the
Perl will just exit neatly, but I really don't mind. I just need that
machine code to execute. I'm on Win32, but a cross platform method would be
good.
How can I do that?
------------------------------
Date: Wed, 3 Nov 2004 22:17:07 +1300
From: "Andrew Bryson" <andrew@bryson.co.nz>
Subject: Re: Jumping to machine code
Message-Id: <cma7mk$1df$1@lust.ihug.co.nz>
"Derek Fountain" <nospam@example.com> wrote in message
news:41888be4$0$32221$5a62ac22@per-qv1-newsreader-01.iinet.net.au...
>I have a string in my Perl which contains the machine code for a short
> program I want to run. I want Perl to jump to it. It's the last thing my
> script will do, so I don't care about returning safely, etc. Ideally the
> Perl will just exit neatly, but I really don't mind. I just need that
> machine code to execute. I'm on Win32, but a cross platform method would
> be
> good.
>
> How can I do that?
Have you considered putting the machine code into a .com file and just
running it with system() ?
Andrew
------------------------------
Date: Wed, 03 Nov 2004 17:25:33 +0800
From: Derek Fountain <nospam@example.com>
Subject: Re: Jumping to machine code
Message-Id: <4188a30a$0$31917$5a62ac22@per-qv1-newsreader-01.iinet.net.au>
Andrew Bryson wrote:
> Have you considered putting the machine code into a .com file and just
> running it with system() ?
Yes, but the application doesn't easily allow disk access, plus I need
speed. Is that all a .com file is - no headers or other confusing stuff I
would need to generate?
------------------------------
Date: Wed, 03 Nov 2004 10:13:42 +0100
From: "Vetle Roeim" <vetro@online.no>
Subject: Re: Partly OT: name suggestion
Message-Id: <opsgvs84pr3hk3cf@quickfix.opera.com>
On Wed, 03 Nov 2004 00:23:14 +0100, Michele Dondi <bik.mido@tiscalinet.it>
wrote:
[...]
> PerlJutsu
> perljutsu
> Perl-Jutsu
> Perl::Jutsu # because of Perl-ishness!
> etc.
>
> Any suggestion? Preferences?
AFAIK 'jutsu' can be translated as technique and skill, so it's
appropriate. :) I guess the Perlishness should be preferred.
[...]
> [2] Be ready to expect puns on 'Perl-Do' too! ;-)
PerlKwonDo? I.e. the way of Perl and the fist? Hm.
--
It's not a bug, it's the future.
------------------------------
Date: Wed, 3 Nov 2004 00:49:07 -0600
From: Ryan Thompson <a@ry.ca>
Subject: Performance: longest prefix length
Message-Id: <20041102221355.I71781@localhost.my.domain>
Hi all,
I need to find the length of the largest common prefix between two short
strings (1-80 chars). This wouldn't be so bad, if I didn't have to do it
hundreds of millions of times (cross-checking large sets of strings).
Performance is an issue.
After trying a naive method using split // and comparing array elements,
I realized I'd have to get a bit more elaborate. So, I wrote a
simplified regex in the spirit of one I found in an old CLPM post[1].
sub re_prefix_length($$) {
"$_[0]=S=$_[1]" =~ /^(.*).*=S=\1.*$/;
return length($1);
}
&re_prefix_length topped out at about 50,000/second with 5.8.5/FreeBSD.
That result isn't much better than my naive (but still O(n) on string
length) approach with split //, which did 12,000/second. (Yes, I'm just
measuring wall time, and, yes, I understand the limitations).
Not wanting to wait two days for output, I used Inline C like so:
use Inline C => << 'END_C';
int c_prefix_length(const char *s1, const char *s2) {
const char *s1_start = s1;
while ((*s1++ == *s2++) && *s1); /* O(n), string length */
return (s1 - s1_start - 1);
}
END_C
Not too surprisingly, &c_prefix_length averaged about 695,000/second.
Pretty good, considering a no-op Perl sub { return 1; } only did about
395,000/second, and an equivalent Inline C sub did 723,000/second.
Purely for entertainment value, I wrote and compiled pure C with
gcc3.4.2 on FreeBSD. The same C function did 8,905,000/second (9.4M if I
assume the strings are different lengths, which is guaranteed for my
particular application). Either way, it's another order of magnitude, or
about 200 times faster than the fastest native perl code I could come up
with (the regex).
I don't expect Perl to outperform C for something this tight, but it'd
sure be nice to at least be in the ballpark so the native Perl version
doesn't need two days to run, where the native C version needs fifteen
minutes. Is there anything I can do to significantly close that gap?
[1] http://groups.google.ca/groups?selm=654e59%24g392%40eccws1.dearborn.ford.com
- Ryan
--
Ryan Thompson <ryan@sasknow.com>
SaskNow Technologies - http://www.sasknow.com
901-1st Avenue North - Saskatoon, SK - S7K 1Y4
Tel: 306-664-3600 Fax: 306-244-7037 Saskatoon
Toll-Free: 877-727-5669 (877-SASKNOW) North America
------------------------------
Date: Wed, 3 Nov 2004 08:26:01 +0100
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: Performance: longest prefix length
Message-Id: <slrncoh209.qs.tassilo.von.parseval@localhost.localdomain>
Also sprach Ryan Thompson:
> I need to find the length of the largest common prefix between two short
> strings (1-80 chars). This wouldn't be so bad, if I didn't have to do it
> hundreds of millions of times (cross-checking large sets of strings).
> Performance is an issue.
>
> After trying a naive method using split // and comparing array elements,
> I realized I'd have to get a bit more elaborate. So, I wrote a
> simplified regex in the spirit of one I found in an old CLPM post[1].
> sub re_prefix_length($$) {
> "$_[0]=S=$_[1]" =~ /^(.*).*=S=\1.*$/;
> return length($1);
> }
>
> &re_prefix_length topped out at about 50,000/second with 5.8.5/FreeBSD.
> That result isn't much better than my naive (but still O(n) on string
> length) approach with split //, which did 12,000/second. (Yes, I'm just
> measuring wall time, and, yes, I understand the limitations).
re_prefix_length() isn't really an ideal solution. You concatenate two
strings, and then make an awkward pattern match with many '*'s and a
backreference. That has to be slow.
I'd expect this solution to be faster:
sub xor_prefix_length {
my $s = $_[0] ^ $_[1];
$s =~ /^\000+/g and return pos($s);
return 0;
}
> Not wanting to wait two days for output, I used Inline C like so:
> use Inline C => << 'END_C';
> int c_prefix_length(const char *s1, const char *s2) {
> const char *s1_start = s1;
> while ((*s1++ == *s2++) && *s1); /* O(n), string length */
> return (s1 - s1_start - 1);
> }
> END_C
>
> Not too surprisingly, &c_prefix_length averaged about 695,000/second.
> Pretty good, considering a no-op Perl sub { return 1; } only did about
> 395,000/second, and an equivalent Inline C sub did 723,000/second.
>
> Purely for entertainment value, I wrote and compiled pure C with
> gcc3.4.2 on FreeBSD. The same C function did 8,905,000/second (9.4M if I
> assume the strings are different lengths, which is guaranteed for my
> particular application). Either way, it's another order of magnitude, or
> about 200 times faster than the fastest native perl code I could come up
> with (the regex).
The actual bottleneck is not so much the Perl code implementing the
prefix-length but rather the function calls. They are notoriously slow
in perl. If you are using a tight-loop and you do
for my $i (@list1) {
for my $j (@list2) {
print prefix_length($i, $j), "\n";
}
}
perl will spend most of its time calling the function and not so much
running it. Hence, this is a good candidate for inlining. Just don't use
a function but instead copy the function-body to the places where you
are calculating the prefix length.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: 3 Nov 2004 10:20:12 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Performance: longest prefix length
Message-Id: <cmabcs$r7o$1@mamenchi.zrz.TU-Berlin.DE>
Tassilo v. Parseval <tassilo.von.parseval@rwth-aachen.de> wrote in comp.lang.perl.misc:
> Also sprach Ryan Thompson:
>
> > I need to find the length of the largest common prefix between two short
> > strings (1-80 chars). This wouldn't be so bad, if I didn't have to do it
> > hundreds of millions of times (cross-checking large sets of strings).
> > Performance is an issue.
[snip]
> > Not wanting to wait two days for output, I used Inline C like so:
> > use Inline C => << 'END_C';
> > int c_prefix_length(const char *s1, const char *s2) {
> > const char *s1_start = s1;
> > while ((*s1++ == *s2++) && *s1); /* O(n), string length */
> > return (s1 - s1_start - 1);
> > }
> > END_C
> >
> > Not too surprisingly, &c_prefix_length averaged about 695,000/second.
> > Pretty good, considering a no-op Perl sub { return 1; } only did about
> > 395,000/second, and an equivalent Inline C sub did 723,000/second.
[...]
> The actual bottleneck is not so much the Perl code implementing the
> prefix-length but rather the function calls. They are notoriously slow
Absolutely. An inlined function must do quite a bit to amortize the
function call. In the extreme, inlining the addition of two numbers
(say) wouldn't gain anything.
> in perl. If you are using a tight-loop and you do
>
> for my $i (@list1) {
> for my $j (@list2) {
> print prefix_length($i, $j), "\n";
> }
> }
>
> perl will spend most of its time calling the function and not so much
> running it. Hence, this is a good candidate for inlining. Just don't use
> a function but instead copy the function-body to the places where you
> are calculating the prefix length.
I'm not sure what you are saying in the last paragraph.
Overhead could be reduced when we could calculate many prefixes in
a single call. One could use a variant of prefix_length that expects
two sets of n strings each, returning a list of prefix lengths. Each
set could be packed in a single \0-delimited string, though other
schemes are possible. Your loop above would become
print "$_\n" for multi_prefix_length(
scalar @list1, # number of strings, may be unnecessary
join( "\0", @list1, ''),
join( "\0", @list2, ''),
);
If each call worked on just a few hundred strings, I'd guess the
call overhead would become negligible. It isn't pretty, but efficient
code sometimes isn't. Details left to the reader.
Anno
------------------------------
Date: Wed, 3 Nov 2004 11:52:36 +0100
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: Performance: longest prefix length
Message-Id: <slrncohe3k.jqt.tassilo.von.parseval@localhost.localdomain>
Also sprach Anno Siegel:
> Tassilo v. Parseval <tassilo.von.parseval@rwth-aachen.de> wrote in comp.lang.perl.misc:
>> in perl. If you are using a tight-loop and you do
>>
>> for my $i (@list1) {
>> for my $j (@list2) {
>> print prefix_length($i, $j), "\n";
>> }
>> }
>>
>> perl will spend most of its time calling the function and not so much
>> running it. Hence, this is a good candidate for inlining. Just don't use
>> a function but instead copy the function-body to the places where you
>> are calculating the prefix length.
>
> I'm not sure what you are saying in the last paragraph.
See a little further below.
> Overhead could be reduced when we could calculate many prefixes in
> a single call. One could use a variant of prefix_length that expects
> two sets of n strings each, returning a list of prefix lengths. Each
> set could be packed in a single \0-delimited string, though other
> schemes are possible. Your loop above would become
>
> print "$_\n" for multi_prefix_length(
> scalar @list1, # number of strings, may be unnecessary
> join( "\0", @list1, ''),
> join( "\0", @list2, ''),
> );
>
> If each call worked on just a few hundred strings, I'd guess the
> call overhead would become negligible. It isn't pretty, but efficient
> code sometimes isn't. Details left to the reader.
That is roughly what I meant with copy the function-body to the place
where it would otherwise be called. I misworded a bit. :-)
So (code-fiction follows):
sub add {
my ($op1, $op2) = @_;
return $op1 + $op2;
}
for my $i (@list1) {
for my $j (@list2) {
print add($i, $j), "\n";
}
}
would become
for my $i (@list1) {
for my $j (@list2) {
print $i + $j, "\n";
}
}
For this simple example where the function merely adds two numbers, the
gain in speed would be enormous. In this pathological case, this even
holds true for languages with lean function calls such as C.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: 3 Nov 2004 02:25:08 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Perl CGI project ideas
Message-Id: <Xns9595D9E20970Dasu1cornelledu@132.236.56.8>
bharat.shetty@gmail.com wrote in
news:1099447312.300707.292650@f14g2000cwb.googlegroups.com:
> We have a project to develop a simple application on Linux using Perl
> and CGI. I have been totally devoid of ideas for my project becuase
That's your problem, not ours. This is a programming forum. Please go ahead
and read the posting guidelines for this group (they are posted here
regularly and you can also Google for the document).
> I dont have too much time left,
That's your problem.
> really K I S S ideas are requested.
Do we have to exchange fluids?
> Also which books should i read as i am relatively a Perl / CGI newbie
perldoc -q book
Sinan.
------------------------------
Date: 3 Nov 2004 00:33:07 -0800
From: yahavbaryosef@hotmail.com (Yahav Bar yosef)
Subject: Re: perl self generating program
Message-Id: <f98582b7.0411030033.4c120a1@posting.google.com>
Tad McClellan <tadmc@augustmail.com> wrote in message news:<slrncocqvs.q0m.tadmc@magna.augustmail.com>...
> Yahav Bar yosef <yahavbaryosef@hotmail.com> wrote:
>
> > Anyone has something shorter than this ?
> >
> > ****************************************
> >
> > #!/usr/bin/perl
> > open(F,$0);print<F>
>
>
> Sure, an empty file is a shorter "quine" than that one is.
>
> :-)
Hi Tad,
what excactly do you mean by "empty file" ?
------------------------------
Date: Wed, 3 Nov 2004 09:44:01 +0100
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: perl self generating program
Message-Id: <Xns95966303BD9F3elhber1lidotechnet@62.89.127.66>
yahavbaryosef@hotmail.com (Yahav Bar yosef) wrote:
> Tad McClellan <tadmc@augustmail.com> wrote in message
> news:<slrncocqvs.q0m.tadmc@magna.augustmail.com>...
>> Yahav Bar yosef <yahavbaryosef@hotmail.com> wrote:
>>
>> > Anyone has something shorter than this ?
>> >
>> > ****************************************
>> >
>> > #!/usr/bin/perl
>> > open(F,$0);print<F>
>>
>>
>> Sure, an empty file is a shorter "quine" than that one is.
>>
>> :-)
>
> Hi Tad,
> what excactly do you mean by "empty file" ?
How is "empty file" confusing you?
--
Cheers,
Bernard
------------------------------
Date: 3 Nov 2004 09:26:16 GMT
From: Sam Holden <sholden@flexal.cs.usyd.edu.au>
Subject: Re: perl self generating program
Message-Id: <slrncoh91o.278.sholden@flexal.cs.usyd.edu.au>
On 3 Nov 2004 00:33:07 -0800, Yahav Bar yosef <yahavbaryosef@hotmail.com> wrote:
> Tad McClellan <tadmc@augustmail.com> wrote in message news:<slrncocqvs.q0m.tadmc@magna.augustmail.com>...
>> Yahav Bar yosef <yahavbaryosef@hotmail.com> wrote:
>>
>> > Anyone has something shorter than this ?
>> >
>> > ****************************************
>> >
>> > #!/usr/bin/perl
>> > open(F,$0);print<F>
>>
>>
>> Sure, an empty file is a shorter "quine" than that one is.
>>
>> :-)
>
> Hi Tad,
> what excactly do you mean by "empty file" ?
A file with 0 bytes in it. What else could it mean?
You can create one by typing at a shell:
>quine.pl
or
touch quine.pl
or
perl -e"open F, '>quine.pl'"
--
Sam Holden
------------------------------
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 7353
***************************************