[25490] in Perl-Users-Digest
Perl-Users Digest, Issue: 7734 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 4 06:05:35 2005
Date: Fri, 4 Feb 2005 03:05:11 -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 Fri, 4 Feb 2005 Volume: 10 Number: 7734
Today's topics:
Re: [OT] Google Groups posters, please read <tim@vegeta.ath.cx>
Re: a very bad question (and getting OT) <leo.hou@gmail.com>
Re: a very bad question (and getting OT) <do-not-use@invalid.net>
Re: a very bad question (and getting OT) <flavell@ph.gla.ac.uk>
Re: a very bad question (and getting OT) <wh@tever.tld>
Re: a very bad question (and getting OT) <flavell@ph.gla.ac.uk>
Re: a very bad question <do-not-use@invalid.net>
Re: Does perlcc work OK? <tintin@invalid.invalid>
Extracting .jpg from mbox file with MIME::Base64 <SallyShears@gmail.com>
Re: Finding disk space used by Windows or Unix director john_ramsden@sagitta-ps.com
Re: Finding disk space used by Windows or Unix director <joe@inwap.com>
Re: Hash value not being interpolated <evillen@innocent.com>
Re: Invisible cache for LWP / Mechanize? <jakob.fix@gmail.com>
Learning PERL for a new beginner <The2ndspiketoo@webtv.zzn.com>
Re: Learning PERL for a new beginner <spamtrap@dot-app.org>
Re: Newbie asking, interesting question <tadmc@augustmail.com>
Re: OT [Fwd: Fwd: symptoms of a stroke] <matternc@comcast.net>
Re: PAR/PP on Windows XP with ActiveState <astewart1@cox.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 04 Feb 2005 08:10:25 GMT
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: [OT] Google Groups posters, please read
Message-Id: <slrnd06b3m.sio.tim@vegeta.saiyix>
Tim Hammerquist <tim@vegeta.ath.cx> wrote:
> Paul Lalli <mritty@gmail.com> wrote:
> > Recently, this newsgroup has seen a deluge of Google Groups posters
> > who apparently don't read or ignore Google Groups's own advice.
> > I would encourage all Usenet regulars who become annoyed at this
> > tendency to refer the offenders to this policy.
>
> /me awaits the subsequent deluge of "You're not the boss of me!" posts.
For the record, I'm really happy when I'm wrong on these sorts of
predictions. Keep it up!
Tim Hammerquist
------------------------------
Date: 3 Feb 2005 18:35:59 -0800
From: "leo.hou@gmail.com" <leo.hou@gmail.com>
Subject: Re: a very bad question (and getting OT)
Message-Id: <1107484559.109054.282490@c13g2000cwb.googlegroups.com>
I like that "military intelligence" ;-)
Thank you all of you for helping me :-)
------------------------------
Date: 04 Feb 2005 09:48:46 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: a very bad question (and getting OT)
Message-Id: <yzdvf984snl.fsf@invalid.net>
Allen Windhorn <Allen.Windhorn@LSUSA.com> writes:
> chris-usenet@roaima.co.uk writes:
>
> > The noun "pound" is never used for "#" as this word is used[*] for our
> > currency symbol and an (obsolete) imperial weight measurement.
> > ...
> > [*] Actually there are other uses of the noun "pound" but none is for
> > describing the symbol "#".
>
> In American English (an oxymoron, probably) the symbol "#" is actually
> used as an abbreviation for "pound" as in the (not quite obsolete
> here) unit of measurement of mass. It is also used as an abbreviation
> for "number" as in "Bus #21" -- is this also true in England? (I've
> been there, but I don't remember seeing this.)
In the telephone conference system we are using here, a pre-recorded
American voice says "to change settings at any time, press the pound
key", and the # key is meant. What is the # key on a telephone called
in Britain?
------------------------------
Date: Fri, 4 Feb 2005 09:34:41 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: a very bad question (and getting OT)
Message-Id: <Pine.LNX.4.61.0502040919220.8634@ppepc56.ph.gla.ac.uk>
On Fri, 4 Feb 2005, Arndt Jonasson wrote:
> In the telephone conference system we are using here, a pre-recorded
> American voice says "to change settings at any time, press the pound
> key", and the # key is meant.
A pity they don't read the Unicode standard.
> What is the # key on a telephone called in Britain?
To be honest, response systems usually avoid calling it anything at
all.[1] But for the common folk it's known as the "square" button.
The more techie of us call it "hash", of course.
Google suggests
http://spotlight.ccir.ed.ac.uk/public_documents/Dialogue_design_guide/keypad_choices.htm
http://spotlight.ccir.ed.ac.uk/public_documents/technology_reports/No.2%20Key_names.pdf
[1] In contexts where you and I might expect to be invited to
terminate the input with "#", they often tell the user to "press the
star button", instead.
------------------------------
Date: Fri, 04 Feb 2005 09:45:40 +0000
From: Octo Mancer <wh@tever.tld>
Subject: Re: a very bad question (and getting OT)
Message-Id: <pan.2005.02.04.09.45.40.573881@tever.tld>
On Fri, 04 Feb 2005 09:48:46 +0100, Arndt Jonasson wrote:
> In the telephone conference system we are using here, a pre-recorded
> American voice says "to change settings at any time, press the pound key",
> and the # key is meant. What is the # key on a telephone called in
> Britain?
It's always referred to as 'hash'.
------------------------------
Date: Fri, 4 Feb 2005 10:48:08 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: a very bad question (and getting OT)
Message-Id: <Pine.LNX.4.61.0502041047210.8656@ppepc56.ph.gla.ac.uk>
On Fri, 4 Feb 2005, Octo Mancer wrote:
> On Fri, 04 Feb 2005 09:48:46 +0100, Arndt Jonasson wrote:
> > and the # key is meant. What is the # key on a telephone called in
> > Britain?
>
> It's always referred to as 'hash'.
For some small value of "always".
------------------------------
Date: 04 Feb 2005 10:28:37 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: a very bad question
Message-Id: <yzdr7jw4qt6.fsf@invalid.net>
Abigail <abigail@abigail.nl> writes:
> Peter Wyzl (wyzelli@yahoo.com) wrote on MMMMCLXXIV September MCMXCIII in
> <URL:news:D6nMd.146056$K7.70259@news-server.bigpond.net.au>:
> () <leo.hou@gmail.com> wrote in message
> () news:1107394580.644080.49610@c13g2000cwb.googlegroups.com...
> () : Hi guys, prepare for a bad question... I want to know how to pronounce
> () : "~" and "#" in English
> ()
> () ~ is spelt tilde but pronounced tild or tilled
> ()
> () # is called either pound or hash depending whether you speak US English
> () (pound) or UK/Australian English (hash)
>
>
> In Dutch, 'hekje' (meaning "little fence", although the suffix '-je',
> which means "little" is often used for no apparent reason) is often
> used. In the 80s, the term 'spoorwegovergang' ("railroad crossing")
> was sometimes used as well - but that term seemed to have died away
> after September started.
In Swedish, we often say "brädhög", which means heap of planks. The
most common name (at least for telephone use) seems to be "fyrkant",
which means rectangle.
------------------------------
Date: Fri, 4 Feb 2005 22:22:36 +1300
From: "Tintin" <tintin@invalid.invalid>
Subject: Re: Does perlcc work OK?
Message-Id: <36gt3fF4rd2dgU1@individual.net>
<francescomoi@europe.com> wrote in message
news:1107421558.748978.256020@f14g2000cwb.googlegroups.com...
> Hi.
>
> I'm working on Linux Fedora with Perl v5.8.3.
>
> I try to create an executable binary from a simple Perl code
> (hello.pl):
> ----------
> #!/usr/bin/perl
> open (logfile, ">>file.log");
>
> print logfile ("Hello World\n");
> close (logfile);
> -----------
>
> When compiling, I get some strange warnings:
> ----------
> [root@pc]# perlcc hello.pl -o execute
> pccwqCJM.c: In function `perl_init_aaaa':
> pccwqCJM.c:1185: warning: this decimal constant is unsigned only in ISO
> C90
> -----------
>
> But I get an executable. But when trying to execute it:
> -----------
> [root@pc]# ./execute
> panic: invalid pad in pad_sv: 0x8c1e0b8[0x8c2d660] at hello.pl line 3.
> -------------
> Is 'perlgcc' a reliable program? Or is it a fun for geeks?
Find out yourself.
perldoc perlcc
perldoc -q compile
Quick answer is PAR
------------------------------
Date: Thu, 03 Feb 2005 21:40:03 -0500
From: Sally Shears <SallyShears@gmail.com>
Subject: Extracting .jpg from mbox file with MIME::Base64
Message-Id: <030220052140038558%SallyShears@gmail.com>
I have an email message in an mbox file with a jpg attachment.
I want a program I can run with cron or procmail to extract the .jpg
attachment from the last message in the mbox. That is, to store the
.jpg as a normal file to be served up by Apache.
The attachment is encoded base64.
I read the whole encoded portion of the mbox file into a character
string and then attempt to decode it with MIME::Base64::decode($str)
The result is zero length, so MIME::Bae64 must be choking on the
content.
Can anyone give me some advice?
-- Sally
Note: cat mbox-file is the STDIN. Output is >file.jpg
#!/usr/bin/perl
use MIME::Base64;
$inheader=1;
$havedata=0;
while (<>) {
if (/.+/) { # ..any character but line-end
chop;
unless ($inheader) {$encoded=$encoded.$_; $havedata=1;}
}
else {$inheader=0;} #discard blank line; now past hdr
}
if ($havedata) {$decoded=MIME::Base64::decode($encoded); print;}
--
Sally Shears (a.k.a. "Molly")
SallyShears@gmail.com -or- Sally@Shears.org
http://theWorld.com/~sshears
------------------------------
Date: 4 Feb 2005 02:39:01 -0800
From: john_ramsden@sagitta-ps.com
Subject: Re: Finding disk space used by Windows or Unix directory
Message-Id: <1107513541.446071.220440@f14g2000cwb.googlegroups.com>
J=FCrgen Exner wrote:
> john_ramsden@sagitta-ps.com wrote:
> > For Windows and Unix I need a perl module or script[s] that
> > returns the disk space occupied by a specified directory
> > (including all files and subdirectories recursively).
> >
> > I could write one using File::Find or equivalent; but I'd
> > rather not reinvent the wheel if there's already a tried
> > and tested module or code out there, which having spent
> > some fruitless time searching I'm beginning to doubt.
>
> Oh come on, that's a five-liner:
>
> use File::Find;
> my $total;
> sub wanted {$total +=3D -s;}
> find (\&wanted, 'c:/tmp');
> print $total;
Ah OK, that's easier than I thought. Just one footnote though - When I
incorporate this in a module function (using "strict"
and "warnings" as always) it pops up a curious message,
where line 702 was in the _next_ function:
Variable "$total" will not stay shared at WD/Misc.pm line 702.
To eliminate this irritating and baffling message, I had to change "my
$total" to "use vars qw { $total }". God knows why;
it must be some subtle scope issue.
Anyway, thanks for the replies everyone.
------------------------------
Date: Fri, 04 Feb 2005 02:44:57 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: Finding disk space used by Windows or Unix directory
Message-Id: <ONidne52I822z57fRVn-vA@comcast.com>
Jürgen Exner wrote:
> Oh come on, that's a five-liner:
>
> use File::Find;
> my $total;
> sub wanted {$total += -s;}
> find (\&wanted, 'c:/tmp');
> print $total;
That does not return the total disk usage.
You're assuming that a one-byte file takes up just one
byte on the disk, when it really takes up an entire
block (or an entire cluster).
use constant BLOCK => 4096; # May be different on each disk
sub wanted {$total += int ((BLOCK - 1 + -s) / BLOCK) * BLOCK; }
-Joe
------------------------------
Date: 4 Feb 2005 02:32:11 -0800
From: "evillen@innocent.com" <evillen@innocent.com>
Subject: Re: Hash value not being interpolated
Message-Id: <1107513131.462065.8900@c13g2000cwb.googlegroups.com>
xhoster@gmail.com wrote:
> "evillen@innocent.com" <evillen@innocent.com> wrote:
> > Hi
> >
> > Please help, I can't figure out why my hash value not being
> > interpolated correctly?
>
> The problem is that your hash value is not being assigned correctly.
>
> > $symbols_and_data{$symbol_data[0]} = @symbol_data;
>
> The left hand side is a scalar. Which means the right hand side
> is interpreted in scalar context. Using an array in scalar context
> yields the length of the array.
>
> $symbols_and_data{$symbol_data[0]} = \@symbol_data;
> or
> $symbols_and_data{$symbol_data[0]} = [@symbol_data];
> or
> @{$symbols_and_data{$symbol_data[0]}} = @symbol_data;
>
> Read up on perl references and data structures (perldoc perlref,
> perldoc perldata, etc.).
>
> BTW, it doesn't look like you are using warnings or strict. Do so.
>
> Xho
>
> --
> -------------------- http://NewsReader.Com/ --------------------
> Usenet Newsgroup Service $9.95/Month 30GB
Hi Xho
Unfortunately when I use any of the assignments that you suggest I get
the following:
"Hash value is currently: ARRAY(0x1837f84)"
Any ideas?
Thanks for your help
Len
------------------------------
Date: 4 Feb 2005 02:43:15 -0800
From: "jfix" <jakob.fix@gmail.com>
Subject: Re: Invisible cache for LWP / Mechanize?
Message-Id: <1107513795.268349.70370@g14g2000cwa.googlegroups.com>
Gisle,
> > ### create "no-cache" header
> > my $http_headers = HTTP::Headers->new;
> > $http_headers->header("Cache-Control" => "no-cache");
> >
> > ### let's pretend to be the real thing
> > $ua->agent("McAfee AutoUpdate");
> > $ua->default_headers( $http_headers );
>
> Hint: you can shorten this as:
>
> $ua->agent("McAfee AutoUpdate"); # pretend to be the real thing
> $ua->default_header( Cache_Control => "no-cache" );
you're right, of course, as regards the shortcutting. however, using
strict I cannot use the bareword Cache_Control.
thanks for your reply.
--
cheers,
Jakob.
PS: so far so good. no problems yet.
------------------------------
Date: 4 Feb 2005 00:18:41 -0800
From: "Lisa Horton" <The2ndspiketoo@webtv.zzn.com>
Subject: Learning PERL for a new beginner
Message-Id: <1107505121.125224.290500@l41g2000cwc.googlegroups.com>
I hear that PERL is one of the easiest languages to learn. It is easier
than Python or PHP? Is it as useful as those two? I am attracted to
PERL as a first language, but I just want to be sure I will be able to
use it.
Opinions, thoughts, thanks!
------------------------------
Date: Fri, 04 Feb 2005 05:44:07 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Learning PERL for a new beginner
Message-Id: <La6dnVU6epVqzJ7fRVn-3w@adelphia.com>
Lisa Horton wrote:
> I hear that PERL is one of the easiest languages to learn. It is easier
> than Python or PHP? Is it as useful as those two? I am attracted to
> PERL as a first language, but I just want to be sure I will be able to
> use it.
Have a look at:
<http://learn.perl.org>
Ridiculous followup groups removed - this is completely off-topic for
rec.photo.digital et al.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Thu, 3 Feb 2005 22:26:20 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Newbie asking, interesting question
Message-Id: <slrnd05ubc.44e.tadmc@magna.augustmail.com>
Wondering <dbent@comcast.net> wrote:
> Subject: Newbie asking, interesting question
Please put the subject of your article in the Subject of your article.
Your article was not about a newbie asking interesting questions.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 03 Feb 2005 23:04:15 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: OT [Fwd: Fwd: symptoms of a stroke]
Message-Id: <ScednTNbbpKiaZ_fRVn-rQ@comcast.com>
Randal_Schwartzcopf@yahoo.com wrote:
>
>
>>>A cardiologist says if everyone who gets this e-mail sends it to 10
> people,
>>>you can bet that at least one life will be saved.
>
>
>>>BE A FRIEND AND SHARE THIS ARTICLE WITH AS MANY FRIENDS AS
> POSSIBLE. It
>>>could save their lives!
>
>
> use Mail::Sendmail;
use Mail::SpamAssassin;
--
Christopher Mattern
"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
------------------------------
Date: Thu, 03 Feb 2005 19:22:50 -0800
From: Alan Stewart <astewart1@cox.net>
Subject: Re: PAR/PP on Windows XP with ActiveState
Message-Id: <tdq501hfsengjfmd1gngcvbfutpreig8ei@4ax.com>
On 3 Feb 2005 05:30:33 -0800, sigzero@gmail.com wrote:
>I am trying to build an EXE without the Perl DLL included. I run my
>make.bat which contains:
>
>pp --icon app.ico -d -o popups.exe popups.pl
>
>And it errors out with this:
>
>Goto undefined subroutine &DynaLoader::bootstrap_inherit at
>C:/aperl58/lib/XSLoa
>der.pm line 95.
>Compilation failed in require at C:/aperl58/lib/IO/Handle.pm line 260.
>BEGIN failed--compilation aborted at C:/aperl58/lib/IO/Handle.pm line
>260.
>Compilation failed in require at C:/aperl58/lib/IO/Seekable.pm line
>101.
>BEGIN failed--compilation aborted at C:/aperl58/lib/IO/Seekable.pm line
>101.
>Compilation failed in require at C:/aperl58/lib/IO/File.pm line 117.
>BEGIN failed--compilation aborted at C:/aperl58/lib/IO/File.pm line
>117.
>Compilation failed in require at -e line 305.
>BEGIN failed--compilation aborted at -e line 835.
>Cannot open popups.exe for reading: No such file or directory at
>C:/Perl/site/li
>b/Parse/Binary.pm line 611.
>
>I then read the -d switch and it says:
>
>-d, --dependent
>
>Reduce the executable size by not including a copy of perl interpreter.
>Executables built this way will need a separate perl5x.dll or
>libperl.so to function correctly. This option is only available if perl
>is built as a shared library.
>
>The last sentence is what got me. Is the ActiveState distro built as a
>shared library? Or is a lean EXE out of my reach because AS was not
>built that way?
>
>Robert
Try it without the "--icon app.ico". The pp is dying while trying to
read the popups.exe (Parse::Binary.pm), prior to inserting the icon
file. Either this is a bug in pp icon insertion or your icon file is
invalid or too big.
Alan Stewart
------------------------------
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 7734
***************************************