[29658] in Perl-Users-Digest
Perl-Users Digest, Issue: 902 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 3 21:10:17 2007
Date: Wed, 3 Oct 2007 18:09:10 -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 Wed, 3 Oct 2007 Volume: 11 Number: 902
Today's topics:
@_ zero byte problem <dont_bug_me@all.uk>
Re: command for script <jgibson@mail.arc.nasa.gov>
Re: command for script <rvtol+news@isolution.nl>
Re: free utility to create exe <benoit.lefebvre@gmail.com>
Re: I have address book with more than <glennj@ncf.ca>
Re: jabba the tuh <zaxfuuq@invalid.net>
Re: jabba the tuh <zaxfuuq@invalid.net>
Re: jabba the tuh <glennj@ncf.ca>
Re: jabba the tuh <cwilbur@chromatico.net>
Re: jabba the tuh <bik.mido@tiscalinet.it>
Re: jabba the tuh <zaxfuuq@invalid.net>
Re: jabba the tuh <zaxfuuq@invalid.net>
Re: jabba the tuh <zaxfuuq@invalid.net>
Re: jabba the tuh <rvtol+news@isolution.nl>
Re: line 16 <zaxfuuq@invalid.net>
Re: line 16 <kkeller-usenet@wombat.san-francisco.ca.us>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 03 Oct 2007 21:03:09 -0400
From: Jeff <dont_bug_me@all.uk>
Subject: @_ zero byte problem
Message-Id: <13g8elanoj6067e@corp.supernews.com>
I have a sub where I pass in a "binary" and write it to a file
something like:
sub storeImage{
my ($image) = @_;
open(IF,">$ENV{DOCUMENT_ROOT}/test.jpg") or die "$!";
binmode IF;
while (read($image,$Buffer,1024)){print IF $Buffer;}
close (IF)|| die "$!";
}
Now, when I run that it prints a 0 byte file, it didn't used to.
If I modify the script to shift it off like this:
sub storeImage{
my $image=shift;
...}
This works correctly. What has changed on this server that this is
now failing?
Sometimes I like to use @_ because if you have a null element in the
middle of a list being passed in you get it in the correct order while
shifting off a list will get this wrong.
Jeff
------------------------------
Date: Wed, 03 Oct 2007 14:28:05 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: command for script
Message-Id: <031020071428056469%jgibson@mail.arc.nasa.gov>
In article <1191433965.875513.50640@g4g2000hsf.googlegroups.com>,
<jan09876@hotmail.com> wrote:
> A friend wrote for me this little script so I can compare two files
> and have this output.
>
> Common to all files:
> ====================
> Only in '1.txt':
> ====================
> Only in '2.txt':
> ====================
> I did not use the script for a while and now I am not able to find out
> what the command was. I tried different commands but the script keep
> on saying: No such file or directory. I have 1.txt and 2.txt as files
> that I want to compare.
>
>
> ./same.pl -in1 1.txt -in2 2.txt -same out1.txt -diff out2.txt
That line above is, in fact, the command you should use to run your
script, assuming that the script is named 'same.pl', resides in your
current default directory, your computer has the executable
/usr/bin/perl installed, and your input files are named '1.txt' and
'2.txt' in your current default directory. Are all of these things
true? If so, your program should work and it is not clear exactly what
you are asking.
If you are getting the error message 'No such file or directory', then
the input files you have specified on the command line do not exist.
> #!/usr/bin/perl
>
> use strict;
> use Getopt::Long;
>
> my $USAGE =
> "same.pl [--in1 inputfile1 --in2 inputfile2 --same outputSameWords --
> diff outputDiffWords]
> Compares the 2 in files and checks the same and different words";
>
> my %opts;
> GetOptions(\%opts, qw(in1=s in2=s same=s diff=s)) || die $USAGE;
>
> my $fs1 = $opts{in1};
> my $fs2 = $opts{in2};
> my $out1 = $opts{same};
> my $out2 = $opts{diff};
>
> main();
> print "done!";
>
> sub main {
> open (OUT1, ">out1.txt");
The above line should be
open (OUT1, '>', $out1) or die("Can't open $out1 for writing: $!);
to 1) actually use the -same option parameter, 2) use the more reliable
3-argument version of open, and 3) check to see if the open actually
worked.
> open (OUT2, ">out2.txt");
Ditto.
> parse();
> close OUT1;
> close OUT2;
> }
>
> sub parse {
> my $_words1 = getWords($fs1);
> my $_words2 = getWords($fs2);
> for (sort keys %$_words1) {
> if (exists $_words2->{$_}) {
> print OUT1 "$_\n";
> }
> else {
> print OUT2 "$_\n";
> }
> }
> }
This program does not check for words in file 2 that are not in file 1.
That would involve replicating the for loop above but exchanging
$_words1 and $_words2, not printing to OUT1, and opening and printing
to another output file (e.g. OUT3 => 'out3.txt').
>
> sub getWords {
> my $fs = shift;
> my $txt = getFile($fs);
> my %words;
> while ($txt =~ m/(\w+)/g) {
> $words{$1} = 1;
> }
> return \%words;
> }
>
> sub getFile {
> my $fs = shift;
> open (IN, $fs) or die "cant open $fs";
> my $txt = do{local $/;<IN>};
> return $txt;
> }
>
--
Jim Gibson
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: Thu, 4 Oct 2007 00:42:51 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: command for script
Message-Id: <fe1cvd.t8.1@news.isolution.nl>
jan09876@hotmail.com schreef:
> A friend wrote for me this little script so I can compare two files
> and have this output.
> [...]
> I did not use the script for a while and now I am not able to find out
> what the command was.
The script has a usage section, so just start it without any parameters
(or with -h), and it will show the syntax.
(instead of -in1 I guess you need to use --in1, etc.)
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Wed, 03 Oct 2007 13:38:55 -0700
From: Benoit Lefebvre <benoit.lefebvre@gmail.com>
Subject: Re: free utility to create exe
Message-Id: <1191443935.771690.319000@w3g2000hsg.googlegroups.com>
On Oct 3, 2:22 pm, Sean Nakasone <seannakas...@yahoo.com> wrote:
> Is there a free utility to create an exe for windows?
>
> I know about Perl2exe and PerlApp, but those have to be purchased right?
There is something called PAR
http://par.perl.org/wiki/Main_Page
------------------------------
Date: 3 Oct 2007 21:15:32 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: I have address book with more than
Message-Id: <slrnfg81jm.r8a.glennj@smeagol.ncf.ca>
At 2007-10-03 04:04AM, "Bond" wrote:
> How to control witches are bad, so I can delete it.
See if they wear black hats. I understand throwing water on them can
work too.
http://en.wikipedia.org/wiki/Image:MargaretHamiltoninTheWizardOfOz.jpg
--
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry
------------------------------
Date: Wed, 3 Oct 2007 15:04:12 -0700
From: "Wade Ward" <zaxfuuq@invalid.net>
Subject: Re: jabba the tuh
Message-Id: <i6CdneZWu6lRnpnanZ2dnUVZ_ramnZ2d@comcast.com>
"Charlton Wilbur" <cwilbur@chromatico.net> wrote in message
news:877im46vx4.fsf@mithril.chromatico.net...
>>>>>> "WW" == Wade Ward <zaxfuuq@invalid.net> writes:
>
> WW> question 1) How do I use the ppl to get "jabba the hut" as
> WW> output.
>
> print "jabba the hut\n";
>
> If you want more than that, you have to explain clearly where "jabba
> the hut" comes from. And I suspect that once you correctly identify
> that, you'll be very close to solving the problem on your own.
>
Thanks all for replies. Michele errs when he claims that getting plonked by
one of 800 million Indians, because I'm the type of guy who would jusy as
soon blow up your country as talk to you. Idle threat? I can launch a
pound of hamburger from my desk here in abq and hit 60 e to 90 e, the
equator plus 30 in ihat oh I don't, 10^20 times, and depending on how close
I want to get, wipe out 80 percent of India's cows. I don't like being
called an idiot online by a stranger.
Michele and I had a lot of the germane questions ironed out in our personal
correspondednce. They did not survive re-entry to ABQ, and I'll have it
cook again from scratch. I see that I have comment for line 16, and it
looks to be from people who a)know what they're talking about
b) aren't playing a practical joke on me (recall {debug}in the
cunstrcurtprfcrero)
c) c.l.c. is in a straightjacket because of jabba the tuh. They're all
convinced that the only thing you can do is doodle with pointers. I gotta
eat.
Since I committed to lewarning the ppl, I've moved over a thousand miles
throught places like stl a month ago: 101 and humid. My uncle, director of
comp sci at SLU, does not have an airconditioner. If that isn't enough to
pernutmmute my neurons, the poklics e beat me down 4 days ago. It's
actually the reason that I'm not working on what I usually do: they took
turns on my knees. While i might plan to dump hundreds of billions of tons
of hamburger on islamabad, the only thing they heard is what those 8 pieces
of shit are going to hear: plop. Others will hear the boom.
--
wade ward
"The final irony is that cops
and rodney king have the same IQ."
------------------------------
Date: Wed, 3 Oct 2007 15:13:50 -0700
From: "Wade Ward" <zaxfuuq@invalid.net>
Subject: Re: jabba the tuh
Message-Id: <1KKdnaiJUsOTm5nanZ2dnUVZ_q2hnZ2d@comcast.com>
"Glenn Jackman" <glennj@ncf.ca> wrote in message
news:slrnfg7abk.r8a.glennj@smeagol.ncf.ca...
> At 2007-10-02 05:52PM, "Wade Ward" wrote:
>> comment1) if you would like to killfile me, please do so now and save
>> the
>> girlish "plonk" replies; it interrupts my threads. I can assure anyone
>> who
>> wants to killfile me that they are antecedently non-entities in my life.
>
> The obligatory:
> http://www.catb.org/~esr/faqs/smart-questions.html#not_losing
I'll enter that into my favs. I missed what stfw means. I cam make a good
guess on the t and the f.
as to rtfm: I am. Last night, I ripped the camel book into 3 parts. The
index was still all wet, so I'll take it to kinko's to get it bound. I
would prefer that persons who are refering me to information do so with
chapter and verse. I'll give you the chars and a little taste of my
notation:
chapter: §
http://www.zaxfuuq.net/perl4.htm
The perl programming language: ppl
arbitrary int1: 42
arbitrary int2: 100000
arbitrary int3: a billion american: 10^9
biggish arbitrary int1:10^ 42
biggish arbitrary int2:42^ 42
How does one type these numbers with the ppl? How many types are there in
the ppl? Leave out anything more than two levels of indirection on
ppooimnters and user-defined types? I'm guesssing the answer is 42. Do I
go north or south of this number when I enumerate these types?
--
wade ward
"The final irony is that cops
and rodney king have the same IQ."
------------------------------
Date: 3 Oct 2007 21:24:17 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: jabba the tuh
Message-Id: <slrnfg8242.r8a.glennj@smeagol.ncf.ca>
At 2007-10-03 06:13PM, "Wade Ward" wrote:
> "Glenn Jackman" <glennj@ncf.ca> wrote in message
> news:slrnfg7abk.r8a.glennj@smeagol.ncf.ca...
> > http://www.catb.org/~esr/faqs/smart-questions.html#not_losing
> I'll enter that into my favs. I missed what stfw means. I cam make a good
> guess on the t and the f.
Looks like you'll actually have to read that document to find out.
> http://www.zaxfuuq.net/perl4.htm
I don't know why you keep posting these links. I don't follow them and
I suspect lots of others don't. If they are somehow relevant to your
postings, include the text here.
> How does one type these numbers with the ppl? How many types are there in
> the ppl? Leave out anything more than two levels of indirection on
Lots of regulars here bristle unless you talk about Perl or perl. My
suggestion is to suck it up and write "Perl" and not "the ppl".
Actual answers to your questions can be found in the very book you're
reading.
--
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry
------------------------------
Date: 03 Oct 2007 17:21:15 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: jabba the tuh
Message-Id: <873awr6gj8.fsf@mithril.chromatico.net>
>>>>> "WW" == Wade Ward <zaxfuuq@invalid.net> writes:
WW> I don't like being called an idiot online by a stranger.
Then you would do well to post no further incoherent, rambling rants.
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: Thu, 04 Oct 2007 00:19:41 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: jabba the tuh
Message-Id: <9858g3h2fheioovv425k0c06u2j7uukf3o@4ax.com>
On 3 Oct 2007 21:24:17 GMT, Glenn Jackman <glennj@ncf.ca> wrote:
>> How does one type these numbers with the ppl? How many types are there in
>> the ppl? Leave out anything more than two levels of indirection on
>
>Lots of regulars here bristle unless you talk about Perl or perl. My
>suggestion is to suck it up and write "Perl" and not "the ppl".
Yeah... also, "ppl" is one char less than either "perl" or "Perl". But
"the ppl" is three more. I don't really see what's the advantage of
using that spelling that no other one is familiar with, and is likely
to confuse so many people. All in all, an amazing phenomenon...
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: Wed, 3 Oct 2007 16:22:12 -0700
From: "Wade Ward" <zaxfuuq@invalid.net>
Subject: Re: jabba the tuh
Message-Id: <-LGdne-JAJqJi5nanZ2dnUVZ_jidnZ2d@comcast.com>
"Glenn Jackman" <glennj@ncf.ca> wrote in message
news:slrnfg8242.r8a.glennj@smeagol.ncf.ca...
> At 2007-10-03 06:13PM, "Wade Ward" wrote:
>> "Glenn Jackman" <glennj@ncf.ca> wrote in message
>> news:slrnfg7abk.r8a.glennj@smeagol.ncf.ca...
>> > http://www.catb.org/~esr/faqs/smart-questions.html#not_losing
>> I'll enter that into my favs. I missed what stfw means. I cam make a
>> good
>> guess on the t and the f.
>
> Looks like you'll actually have to read that document to find out.
Neah.
>> http://www.zaxfuuq.net/perl4.htm
>
> I don't know why you keep posting these links. I don't follow them and
> I suspect lots of others don't. If they are somehow relevant to your
> postings, include the text here.
It's a screendump. What are you missing?
>> How does one type these numbers with the ppl? How many types are there
>> in
>> the ppl? Leave out anything more than two levels of indirection on
>
> Lots of regulars here bristle unless you talk about Perl or perl. My
> suggestion is to suck it up and write "Perl" and not "the ppl".
they can bristle all they want. i program when i'm injured. i don't have a
left had to hit shift, so ppl is just gonna have to work.
>
> Actual answers to your questions can be found in the very book you're
> reading.
But it's a lot of ddigigng. "concatenate" in the index was compleatly
uninformative.
--
wade ward
"The final irony is that cops
and rodney king have the same IQ."
------------------------------
Date: Wed, 3 Oct 2007 16:23:15 -0700
From: "Wade Ward" <zaxfuuq@invalid.net>
Subject: Re: jabba the tuh
Message-Id: <pLKdnQWoTcvOi5nanZ2dnUVZ_gednZ2d@comcast.com>
"Charlton Wilbur" <cwilbur@chromatico.net> wrote in message
news:873awr6gj8.fsf@mithril.chromatico.net...
>>>>>> "WW" == Wade Ward <zaxfuuq@invalid.net> writes:
>
> WW> I don't like being called an idiot online by a stranger.
>
> Then you would do well to post no further incoherent, rambling rants.
Which rant do you refer to?
--
wade ward
"The final irony is that cops
and rodney king have the same IQ."
------------------------------
Date: Wed, 3 Oct 2007 16:31:29 -0700
From: "Wade Ward" <zaxfuuq@invalid.net>
Subject: Re: jabba the tuh
Message-Id: <YvWdnd95OrzchZnanZ2dnUVZ_ommnZ2d@comcast.com>
"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message
news:9858g3h2fheioovv425k0c06u2j7uukf3o@4ax.com...
> On 3 Oct 2007 21:24:17 GMT, Glenn Jackman <glennj@ncf.ca> wrote:
>
>>> How does one type these numbers with the ppl? How many types are there
>>> in
>>> the ppl? Leave out anything more than two levels of indirection on
>>
>>Lots of regulars here bristle unless you talk about Perl or perl. My
>>suggestion is to suck it up and write "Perl" and not "the ppl".
>
> Yeah... also, "ppl" is one char less than either "perl" or "Perl". But
> "the ppl" is three more. I don't really see what's the advantage of
> using that spelling that no other one is familiar with, and is likely
> to confuse so many people. All in all, an amazing phenomenon...
>
How do you start your own ng, s.t. OE with comcast can find it?
Say . all.allin.all.an.amazingthingsppl.albuquerquephenomenon ?
--
wade ward
"The final irony is that cops
and rodney king have the same IQ."
------------------------------
Date: Thu, 4 Oct 2007 00:50:38 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: jabba the tuh
Message-Id: <fe1di7.1b0.1@news.isolution.nl>
Wade Ward schreef:
> I don't like being called an idiot online by a
> stranger.
Then don't go online.
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Wed, 3 Oct 2007 16:24:42 -0700
From: "Wade Ward" <zaxfuuq@invalid.net>
Subject: Re: line 16
Message-Id: <9u-dnVzU_fk3i5nanZ2dnUVZ_tSknZ2d@comcast.com>
"Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net> wrote in message
news:13g5luqi5jdfhb4@corp.supernews.com...
> On 10/02/2007 05:49 PM, Wade Ward wrote:
>> #!/usr/bin/env perl
>> use strict;
>> use warnings;
>> use Net::NNTP;
>>
>> my $nntp = Net::NNTP->new('newsgroups.comcast.net', Debug => 1 );
>> my $USER = '';
>> my $PASS = '';
>>
>> $nntp->authinfo($USER,$PASS) or die $!;
>>
>>
>> $nntp->group('comp.lang.perl.misc')
>> or die "failed to set group c.l.p.m.\n";
>> my $msg_ids_ref = $nntp->newnews(time() - 24*60*60);
>> die "Failed to retrieve message ids\n" unless @{$msg_ids_ref};
>>
>> open my $ofh, '>', 'articles.txt'
>> or die "Cannot open articles.txt: $!";
>> for my $msg_id (@{$msg_ids_ref}) {
>> $nntp->article($msg_id, $ofh)
>> or die "Failed to retrieve article $msg_id\n";
>> }
>> close $ofh;
>> __END__
>> #end script begin comment
>> q3) Why does perl.exe not like line 16? I've correceted this before but
>> forget how. Thanks in advance.
>>
>> gruss,
>
> Which one is line 16?
>
> Please create a much more descriptive and precise subject line.
Are you dumb?
> Please read and act on the information here:
> http://www.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
Jesus balls. Line 16 from the top. Shebang is number one.
--
------------------------------
Date: Wed, 3 Oct 2007 16:21:51 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: line 16
Message-Id: <gpkdt4xu8t.ln2@goaway.wombat.san-francisco.ca.us>
On 2007-10-03, Wade Ward <zaxfuuq@invalid.net> wrote:
>
> "Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net> wrote in message
> news:13g5luqi5jdfhb4@corp.supernews.com...
>>
>> Please create a much more descriptive and precise subject line.
> Are you dumb?
Who is more dumb, the dumb or the dumb asking other dumb people questions?
>> Please read and act on the information here:
>> http://www.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
>
> Jesus balls. Line 16 from the top. Shebang is number one.
Did you read the URL? You should if you don't want even more people to
killfile you than already have.
--keith
--
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information
------------------------------
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 902
**************************************