[25143] in Perl-Users-Digest
Perl-Users Digest, Issue: 7392 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 11 14:05:37 2004
Date: Thu, 11 Nov 2004 11:05:08 -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 Thu, 11 Nov 2004 Volume: 10 Number: 7392
Today's topics:
Re: 'stat' and it's exceptions (Anno Siegel)
3 Cheers - Spammer gets 9 years in Jail :-) <madra@rua.net>
Re: call pperl from c++ passing token list <usenet@morrow.me.uk>
Re: Extract a number from a string. <usenet@morrow.me.uk>
FAQ 4.66: How can I make my hash remember the order I p <comdog@panix.com>
Re: FAQ 9.16: How do I decode a CGI form? <nobull@mail.com>
Re: FAQ 9.16: How do I decode a CGI form? <comdog@panix.com>
Re: FAQ 9.16: How do I decode a CGI form? <comdog@panix.com>
Re: FAQ 9.16: How do I decode a CGI form? <comdog@panix.com>
Re: hash of hash (a bit long now...) <chp01as@shef.ac.uk>
hash of hash (Andrea Spitaleri)
Re: hash of hash <noreply@gunnar.cc>
Re: hash of hash (Anno Siegel)
Re: hash of hash <do-not-use@invalid.net>
Re: human nature of perl (new operators etc) <jwillmore@fastmail.us>
Re: human nature of perl (new operators etc) <do-not-use@invalid.net>
Re: human nature of perl (new operators etc) <toreau@gmail.com>
Introducing Graph::Clique <ewijaya@singnet.com.sg.removethis>
Re: Is this really legal? <nobull@mail.com>
Need perl+java programmer (surya)
Re: Need perl+java programmer <lwt0301@bellsouth.net>
Re: Overloaded stringification lost (Eric)
Re: perldoc mirror? (Matt C)
Re: perldoc mirror? (Matt C)
Re: perldoc mirror? <cwilbur@mithril.chromatico.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Nov 2004 11:45:06 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: 'stat' and it's exceptions
Message-Id: <cmvjc2$2vf$1@mamenchi.zrz.TU-Berlin.DE>
fred <fred@localhost.net> wrote in comp.lang.perl.misc:
[...]
> If something is in a doc or faq ( and there are people who will take time
> to point off the diff) what does it hurt to discuss it? I mean you can
> ignore it, right?
Man, I'm getting tired of *that* argument.
Yeah, we can ignore postings, what do you think we do? We ignore
postings all day, but only after having read and *understood* enough
to know we want to ignore them. I spend more time on clpm working
through badly posed questions than I spend time answering reasonable
ones. When I had to spend minutes just to find someone is asking a
FAQ again, I feel free to complain.
Anno
------------------------------
Date: Thu, 11 Nov 2004 18:41:52 GMT
From: "Madra Rua" <madra@rua.net>
Subject: 3 Cheers - Spammer gets 9 years in Jail :-)
Message-Id: <QnOkd.24088$KJ6.20877@newsread1.news.pas.earthlink.net>
From http://www.technologyreview.com/articles/04/11/ap_2110304.asp
Two Found Guilty in Nation's First Felony Spam Conviction
November 3, 2004
MATTHEW BARAKAT
Associated Press Writer
LEESBURG, Virginia (AP) _ A brother and sister who sent junk e-mail to
millions of America Online customers were convicted Wednesday in the
first felony prosecution of Internet spam distributors in the United
States.
Jurors recommended that Jeremy Jaynes, 30, be sentenced to nine years
in prison and fined Jessica DeGroot, 28, $7,500 (euro5,880) after
convicting them of three counts each of sending e-mails with
fraudulent and untraceable routing information.
A third defendant, Richard Rutkowski, 30, was acquitted after
deliberations of 1 1/2 days. All three defendants live in the Raleigh,
North Carolina, area.
Prosecutors compared Jaynes and DeGroot to modern-day snake oil
salesmen who use the Internet to peddle junk like a ``FedEx refund
processor'' that supposedly allowed people to earn $75 (euro59) an
hour working from home.
In one month alone, Jaynes received 10,000 credit card orders, each
for $39.95 (euro31.32), for the processor.
``This was just a case of fraud,'' said prosecutor Gene Fishel. ``This
is a snake oil salesman in a new format.''
Prosecutor Russell McGuire said Jaynes amassed a net wealth of $24
million (euro18.8 million) peddling worthless products like the refund
processor and other products like a ``penny stock picker'' and an
Internet history eraser.
``He's been successful ripping people off all these years,'' McGuire
said.
Prosecutors had asked the jury to impose a maximum sentence of 15
years in prison for Jaynes, and to consider some amount of jail time
for his sister, whom they acknowledged was less culpabale.
Defense lawyers asked jurors to spare the defendants prison terms.
David Oblon, representing Jaynes, argued that it was inappropriate for
prosecutors to seek what he called an excessive punishment, given that
this is the first prosecution under the Virginia law. He also noted
that his client, a North Carolina resident, would have been unaware of
the Virginia law.
Oblon called the jury's recommendation of nine years in prison
shocking.
``Nine years is absolutely outrageous when you look at what we do to
people convicted of crimes like robbery and rape,'' Oblon said.
When Jaynes and DeGroot are formally sentenced in February, Circuit
Court Judge Thomas Horne will have the option of reducing the jury's
sentence or leaving it intact. He cannot increase it.
Horne also has not yet ruled on an earlier motion asking that the
cases be dismissed. He said during the trial that he had a hard time
allowing the prosecution of DeGroot and Rutkowski to go forward to the
jury.
The attorney Oblon said Jaynes ``is convinced of his innocence'' and
he expects the conviction will eventually be set aside.
Virginia prosecuted the case under a law that took effect last year
which bars people from sending bulk e-mail that is unsolicited and
masks its origin. AOL, which is based in Dulles, Virginia, is a unit
of New York-based Time Warner Inc.
------------------------------
Date: Thu, 11 Nov 2004 17:42:55 +0000
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: call pperl from c++ passing token list
Message-Id: <vtkc62-bk4.ln1@osiris.mauzo.dyndns.org>
Quoth cs_hart@yahoo.com (Charlie):
> I was thinking of imbedding perl ( it had read that could be done) and
> have the scripts (calculation routines) as external files so that they
> could easily be replaced. I think my biggest problem is changing the
> linked list of c++ tokens ( a class) that is passed to the calculation
> routines, to a similar perl structure. From what I have read so far,
> it appears an array of hash entries would be what I need. I've been
> reading and plying with these, but if you have nay other suggestions
> I'm open to other's experience.
My only suggestion would be to look at Inline::CPP to see if you can use
it to wrap a simple Perl class around your C++ one. I'm not at all sure
how easy it is to get a C++ program to communicate with an Inline::CPP
function in an embedded Perl, but if you're lucky it'll all just work
:).
Ben
--
perl -e'print map {/.(.)/s} sort unpack "a2"x26, pack "N"x13,
qw/1632265075 1651865445 1685354798 1696626283 1752131169 1769237618
1801808488 1830841936 1886550130 1914728293 1936225377 1969451372
2047502190/' # ben@morrow.me.uk
------------------------------
Date: Thu, 11 Nov 2004 17:27:09 +0000
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Extract a number from a string.
Message-Id: <d0kc62-bk4.ln1@osiris.mauzo.dyndns.org>
Quoth Brian McCauley <nobull@mail.com>:
>
>
> Ben Morrow wrote:
>
> > Quoth "Peter Wyzl" <wyzelli@yahoo.com>:
> >
> >>"Adam" <adam_cheney@hotmail.com> wrote in message
> >>news:214d0889.0411080642.7942a3e1@posting.google.com...
> >>
> >>>"Peter Wyzl" <wyzelli@yahoo.com> wrote in message
> >>>news:<CfIjd.27076$K7.12840@news-server.bigpond.net.au>...
> >>
> >><..>
> >>
> >>>($lic_usage{$lic_type}{$max}) = /(\d+)/ if (/Maximum/);
> >>
> >>What happens here when /Maximum/ matches and /(\d+)/ fails to capture
> >>anything?
> >
> > Did you try it? You actually get the empty string.
>
> Did you try it? You actually get the undefined value. :-)
I did, actually, but I missed the brackets around $y in
my ($y) = /(\d+)/ if /Maximum/;
so I got the empty string instead... whoops. :)
Ben
--
Heracles: Vulture! Here's a titbit for you / A few dried molecules of the gall
From the liver of a friend of yours. / Excuse the arrow but I have no spoon.
(Ted Hughes, [ Heracles shoots Vulture with arrow. Vulture bursts into ]
/Alcestis/) [ flame, and falls out of sight. ] ben@morrow.me.uk
------------------------------
Date: Thu, 11 Nov 2004 17:03:01 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 4.66: How can I make my hash remember the order I put elements into it?
Message-Id: <cn0605$j9g$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.
--------------------------------------------------------------------
4.66: How can I make my hash remember the order I put elements into it?
Use the Tie::IxHash from CPAN.
use Tie::IxHash;
tie my %myhash, 'Tie::IxHash';
for (my $i=0; $i<20; $i++) {
$myhash{$i} = 2*$i;
}
my @keys = keys %myhash;
# @keys = (0,1,2,3,...)
--------------------------------------------------------------------
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: Thu, 11 Nov 2004 13:47:18 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: FAQ 9.16: How do I decode a CGI form?
Message-Id: <cmvq8f$1pl$1@sun3.bham.ac.uk>
PerlFAQ Server wrote:
> Make sure you know whether to use a GET or a POST in your form. GETs
> should only be used for something that doesn't update the server.
> Otherwise you can get mangled databases and repeated feedback mail
> messages. The fancy word for this is ``idempotency''. This simply means
> that there should be no difference between making a GET request for a
> particular URL once or multiple times.
Non-sequitur alert! "something that doesn't update the server" is not
the same as "idempotent". Idempotent does indeed mean "no difference
between [...] once or multiple times". But "something that doesn't
update the server" means "no (lasting) difference between zero or
multiple times". It is perfectly reasonable design to have a GET
request change the state of the server (e.g. create a report and
redirect to it) so long as the change is idempotent.
Personsally I think this whole GET/POST idempotency debate is out of
place in the Perl FAQ.
It should simply say "Make sure you know whether to use a GET or a POST
in your form, see ...." and give a reference to a good Web/CGI
programming FAQ.
If people (particularly FAQ mantainers) agree in principle with this
then I'll have a look for a suitable candidate. If not I won't bother.
------------------------------
Date: Thu, 11 Nov 2004 11:07:40 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: FAQ 9.16: How do I decode a CGI form?
Message-Id: <111120041107408749%comdog@panix.com>
In article <Xns959E26D2A1A83ebohlmanomsdevcom@130.133.1.4>, Eric
Bohlman <ebohlman@omsdev.com> wrote:
> PerlFAQ Server <comdog@panix.com> wrote in
> news:cmurq6$82g$1@reader1.panix.com:
>
> > 9.16: How do I decode a CGI form?
> > , or if you're trapped in the
> > module-free land of perl1 .. perl4, you might look into cgi-lib.pl
> > (available from http://cgi-lib.stanford.edu/cgi-lib/ ).
>
> May I suggest that the latter clause no longer belongs in documentation for
> any recent version of Perl?
right. I'll add this deletion to the queue. Thanks.
--
brian d foy, comdog@panix.com
Subscribe to The Perl Review: http://www.theperlreview.com
------------------------------
Date: Thu, 11 Nov 2004 11:11:23 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: FAQ 9.16: How do I decode a CGI form?
Message-Id: <111120041111232129%comdog@panix.com>
In article <2vgv25F2lgk92U1@uni-berlin.de>, Gunnar Hjalmarsson
<noreply@gunnar.cc> wrote:
> PerlFAQ Server wrote:
> > You use a standard module, probably CGI.pm.
> > You'll see a lot of CGI programs that blindly read from STDIN the number
> > of bytes equal to CONTENT_LENGTH for POSTs, or grab QUERY_STRING for
> > decoding GETs. These programs are very poorly written. They only work
> > sometimes.
> > In short, they're bad hacks. Resist them at all costs.
>
> That diatribe is unprofessional, adversely affects the credibility of
> this FAQ entry, and should better be dropped. The above suggestion would
> be a sufficient replacement.
I don't think it's unprofessional (I didn't write it). It is
opinionated, but the so are the people who think they can write their
own parsing code and get it to work. In this case, I think a very
strong statement is appropriate.
--
brian d foy, comdog@panix.com
Subscribe to The Perl Review: http://www.theperlreview.com
------------------------------
Date: Thu, 11 Nov 2004 11:12:28 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: FAQ 9.16: How do I decode a CGI form?
Message-Id: <111120041112286057%comdog@panix.com>
In article <cmvq8f$1pl$1@sun3.bham.ac.uk>, Brian McCauley
<nobull@mail.com> wrote:
> PerlFAQ Server wrote:
> > Make sure you know whether to use a GET or a POST in your form. GETs
> > should only be used for something that doesn't update the server.
> > Otherwise you can get mangled databases and repeated feedback mail
> > messages. The fancy word for this is ``idempotency''. This simply means
> > that there should be no difference between making a GET request for a
> > particular URL once or multiple times.
> Non-sequitur alert! "something that doesn't update the server" is not
> the same as "idempotent". Idempotent does indeed mean "no difference
> between [...] once or multiple times".
Right. I'll fix this. Thanks.
--
brian d foy, comdog@panix.com
Subscribe to The Perl Review: http://www.theperlreview.com
------------------------------
Date: Thu, 11 Nov 2004 16:26:11 +0000
From: andrea spitaleri <chp01as@shef.ac.uk>
Subject: Re: hash of hash (a bit long now...)
Message-Id: <cn03tu$i27$3@hermes.shef.ac.uk>
Hi,
I tried many different ways to resolve it, even if I am still a newbie
in perl. Don't be cruel :) It is not my intention to waste my and your time.
The problem is a bit more complicated. I have a datafile like that:
ala21,-0.03
thr43,0.06
phe124, 0.01
.....
sorted for the number of the first column (21<43), and then I have a
series of files from which I need to parse some data, which are "linked"
to the first column of the datafile. The problem is that in those files
the sequence of the data is unsorted:
first file:
560 <other numbers> -0.04
54 ................. 0.02
235 ................ 0.01
.............
second file:
560 <other numbers> -0.01
54 ................. 0.05
235 ................ 0.03
third file:
560 <other numbers> -0.08
54 ................. 0.1
235 ................ 0.11
and so on.
basicaly:
aa num shift_1 shift_2 shift_3 ....
ala21 -> 54 -> 0.02 0.05 0.1
and so on.
The only way to do it (for me..) is to make an hash between the first
value of the datafile (ala21) with the smallest value of the files, the
second value (thr43) with the second smallest value of the files, and so on.
for doing this I need first of all sort by the key of the second hash
obtained from the files, and then link to datafile
have a look to my script:
#!/usr/bin/perl
use warnings;
use strict;
die "USAGE : $0 shiftfile number\n" if ($#ARGV!=1);
my (@tmp1,@tmp,@aa,@cis,%NEW);
my ($num,$shift,$i);
my $count=0;
open (SFT,"$ARGV[0]") or die "$!";
open (OUT,">tmp.csv") or die "$!";
while (my $line=<SFT>){
chomp $line;
@tmp=split(/,/,$line);
chop $tmp[1];
push @aa,$tmp[0];
push @cis,$tmp[1];
}
foreach my $file (1 .. $ARGV[1]){
open (IN,"rank_$file\.sft") or die "$!";
print "rank_$file\.sft\n";
while(my $lines=<IN>){
chomp $lines;
if($lines=~ /^ Atom number expt ring sp2anis
Efield total/){
$i=0;
while(my $nlines=<IN>){
chomp $nlines;
@tmp1=split(/ +/,$nlines);
$num=$tmp1[1];
$shift=$tmp1[11];
push (@{$NEW{$num}}, $shift);
++$i;
}
}
}
++$count;
}
my $j=0;
foreach my $index (sort {$a<=>$b} keys %NEW){
# print OUT "@{$NEW{$index}} $sft[$j]";
print OUT "$aa[$j] $cis[$j] @{$NEW{$index}}\n";
++$j;
}
print "$i cis and $count files done\n";
print "tmp.csv created. Open it with OOo using space and comma as
separator\n";
That works quite well for giving my what I want. The problem is then if
I want to "transpose" (thanks Arndt) the matrix obtained from that script.
A good idea was to make:
push (@{$TMP{$file}}, $shift};
but the $shift are not linked to the $num, so I cannot link with the
data from datafile anymore.
That why I said hash of hash (or maybe I am still wrong?)
I will try to use your suggestions in the script above.
thanks
regards
xspirix
------------------------------
Date: 11 Nov 2004 03:32:01 -0800
From: spiritelllo@interfree.it (Andrea Spitaleri)
Subject: hash of hash
Message-Id: <4de1519a.0411110332.a8150de@posting.google.com>
Hi everyone,
I am a bit stuck with a script.
Here is the problem:
I have a script wich creates an output like that:
aa1 0.1 0.2 0.55
aa2 -0.4 0.3 -0.4
aa3 0.04 -0.4 0.1
..........
and I would like to "invert" it in:
aa1 aa2 aa3
1 0.1 -0.4 0.04
2 0.2 0.3 -0.4
3 0.55 -0.4 0.1
any idea? I don't post the script because it is quite long.
thanks
regards
xspirix
------------------------------
Date: Thu, 11 Nov 2004 13:07:57 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: hash of hash
Message-Id: <2vh2uiF2m14rbU1@uni-berlin.de>
Andrea Spitaleri wrote:
> I am a bit stuck with a script.
> Here is the problem:
> I have a script wich creates an output like that:
>
> aa1 0.1 0.2 0.55
> aa2 -0.4 0.3 -0.4
> aa3 0.04 -0.4 0.1
> ..........
> and I would like to "invert" it in:
> aa1 aa2 aa3
> 1 0.1 -0.4 0.04
> 2 0.2 0.3 -0.4
> 3 0.55 -0.4 0.1
>
> any idea? I don't post the script because it is quite long.
Then write and post a *small* script that illustrates the problem and
shows the best attempt you have made so far.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 11 Nov 2004 12:31:46 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: hash of hash
Message-Id: <cmvm3i$54g$1@mamenchi.zrz.TU-Berlin.DE>
Andrea Spitaleri <spiritelllo@interfree.it> wrote in comp.lang.perl.misc:
Please use a subject that has something to do with your question.
There's no hash of hashes in what you ask.
> Hi everyone,
> I am a bit stuck with a script.
> Here is the problem:
> I have a script wich creates an output like that:
>
> aa1 0.1 0.2 0.55
> aa2 -0.4 0.3 -0.4
> aa3 0.04 -0.4 0.1
> ..........
> and I would like to "invert" it in:
> aa1 aa2 aa3
> 1 0.1 -0.4 0.04
> 2 0.2 0.3 -0.4
> 3 0.55 -0.4 0.1
So what you want to do is transpose the lines of the first table so
that they become the columns of the second one. Also, you want to
add numbering to the transposed lines. You could have put a little
more effort into explaining this, instead of dropping us an example
and mumbling something about "invert".
> any idea? I don't post the script because it is quite long.
In other words, you haven't tried anything yet. What your script
does to arrive at the original output is irrelevant.
If you have the original lines in @lines, you can do this to get the
columns:
my @cols;
push @cols, [ $_, map shift( @$_), @lines] for '', 1 .. 3;
Anno
------------------------------
Date: 11 Nov 2004 15:10:34 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: hash of hash
Message-Id: <yzdmzxoeasl.fsf@invalid.net>
spiritelllo@interfree.it (Andrea Spitaleri) writes:
> I am a bit stuck with a script.
> Here is the problem:
> I have a script wich creates an output like that:
>
> aa1 0.1 0.2 0.55
> aa2 -0.4 0.3 -0.4
> aa3 0.04 -0.4 0.1
> ..........
> and I would like to "invert" it in:
> aa1 aa2 aa3
> 1 0.1 -0.4 0.04
> 2 0.2 0.3 -0.4
> 3 0.55 -0.4 0.1
"Hash of hash" seems to have very little to do with this problem.
"List of lists" is a little closer, and there are tutorials on
that subject in the supplied documentation.
Also, the word you want may be "transpose", not "invert", at least if
there is a mathematician within hearing distance. (In the database
world, "invert" probably has a meaning distinct from the mathematical
one.)
The program below may be doing something similar to what you want. It
first splits the lines and produces an array of references to arrays
of strings (@table1). It then iterates over all the elements, line by
line, and creates another array of references to arrays of strings
(@table2), and finally prints out @table2 (without line numbers - they
can be added easily).
(I think @lines in Anno's solution corresponds to my @table1, rather
than my @lines.)
It doesn't depend on knowing the dimensions of the table, nor, as as
far I can see, on the table's being rectangular.
I would have liked to get rid of the $j variable. It's probably possible.
#! /usr/bin/perl -w
#use strict;
use diagnostics;
my @lines = <DATA>;
my @table1 = map {my @l = split /\s+/, $_; \@l} @lines;
my @table2;
foreach my $lr (@table1) {
my $j = 0;
push @{$table2[$j++]}, $_ foreach @$lr;
}
foreach my $lr (@table2) {
print " $_" foreach @$lr;
print "\n";
}
__DATA__
aa1 0.1 0.2 0.55
aa2 -0.4 0.3 -0.4
aa3 0.04 -0.4 0.1
------------------------------
Date: Thu, 11 Nov 2004 07:47:59 -0500
From: James Willmore <jwillmore@fastmail.us>
Subject: Re: human nature of perl (new operators etc)
Message-Id: <pan.2004.11.11.12.47.57.449407@fastmail.us>
On Thu, 11 Nov 2004 10:37:10 +0000, I H H wrote:
> perl's syntax is what it is (as I undertood correctly) because it was
> supposed to be like human languages.
> Meaning a word or a phrase has context bind meaning. If context changes, the
> meaning changes too.
> Should there be more human nature properties in perl?
perl has enough ways to do it ... maybe *too* many ways. It gets to a
point that one has to say "enough is enough".
> Could these be useful? At least might make scripting even more faster.
>
> Division operator in string context would be like 'split':
<snip>
IMHO, 'split' works fine the way it is. "If it ain't broke, don't fix it" :-)
> anyone else having crazy ideas like these?
Yes, but I keep these ideas to myself ... people already think I'm crazy
and I don't want to give them any more ammunition :-)
In all seriousness ... if you want to experiment with "wild and crazy"
ways to do it, you could develop your own class(es) and see how much
effort goes into doing it different ways. For example: you could write
your own class to overload the '<=>' (or some other) operator to do what
you propose.
HTH
Jim
------------------------------
Date: 11 Nov 2004 13:58:11 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: human nature of perl (new operators etc)
Message-Id: <yzdr7n0ee58.fsf@invalid.net>
"I H H" <iohihuh@INVALID.yahoo.com> writes:
> Could these be useful? At least might make scripting even more faster.
>
> Division operator in string context would be like 'split':
>
> @cols=split(/$expression/,$line); <=> @cols=$line/$expression;
But wouldn't you still want "424242" / "42" to produce 10101?
------------------------------
Date: Thu, 11 Nov 2004 16:58:09 +0100
From: Tore Aursand <toreau@gmail.com>
Subject: Re: human nature of perl (new operators etc)
Message-Id: <pan.2004.11.11.15.58.09.162781@gmail.com>
On Thu, 11 Nov 2004 10:37:10 +0000, I H H wrote:
> Division operator in string context would be like 'split':
>
> @cols=split(/$expression/,$line); <=> @cols=$line/$expression;
That would fail when you need to evaluate this expression, for instance;
"100" / "10"
Do you want to split on '10', or do you want to divide by ten? I think
'split()' is nice as it is.
> open(F,$file);
> @lines=<F>;
> close(F);
>
> <=>
>
> @lines<$file>\o /\n;
You could always have a "Misc" module in hand, as I do;
my @lines = read_file( $file );
One other approach is to write a filter (using one of the Filter modules)
to do what you want.
> anyone else having crazy ideas like these?
All the time, but I tend to keep them for myself. I don't want one those
white, long-sleeved shirts. :)
--
Tore Aursand <toreau@gmail.com>
"To cease smoking is the easiset thing I ever did. I ought to know,
I've done it a thousand times." (Mark Twain)
------------------------------
Date: Fri, 12 Nov 2004 06:27:50 +0800
From: "Edward Wijaya" <ewijaya@singnet.com.sg.removethis>
Subject: Introducing Graph::Clique
Message-Id: <opshbncoyfavcff0@news.singnet.com.sg>
Hi,
I have put up a module implementating Greg Bacon's
clique reduction with Regex.
It further extend it to return all the cliques,
given graph edges. This is an attempt to
fill the gap which Jarkko's Graph module is missing.
http://search.cpan.org/~ewijaya/Graph-Clique-0.01/Clique.pm
As this is my first CPAN module, it may
have many limitations and caveats.
Therefore I seek gurus enlightenment,
correction, critique on it.
--
Regards,
Edward WIJAYA
SINGAPORE
------------------------------
Date: Thu, 11 Nov 2004 13:29:28 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Is this really legal?
Message-Id: <cmvp6t$vd$1@sun3.bham.ac.uk>
? the Platypus {aka David Formosa} wrote:
> Tad McClellan <tadmc@augustmail.com> writes:
>
>
>>Bradd W. Szonye <bradd+news@szonye.com> wrote:
>>
>>
>>>I had trouble with a very similar construct:
>>>
>>> my $foo = 'stuff' if defined $bar;
>>
>>
>>Me too, which is why I kicked myself when I found it clearly
>>documented, and why I can cite from memory the documentation
>>trail that would have saved me (and you). :-)
>
>
> I'm wondering if that construct should trigger warnings?
I certainly believe it should and I have said so a number of times in
the past.
------------------------------
Date: 11 Nov 2004 08:43:49 -0800
From: surya_sahu@ao.uscourts.gov (surya)
Subject: Need perl+java programmer
Message-Id: <1b8b3ae8.0411110843.689b43a6@posting.google.com>
We need help in moving some software from a Java-Embeded Perl platform
to an all Java environment. This is an VERY URGENT requirement. The
position is in Washington DC. The task initially is for 6 months with
additional work to follow. The client is a branch of Federal
Government. No security clearance of any type is required. We prefer
not to have to sponsor any visa or work permits. Forward resumes
immediately to ssahu@titan.com.
------------------------------
Date: Thu, 11 Nov 2004 13:24:12 -0500
From: Laura <lwt0301@bellsouth.net>
Subject: Re: Need perl+java programmer
Message-Id: <10p7882apm9k4b5@news.supernews.com>
surya wrote:
> We need help in moving some software from a Java-Embeded Perl platform
> to an all Java environment. This is an VERY URGENT requirement. The
> position is in Washington DC. The task initially is for 6 months with
> additional work to follow. The client is a branch of Federal
> Government. No security clearance of any type is required. We prefer
> not to have to sponsor any visa or work permits. Forward resumes
> immediately to ssahu@titan.com.
How did you ever get your Perl patform embedded in Java? What kind of a
crazy scheme was that? I would recommend hiring a Java and a Perl
programmer for this job because Perl is a left-brain language while Java is
right-brain. You are not likely to find someone actively at the top of
their abilities in both languages. About all they have in common is
garbage collection and a common ancestry of C/C++.
Can you afford to hire two programmers instead of just one?
How much does the job pay anyway?
You should check Perljob.com for the Perl guy and java.sun.com for Java.
Good luck!
------------------------------
Date: 11 Nov 2004 09:30:57 -0800
From: jain@gmx.net (Eric)
Subject: Re: Overloaded stringification lost
Message-Id: <835c2e5d.0411110930.6e9539f4@posting.google.com>
> No, AUTOLOAD isn't the culprit.
You're right.
After adding the following code to the _get_scalar method (before
returning the $value) everything works fine:
bless $value, 'Model'
if ref $value eq 'Model';
Weird...
------------------------------
Date: 11 Nov 2004 08:28:47 -0800
From: google@digitalbubblebath.com (Matt C)
Subject: Re: perldoc mirror?
Message-Id: <c06931e3.0411110828.586cb497@posting.google.com>
Hi Paul,
thanks - Dunno how I missed that one, must be tired, although I could
be picky and say its not really a mirror...
I'm surprised that the perldoc.com site isn't widely mirrored to be
honest.
Cheers
Matt
"Paul Lalli" <mritty@gmail.com> wrote in message news:<2n6kd.811$5H4.473@trndny06>...
> "Matt C" <google@digitalbubblebath.com> wrote in message
> news:c06931e3.0411090832.56e4aad3@posting.google.com...
> > is there an alternate location for the documentation that is up on
> > perldoc.com? Over the last few weeks it has gone through periods of
> > timing out on me when trying to search the docs. Can't find a mirror
> > anywhere...
>
> http://www.perlpod.com/5.8.4/pod/perltoc.html
>
> Found as the 10th hit off Google for "perldoc mirror".
>
> You must have an odd definition of "anywhere"...
>
> Paul Lalli
------------------------------
Date: 11 Nov 2004 08:29:43 -0800
From: google@digitalbubblebath.com (Matt C)
Subject: Re: perldoc mirror?
Message-Id: <c06931e3.0411110829.7c8046e9@posting.google.com>
Thanks for the reply- I'm on site tho and the box I'm working on has
no docs installed...
cheers
matt
Sherm Pendley <spamtrap@dot-app.org> wrote in message news:<WNCdnXdWip1ptgzcRVn-tg@adelphia.com>...
> Matt C wrote:
>
> > is there an alternate location for the documentation that is up on
> > perldoc.com?
>
> Yes - your computer.
>
> sherm--
------------------------------
Date: Thu, 11 Nov 2004 18:19:58 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: perldoc mirror?
Message-Id: <871xf08dqi.fsf@mithril.chromatico.net>
>>>>> "MC" == Matt C <google@digitalbubblebath.com> writes:
MC> I'm surprised that the perldoc.com site isn't widely mirrored
MC> to be honest.
It's mirrored on every computer with a complete Perl installation.
The website is redundant.
Charlton
--
cwilbur at chromatico dot net
cwilbur at mac dot com
------------------------------
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 7392
***************************************