[18547] in Perl-Users-Digest
Perl-Users Digest, Issue: 715 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 19 09:26:45 2001
Date: Thu, 19 Apr 2001 06:26:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <987686769-v10-i715@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 19 Apr 2001 Volume: 10 Number: 715
Today's topics:
mkdir and mv <ballmann@co-de.de>
Re: mkdir and mv (Rafael Garcia-Suarez)
Re: mkdir and mv <ballmann@co-de.de>
Re: mkdir and mv <graham.wood@iona.com>
Re: mkdir and mv (Abigail)
Re: mkdir and mv (Abigail)
Re: mkdir and mv <webmaster@webdragon.unmunge.net>
ndbm fails test <rob.novak@home.com>
New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
Newbie question: upgrading Perl <pr1@club-internet.fr>
Re: Newbie question: upgrading Perl <anthony.derobertis@crossmedia.net>
Old Chestnut? DATES!! <19wlr@globalnet.co.uk>
Re: Old Chestnut? DATES!! (Tad McClellan)
Re: One liner - how ? (Gwyn Judd)
Re: One liner - how ? (Gwyn Judd)
Re: One liner - how ? (Mark Jason Dominus)
Re: One liner - how ? (Gwyn Judd)
Re: One liner - how ? (Damian James)
pack/unpack("P") - struct within struct <johnlin@chttl.com.tw>
Re: PERL DBI Problem <ruben@www2.mrbrklyn.com>
Re: PERL DBI Problem (Garry Williams)
Re: PERL DBI Problem <gellyfish@gellyfish.com>
Re: perl to c <scotty99@earthlink.net>
Re: perl to c <root@novastar.dtdns.net>
Re: perl to c <wyzelli@yahoo.com>
Porblems with the Perl Sleep <B.Tijhuis@inter.NL.net>
Re: Porblems with the Perl Sleep (Andrew J. Perrin)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 19 Apr 2001 11:06:25 +0200
From: "Bastian Ballmann" <ballmann@co-de.de>
Subject: mkdir and mv
Message-Id: <20010419.110625.711845894.736@pc035.co-de.de>
Hello everybody! :-)
Iīve another little question. I want to write a perl script to sort my
textfiles. To do this job the script has to make new directories and move
files into it.
I know that there is a shell module and I know that there is the exec
command, but I still canīt solve my stupid problem.
Can anyone explain the syntax of the command, please?
Greetz
Basti
------------------------------
Date: 19 Apr 2001 09:16:11 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: mkdir and mv
Message-Id: <slrn9dtb85.gpv.rgarciasuarez@rafael.kazibao.net>
Bastian Ballmann wrote in comp.lang.perl.misc:
} Hello everybody! :-)
} Iīve another little question. I want to write a perl script to sort my
} textfiles. To do this job the script has to make new directories and move
} files into it.
} I know that there is a shell module and I know that there is the exec
} command, but I still canīt solve my stupid problem.
No need to invoke external commands. Perl has mkdir() and rename()
functions, that do what you want, and that are described in the perlfunc
manual.
--
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Thu, 19 Apr 2001 11:56:27 +0200
From: "Bastian Ballmann" <ballmann@co-de.de>
Subject: Re: mkdir and mv
Message-Id: <20010419.115626.555996658.736@pc035.co-de.de>
Im Artikel <slrn9dtb85.gpv.rgarciasuarez@rafael.kazibao.net> schrieb
"Rafael Garcia-Suarez" <rgarciasuarez@free.fr>:
> Bastian Ballmann wrote in comp.lang.perl.misc: } Hello everybody! :-)
> } Iīve another little question. I want to write a perl script to sort my
> } textfiles. To do this job the script has to make new directories and
> move } files into it.
> } I know that there is a shell module and I know that there is the exec
> } command, but I still canīt solve my stupid problem.
>
> No need to invoke external commands. Perl has mkdir() and rename()
> functions, that do what you want, and that are described in the perlfunc
> manual.
Thanx a lot by now, the mkdir function is usefull and easy to use but
what shall I do with the rename function? I donīt want to rename those
files, I want to move them into my new directory...
------------------------------
Date: Thu, 19 Apr 2001 11:18:49 +0100
From: "Graham Wood" <graham.wood@iona.com>
Subject: Re: mkdir and mv
Message-Id: <9bme41$n7m$1@spider.iona.com>
Bastian Ballmann <ballmann@co-de.de> wrote in message
news:20010419.115626.555996658.736@pc035.co-de.de...
> Im Artikel <slrn9dtb85.gpv.rgarciasuarez@rafael.kazibao.net> schrieb
> "Rafael Garcia-Suarez" <rgarciasuarez@free.fr>:
>
> > Bastian Ballmann wrote in comp.lang.perl.misc: } Hello everybody! :-)
> > } Iīve another little question. I want to write a perl script to sort my
> > } textfiles. To do this job the script has to make new directories and
> > move } files into it.
> > } I know that there is a shell module and I know that there is the exec
> > } command, but I still canīt solve my stupid problem.
> >
> > No need to invoke external commands. Perl has mkdir() and rename()
> > functions, that do what you want, and that are described in the perlfunc
> > manual.
>
> Thanx a lot by now, the mkdir function is usefull and easy to use but
> what shall I do with the rename function? I donīt want to rename those
> files, I want to move them into my new directory...
Renaming is synonymous with moving. For example rename
"this_directory/filename" to "that_directory/filename". Changing the
directory part of the name has the effect of moving the file.
Graham Wood
------------------------------
Date: Thu, 19 Apr 2001 10:29:13 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: mkdir and mv
Message-Id: <slrn9dtffp.5l9.abigail@tsathoggua.rlyeh.net>
Bastian Ballmann (ballmann@co-de.de) wrote on MMDCCLXXXVIII September
MCMXCIII in <URL:news:20010419.110625.711845894.736@pc035.co-de.de>:
;; Hello everybody! :-)
;; Iīve another little question. I want to write a perl script to sort my
;; textfiles. To do this job the script has to make new directories and move
;; files into it.
;; I know that there is a shell module and I know that there is the exec
;; command, but I still canīt solve my stupid problem.
;; Can anyone explain the syntax of the command, please?
Well, what are you trying to do? If you want to write it in the shell,
by all means, write it in the shell. Don't bother with Perl.
Perl does have a primitives to make directories and rename files though.
Why don't you use them?
Abigail
--
$=-=4*++$|;{print$"x--$==>"\@\x7Fy~*kde~box*Zoxf*Bkiaox \r"
^
$/x24if!select$,,$,,$,,join+q=.==>$^W=>$|;$=&&redo}sleep$|;
------------------------------
Date: Thu, 19 Apr 2001 10:30:14 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: mkdir and mv
Message-Id: <slrn9dtfhm.5l9.abigail@tsathoggua.rlyeh.net>
Bastian Ballmann (ballmann@co-de.de) wrote on MMDCCLXXXVIII September
MCMXCIII in <URL:news:20010419.115626.555996658.736@pc035.co-de.de>:
==
== Thanx a lot by now, the mkdir function is usefull and easy to use but
== what shall I do with the rename function? I donīt want to rename those
== files, I want to move them into my new directory...
What do you think "moving into a directory" actually *is*?
Abigail
--
:;$:=~s:
-:;another Perl Hacker
:;chop
$:;$:=~y:;::d;print+Just.$:
------------------------------
Date: 19 Apr 2001 12:14:51 GMT
From: "Scott R. Godin" <webmaster@webdragon.unmunge.net>
Subject: Re: mkdir and mv
Message-Id: <9bmkrr$ljh$1@216.155.32.202>
In article <slrn9dtffp.5l9.abigail@tsathoggua.rlyeh.net>,
abigail@foad.org (Abigail) wrote:
|
| Well, what are you trying to do? If you want to write it in the shell,
| by all means, write it in the shell. Don't bother with Perl.
|
| Perl does have a primitives to make directories and rename files though.
| Why don't you use them?
Oh fine, exploit the primitives.. You'll be sorry when they band
together and overthrow the system.
(-:
--
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw";
# ( damn spammers. *shakes fist* take a hint. =:P )
------------------------------
Date: Mon, 16 Apr 2001 00:18:29 -0400
From: Rob Novak <rob.novak@home.com>
Subject: ndbm fails test
Message-Id: <ndskdtssh0fuu3e2i868tm55j9j431jv98@4ax.com>
I'm building Perl 5.00601 on OpenLinux and "make test" reported errors
with lib/anydbm and lib/ndbm.
Here's the output of the relevant sections of running "perl harness":
lib/anydbm..........ndbm store returned -1, errno 22, key "" at
lib/anydbm.t line 108.
lib/anydbm..........dubious
Test returned status 22 (wstat 5632, 0x1600)
DIED. FAILED tests 8-12
Failed 5/12 tests, 58.33% okay
lib/ndbm............ndbm store returned -1, errno 22, key "" at
lib/ndbm.t line 120.
lib/ndbm............dubious
Test returned status 22 (wstat 5632, 0x1600)
DIED. FAILED tests 8-65
Failed 58/65 tests, 10.77% okay
I've not run across this before when building 5.00503. Can anyone
assist me with finding out what's going on here?
Thanks,
Rob
------------------------------
Date: Mon, 16 Apr 2001 13:40:59 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <tdltjbi39b9437@corp.supernews.com>
Following is a summary of articles from new posters spanning a 7 day
period, beginning at 09 Apr 2001 14:44:20 GMT and ending at
16 Apr 2001 13:45:00 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 2001 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Totals
======
Posters: 99 (33.1% of all posters)
Articles: 202 (19.5% of all articles)
Volume generated: 364.5 kb (18.6% of total volume)
- headers: 167.0 kb (3,284 lines)
- bodies: 194.3 kb (6,639 lines)
- original: 118.3 kb (4,310 lines)
- signatures: 3.0 kb (82 lines)
Original Content Rating: 0.609
Averages
========
Posts per poster: 2.0
median: 1 post
mode: 1 post - 56 posters
s: 2.4 posts
Message size: 1847.9 bytes
- header: 846.7 bytes (16.3 lines)
- body: 984.9 bytes (32.9 lines)
- original: 599.5 bytes (21.3 lines)
- signature: 15.2 bytes (0.4 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
13 32.4 ( 8.9/ 23.5/ 13.0) james freeman <jamesfreeman@MailAndNews.com>
9 19.5 ( 10.8/ 8.6/ 7.3) "Karl Young" <karlyoung@unconscious.co.uk>
8 15.3 ( 4.7/ 10.6/ 4.9) sdfsd <sdfes@dsf.com>
7 20.8 ( 4.3/ 16.5/ 4.9) "Chris A." <chris62vw@hotmail.com>
6 13.1 ( 5.7/ 6.8/ 4.7) Ilmari Karonen <usenet11423@itz.pp.sci.fi>
6 10.0 ( 5.2/ 4.8/ 4.4) "Robb Meade" <robbie@DONTgoofymouseSPAM.freeserve.co.uk>
6 8.4 ( 4.9/ 3.5/ 1.9) "Joseph André" <msoftmonkeySPAM@crosswinds.net>
5 10.5 ( 4.2/ 6.2/ 3.2) Ronda Hauben <ronda@panix.com>
5 9.3 ( 4.6/ 4.7/ 1.8) tuxy <nospam@cfl.rr.com>
4 6.9 ( 3.9/ 3.0/ 1.6) "Christer Holmdahl" <chho@privat.utfors.se>
These posters accounted for 6.7% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
32.4 ( 8.9/ 23.5/ 13.0) 13 james freeman <jamesfreeman@MailAndNews.com>
20.8 ( 4.3/ 16.5/ 4.9) 7 "Chris A." <chris62vw@hotmail.com>
19.5 ( 10.8/ 8.6/ 7.3) 9 "Karl Young" <karlyoung@unconscious.co.uk>
15.3 ( 4.7/ 10.6/ 4.9) 8 sdfsd <sdfes@dsf.com>
13.1 ( 5.7/ 6.8/ 4.7) 6 Ilmari Karonen <usenet11423@itz.pp.sci.fi>
10.5 ( 4.2/ 6.2/ 3.2) 5 Ronda Hauben <ronda@panix.com>
10.0 ( 5.2/ 4.8/ 4.4) 6 "Robb Meade" <robbie@DONTgoofymouseSPAM.freeserve.co.uk>
9.3 ( 4.6/ 4.7/ 1.8) 5 tuxy <nospam@cfl.rr.com>
9.1 ( 4.3/ 4.9/ 1.1) 4 "Atayarani" <amazingkgb@earthlink.net>
8.7 ( 2.1/ 6.5/ 5.1) 2 Ilmari Karonen <usenet11424@itz.pp.sci.fi>
These posters accounted for 7.6% of the total volume.
Top 10 Posters by OCR (minimum of three posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 0.9 / 0.9) 3 "Patrick Carmichael" <p.carmichael@btinternet.com>
1.000 ( 2.0 / 2.0) 4 "RobbieB" <robbie@totaln.com>
1.000 ( 0.3 / 0.3) 3 necro <necrorising@hotmail.com>
0.915 ( 4.4 / 4.8) 6 "Robb Meade" <robbie@DONTgoofymouseSPAM.freeserve.co.uk>
0.846 ( 7.3 / 8.6) 9 "Karl Young" <karlyoung@unconscious.co.uk>
0.751 ( 2.0 / 2.7) 4 xris <xris@dont.send.spam>
0.710 ( 2.1 / 3.0) 4 alaugusto@yahoo.com.br
0.693 ( 4.7 / 6.8) 6 Ilmari Karonen <usenet11423@itz.pp.sci.fi>
0.554 ( 13.0 / 23.5) 13 james freeman <jamesfreeman@MailAndNews.com>
0.549 ( 1.9 / 3.5) 6 "Joseph André" <msoftmonkeySPAM@crosswinds.net>
Bottom 10 Posters by OCR (minimum of three posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.693 ( 4.7 / 6.8) 6 Ilmari Karonen <usenet11423@itz.pp.sci.fi>
0.554 ( 13.0 / 23.5) 13 james freeman <jamesfreeman@MailAndNews.com>
0.549 ( 1.9 / 3.5) 6 "Joseph André" <msoftmonkeySPAM@crosswinds.net>
0.548 ( 0.3 / 0.6) 3 "guillaume" <guillaume.3@free.fr>
0.539 ( 1.6 / 3.0) 4 "Christer Holmdahl" <chho@privat.utfors.se>
0.513 ( 3.2 / 6.2) 5 Ronda Hauben <ronda@panix.com>
0.462 ( 4.9 / 10.6) 8 sdfsd <sdfes@dsf.com>
0.385 ( 1.8 / 4.7) 5 tuxy <nospam@cfl.rr.com>
0.296 ( 4.9 / 16.5) 7 "Chris A." <chris62vw@hotmail.com>
0.221 ( 1.1 / 4.9) 4 "Atayarani" <amazingkgb@earthlink.net>
17 posters (17%) had at least three posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
16 comp.lang.perl.moderated
13 comp.lang.perl.modules
12 alt.perl
10 comp.lang.tcl
9 comp.programming
9 comp.mail.misc
3 de.comp.lang.perl.misc
2 alt.comp.perlcgi.freelance
2 comp.lang.perl
2 de.comp.lang.perl.cgi
Top 10 Crossposters
===================
Articles Address
-------- -------
7 "Jan Klunder" <jklunder@xs4all.nl>
3 "Simon Whittaker" <simonNOSPAM@swbh.net>
3 Jeffrey Hobbs <JeffH@ActiveState.com>
3 Darren New <dnew@san.rr.com>
2 Ian.Phillipps@iname.com
1 "Bosko Mirkic" <bosko.mirkic@zg.tel.hr>
1 Christian Kruse <CK1@wwwtech.de>
1 Jeremy <jeremyk.remove-this@privacy.nu>
1 alaugusto@yahoo.com.br
1 Ilmari Karonen <usenet11427@itz.pp.sci.fi>
------------------------------
Date: Tue, 17 Apr 2001 09:50:00 +0200
From: Philippe de Rochambeau <pr1@club-internet.fr>
Subject: Newbie question: upgrading Perl
Message-Id: <3ADBF5A7.46D1803A@club-internet.fr>
Hello,
how do you upgrade Perl v. 5.6.0 to v. 5.6.1 on Unix (MacOS X -- Unix
BSD 4.4), using CPAN?
Many thanks.
Philippe de Rochambeau
------------------------------
Date: Tue, 17 Apr 2001 13:50:31 -0400
From: "Anthony DeRobertis" <anthony.derobertis@crossmedia.net>
Subject: Re: Newbie question: upgrading Perl
Message-Id: <9bhvp7$bb4$1@bob.news.rcn.net>
In <3ADBF5A7.46D1803A@club-internet.fr>, "Philippe de Rochambeau"
<pr1@club-internet.fr> wrote:
> how do you upgrade Perl v. 5.6.0 to v. 5.6.1 on Unix
perl -MCPAN -e 'install G/GS/GSAR/perl-5.6.1.tar.gz'
Then answer many questions :-)
------------------------------
Date: Thu, 19 Apr 2001 11:48:15 +0100
From: "John Plaxton" <19wlr@globalnet.co.uk>
Subject: Old Chestnut? DATES!!
Message-Id: <tdtglp4gopor47@xo.supernews.co.uk>
Sorry, this is probable an old chestnut.
Has anyone got an easy way to return the first day of the Current/Next year.
I'm using epoch second. I'd prefer it if it gave 12 midday if possible. I
found some FAQ's on this a few months back but can't remember where.
Thanks in advance
John
------------------------------
Date: Thu, 19 Apr 2001 07:55:01 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Old Chestnut? DATES!!
Message-Id: <slrn9dtkgl.2ik.tadmc@tadmc26.august.net>
John Plaxton <19wlr@globalnet.co.uk> wrote:
>
>Has anyone got an easy way to return the first day of the Current/Next year.
>I'm using epoch second. I'd prefer it if it gave 12 midday if possible.
----------------------------
#!/usr/bin/perl -w
use strict;
use Time::Local;
foreach my $year ( 1999 .. 2001 ) {
my $time = timelocal(0, 0, 12, 1, 0, $year);
print scalar localtime($time), " ($time)\n";
}
----------------------------
output:
Fri Jan 1 12:00:00 1999 (915210000)
Sat Jan 1 12:00:00 2000 (946746000)
Mon Jan 1 12:00:00 2001 (978368400)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 16 Apr 2001 11:40:17 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: One liner - how ?
Message-Id: <slrn9dlmgu.obk.tjla@thislove.dyndns.org>
I was shocked! How could hue micheal <huem@MailAndNews.com>
say such a terrible thing:
>>===== Original Message From tjla@guvfybir.qlaqaf.bet (Gwyn Judd) =====
>>I was shocked! How could hue micheal <huem@MailAndNews.com>
>>say such a terrible thing:
>>>$date='hhmissddmmyy';
>>>$date =~ s/(\d{2})/$1:/;
>>>($hh,$mi,$ss,$dd,$mm,$yy) = split(/:/,$date);
>>>
>>>It's basicaly spliting $date into vars $hh, $ss, $mi, $dd, $mm, $yy. Two
>>>characters in each variable.
>>
>>Actually the code above doesn't do what you think. You have two separate
>>bugs. I suggest fixing those before you attempt to put it all on one
>>line (and why you would want to do that, I do not know). You might also
>>want to look into using an array or hash rather than the five
>>short-named variables.
>
>Well, I am learning perl. I can only learn from mistake. You are one that
>learns all by yourself I assume.
Well I am but that's not relevant. Personally I favour giving hints
rather than complete solutions to a problem, you may find it more
difficult to completely solve the problem but you will learn more in the
process.
>If this group is not for novice and the like then I will never come back.
You are welcome to stay here or not. If you post here you should know
that it is generally best to post code that does what you say it does.
Otherwise, people can go off track answering the wrong question, or
point out the bugs in your code, or even get offended that you didn't
take the time to properly test your code. If you have some code that
does something unexpected, you are best to post it and say something
like "I think this code should do 'X' but actually it does 'Y'". That
way, noone is surprised.
>I thought of the example while I was typing so some mistake made, like
>mising a 'g' for example. I hope, people can guess I what I meant.
Well guessing what people want is not always easy or even possible. In
cases like this I try to limit the help I give until it is completely
clear what it is the person is asking, ESP not being one of my strong
points. Additionally I should point out I was merely pointing out a
couple of bugs in your script and suggesting a good way to go about
improving it. After all, it doesn't make any sense to go changing the
way a script is designed until it actually works, at least to my way of
thinking. I also pointed out that you might like to look into a slightly
more advanced data structure as a way of solving your problem. Why you
should take offense at that is really beyond me.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Soylent Green is made out of people!
-Charlton Heston (contributed by Nathan Poznick)
------------------------------
Date: Mon, 16 Apr 2001 21:11:26 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: One liner - how ?
Message-Id: <slrn9dmnvs.rvl.tjla@thislove.dyndns.org>
In article <3adb3430.2bc6$281@news.op.net>,
Mark Jason Dominus <mjd@plover.com> wrote:
>In article <3B261F30@MailAndNews.com>,
>hue micheal <huem@MailAndNews.com> wrote:
>>Well, I am new here and I was shocked to see you start your post with such a
>>offensive sentense, may be you should think about what you wrote.
>
>I find it offensive also, but I guess he thinks it's clever.
>
>Don't let it bother you too much.
Actually I may have thought it was clever when I set it up that way but
I really haven't thought about it in any way for a long time. I'm a bit
bemused that anyone would find it offensive, I guess that's usenet for
you. Anyway you will see that I have now changed the attribution line to
match yours in the hope that people will now stop remarking on it either
positively or negatively.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
"All the excitement has overloaded the pants in my companion here."
--Threepio
"Star Wars A New Hope (tm)", "Pants" Style
------------------------------
Date: Mon, 16 Apr 2001 23:59:58 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: One liner - how ?
Message-Id: <3adb8783.3271$132@news.op.net>
In article <9bfjsv$2km$5@bob.news.rcn.net>,
Eric Bohlman <ebohlman@omsdev.com> wrote:
>Note that following the recommended practice of reading three weeks worth
>of posts in a group before posting to it virtually eliminates such
>suprises;
Gosh, I guess that's what I've been doing wrong.
Thanks Eric!
[going back to newbie lurker mode]
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Tue, 17 Apr 2001 08:20:27 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: One liner - how ?
Message-Id: <slrn9do32i.r9.tjla@thislove.dyndns.org>
In article <slrn9dnu45.e61.damian@puma.qimr.edu.au>,
Damian James <damian@qimr.edu.au> wrote:
>Gwyn Judd chose Mon, 16 Apr 2001 21:11:26 GMT to say this:
>>... Anyway you will see that I have now changed the attribution line to
>>match yours in the hope that people will now stop remarking on it either
>>positively or negatively.
>
>I am saddened by this -- I was actually quite impressed you had managed to
>keep it that way for such a long time. I really find it very hard to
>understand how anyone could find the 'I was shocked...' bit offensive. Oh
>well, all part of life's rich tapestry...
Not to worry, I expect that in another couple of years I'll change it to
something offensive again ;)
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Time is nature's way of keeping everything from happening all at
once. History simply documents the success of that approach.
------------------------------
Date: 17 Apr 2001 08:03:38 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: One liner - how ?
Message-Id: <slrn9dnu45.e61.damian@puma.qimr.edu.au>
Gwyn Judd chose Mon, 16 Apr 2001 21:11:26 GMT to say this:
>... Anyway you will see that I have now changed the attribution line to
>match yours in the hope that people will now stop remarking on it either
>positively or negatively.
>
I am saddened by this -- I was actually quite impressed you had managed to
keep it that way for such a long time. I really find it very hard to
understand how anyone could find the 'I was shocked...' bit offensive. Oh
well, all part of life's rich tapestry...
Cheers,
Damian
--
@:=grep!($;+=m!$/|#!),split//,<DATA>;@;=0..$#:;while(@;){for($;=@;;--$;;){;(
$:=rand$;+$|)==$;&&next;@;[$;,$:]=@;[$:,$;]}push@|,shift@;if$;[0]==@|;select
$,,$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/} __END__
Just another Perl Hacker # rev 3 -- a JAPH in progress, I guess...
------------------------------
Date: Wed, 18 Apr 2001 10:58:22 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: pack/unpack("P") - struct within struct
Message-Id: <9bivoo$3fe@netnews.hinet.net>
Dear all,
I am learning pack/unpack with "P" template.
I know it can deal with "struct within struct" data.
Lacking of examples, I can only learn by errors.
# struct S { long a; struct S *p; long b; };
# struct S s,t;
# s.a = 1; s.b = 2; s.p = NULL;
# t.a = 3; t.b = 4; t.p = &s;
my $s = pack("L P L",1,undef,2);
my $t = pack("L P L",3,$s,4);
my($t_a,$t_p,$t_b) = unpack("L P L",$t);
my($s_a,$s_p,$s_b) = unpack("L P L",$t_p);
print "t.a = $t_a\n";
print "t.p = $t_p\n";
print "t.b = $t_b\n";
print "s.a = $s_a\n";
print "s.p = $s_p\n";
print "s.b = $s_b\n";
I know it doesn't work. Can you show me the correct way?
Thank you.
John Lin
------------------------------
Date: Sun, 15 Apr 2001 19:38:43 +0400
From: "Brooklyn Linux Solutions CEO" <ruben@www2.mrbrklyn.com>
Subject: Re: PERL DBI Problem
Message-Id: <20010415.192351.1242608872.9754@www2.mrbrklyn.com>
What is this $arr[time]?
ruben@www2:~/export/ruben > perl -e "use strict; $arr[time] = 3; print $arr[time]"
Can't modify single ref constructor in scalar assignment at -e line 1, near "3;"
Execution of -e aborted due to compilation errors.
Ruben
In article <Q00C6.1700$q51.10779@news1.gvcl1.bc.home.com>, peter@psdt.com
wrote:
> In a typo in
> the Perl program. e.g., `$arr[time]' instead of
> `$arr[$time]'.
>
------------------------------
Date: Mon, 16 Apr 2001 04:01:17 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: PERL DBI Problem
Message-Id: <slrn9dkrkd.6rv.garry@zfw.zvolve.net>
[jepardectomy performed]
On Sun, 15 Apr 2001 19:38:43 +0400, Brooklyn Linux Solutions CEO
<ruben@www2.mrbrklyn.com> wrote:
> Ruben
> In article <Q00C6.1700$q51.10779@news1.gvcl1.bc.home.com>, peter@psdt.com
> wrote:
>
>> In a typo in
>> the Perl program. e.g., `$arr[time]' instead of
>> `$arr[$time]'.
>>
> What is this $arr[time]?
>
> ruben@www2:~/export/ruben > perl -e "use strict; $arr[time] = 3; print $arr[time]"
> Can't modify single ref constructor in scalar assignment at -e line 1, near "3;"
> Execution of -e aborted due to compilation errors.
You need to declare variables under use strict 'vars':
$ perl -Mstrict -e 'my @ary;$ary[time] = 1'
Out of memory during ridiculously large request at -e line 1.
$
--
Garry Williams
------------------------------
Date: 16 Apr 2001 10:07:36 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: PERL DBI Problem
Message-Id: <9beg98$s5p$1@plutonium.btinternet.com>
Brooklyn Linux Solutions CEO <ruben@www2.mrbrklyn.com> wrote:
> In article <Q00C6.1700$q51.10779@news1.gvcl1.bc.home.com>, peter@psdt.com
> wrote:
>
>> In a typo in
>> the Perl program. e.g., `$arr[time]' instead of
>> `$arr[$time]'.
>>
> What is this $arr[time]?
>
>
>
> ruben@www2:~/export/ruben > perl -e "use strict; $arr[time] = 3;
> print $arr[time]"
> Can't modify single ref constructor in scalar assignment at -e
> line 1, near "3;"
> Execution of -e aborted due to compilation errors.
>
Its a mistake thats what it is :) 'time' here is the simply the perl function
that returns the naumber of seconds since the epoch so essentially what this
code is attempting to do is :
$arr[987415218] = 3;
(or whatever the time is when you run it). As for the error message I am
fairly certain that if you substitute the double quotes around the Perl code
for single ones so your shell doesnt try to interpolate $arr (presumably to
nothing ) then you will get the message that is being discussed here.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Tue, 17 Apr 2001 20:28:44 GMT
From: Scott <scotty99@earthlink.net>
Subject: Re: perl to c
Message-Id: <3ADC52D1.5BA78CAF@earthlink.net>
AvA wrote:
> is there a way to make a C program from a perl script?
>
> if so could you tell what program or module to use.
>
> thanks.
>
> AvA
> irc.xchat.org #perl
How big is the program? Just rewrite it yourself, provided you know C.
Scott
------------------------------
Date: Wed, 18 Apr 2001 01:42:02 +0300
From: "novastar" <root@novastar.dtdns.net>
Subject: Re: perl to c
Message-Id: <9bigrp$bag$1@usenet.otenet.gr>
He wouldn't send the email in such a case !
"Scott" <scotty99@earthlink.net> wrote in message
news:3ADC52D1.5BA78CAF@earthlink.net...
>
>
> AvA wrote:
>
> > is there a way to make a C program from a perl script?
> >
> > if so could you tell what program or module to use.
> >
> > thanks.
> >
> > AvA
> > irc.xchat.org #perl
>
> How big is the program? Just rewrite it yourself, provided you know C.
>
> Scott
>
------------------------------
Date: Wed, 18 Apr 2001 09:17:06 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: perl to c
Message-Id: <Wn4D6.14$Aa4.1936@vic.nntp.telstra.net>
"AvA" <a.v.a@home.nl> wrote in message news:3ADC76B0.17259083@home.nl...
> is there a way to make a C program from a perl script?
>
> if so could you tell what program or module to use.
perlcc
The dreaded 'perldoc' line would be:
perldoc perlcc
Caution. Read the caveats!
Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass it
around');
$d='$_$a$s$b$w';$e='$_$a$s$b';sub d{$h=shift;$h=~s/\$(\w+)/${$1}/g;return$h}
sub
e{return(shift!=1)?'s':''}for(reverse(1..100)){$s=e($_);$f=d($d);$g=d($e);
$c.="$f\n$g\n$t\n";$_--;$s=e($_);$e=d($d);$c.="$e\n\n";}print"$c*hic*";
------------------------------
Date: Tue, 17 Apr 2001 19:29:59 +0200
From: "Bert Tijhuis" <B.Tijhuis@inter.NL.net>
Subject: Porblems with the Perl Sleep
Message-Id: <9bhulo$4ts$1@porthos.nl.uu.net>
Hello,
I've written a script that reads out the Database I/O of an ORACLE database.
Within that script I want to wait a specified
number of seconds. Normally you should use the sleep function from perl
itself.
within a while loop the sleep command is repeately called. The first time
the sleep command waits the specified number of seconds but the second time
not.
How come? and how to solve this
To solve this problem I've program now in my program
the next line of code (that is working)
qx( sleep $NUMBER );
But I believe that this right thing to do.
We are running perl 5.004.04 with an ORACLE database 7.3.3 on AIX 4.3.3.
kind regards, Bert Tijhuis
------------------------------
Date: 17 Apr 2001 14:50:14 -0500
From: andrew_perrin@unc.edu (Andrew J. Perrin)
Subject: Re: Porblems with the Perl Sleep
Message-Id: <873db7s3ux.fsf@nujoma.perrins>
"Bert Tijhuis" <B.Tijhuis@inter.NL.net> writes:
> Hello,
> I've written a script that reads out the Database I/O of an ORACLE database.
> Within that script I want to wait a specified
> number of seconds. Normally you should use the sleep function from perl
> itself.
>
> within a while loop the sleep command is repeately called. The first time
> the sleep command waits the specified number of seconds but the second time
> not.
Huh?!
#!/usr/local/bin/perl -w
use strict;
$| = 1;
while (1) {
print 'Sleeping...', scalar localtime;
sleep 5;
print 'slept. ', scalar localtime, "\n";
}
nujoma:~/perl> perl sleeptest.pl
Sleeping...Tue Apr 17 14:48:59 2001slept. Tue Apr 17 14:49:04 2001
Sleeping...Tue Apr 17 14:49:04 2001slept. Tue Apr 17 14:49:09 2001
Sleeping...Tue Apr 17 14:49:09 2001slept. Tue Apr 17 14:49:14 2001
Sleeping...Tue Apr 17 14:49:14 2001slept. Tue Apr 17 14:49:19 2001
Can you post some code that doesn't work?
--
----------------------------------------------------------------------
Andrew J Perrin - Ph.D. Candidate, UC Berkeley, Dept. of Sociology
(Soon: Asst Professor of Sociology, U of North Carolina, Chapel Hill)
andrew_perrin@unc.edu - http://www.unc.edu/~aperrin
------------------------------
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.
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 715
**************************************