[13251] in Perl-Users-Digest
Perl-Users Digest, Issue: 661 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 27 10:07:17 1999
Date: Fri, 27 Aug 1999 07:05:11 -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 Fri, 27 Aug 1999 Volume: 9 Number: 661
Today's topics:
Re: A Question that Stems from Incredible Laziness <perin@panix.com>
Re: Bragging about killfiling (Was: New posters to comp (Chris Nandor)
Re: C Source Parser. <garethr@cre.canon.co.uk>
Re: calling scripts from other scripts HELP! alghazn@my-deja.com
Re: calling scripts from other scripts HELP! <tbornhol@prioritytech.com>
Employment opportunity in NYC <hw@mpj.com>
FormMail problem recognizing <form name> attribute <smp9@*home.com>
Re: FormMail problem recognizing <form name> attribute (Abigail)
Re: grab random image --> post into browser (Anno Siegel)
Re: Integrating CORBA and Perl <anti-clpm@spin.de>
Re: mirror.pl on OS/2 Question <flavell@mail.cern.ch>
Re: mirror.pl on OS/2 Question (Malcolm Ray)
Re: New Perl Book "Object Oriented Perl" not really ava (Chris Nandor)
Re: Newbie RegEx question (John Reynolds)
Re: Newbie RegEx question <georg.weissenbacher@altavista.net>
permissions problems on mounted vfat filesystem <james.usenet@jump-around.com>
Re: PHP/mySQL problem <rolf.raven@quantis.nl>
Re: Please help me alexander.zinniker@trivadis.com
Re: print dollar format? (Anno Siegel)
Re: Security on files in WINNT <peterw@innate.co.uk>
Re: SIGCHLD fun and games. (Anno Siegel)
Re: text file reading > newfile <mgarbutt@ozland.net.au>
Re: text file reading > newfile <mgarbutt@ozland.net.au>
Re: text file reading > newfile (Gary O'Keefe)
Re: The extent of double-quotish interpolation (Greg Bacon)
Using a customized debugger. (Greg Miller)
Re: Using a customized debugger. (Greg Miller)
Re: Visibility of inlined subs (Anno Siegel)
Re: Why use Python when we've got Perl? <Friedrich.Dominicus@inka.de>
Re: www.perl.com broken <ljp@209.204.251.8>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Aug 1999 09:28:12 -0400
From: Lewis Perin <perin@panix.com>
Subject: Re: A Question that Stems from Incredible Laziness
Message-Id: <pc7btbtbbf7.fsf@panix6.panix.com>
ct60@aol.com (Ct60) writes:
> Dear Perl Community-
>
> Can anyone give me the page number in the 2nd edition of the Camel Book
> where it talks about False Hubris?
The first page of the chapter on packages, modules and classes
(p. 277) has a footnote reading "This is a form of False Hubris."
Cheers, Lew
------------------------------
Date: Fri, 27 Aug 1999 12:05:37 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Bragging about killfiling (Was: New posters to comp.lang.perl.misc)
Message-Id: <pudge-2708990805430001@192.168.0.16>
In article <37BA73EB.AF8583@strs.co.uk>, Ian Clarke <I.Clarke@strs.co.uk> wrote:
# I am getting pretty sick of this whole killfile thing, particularly
# those who get into an argument, and then half way through killfile the
# person they are arguing with. In my view, this is the most blatant and
# pigheaded way to admit defeat in a debate.
*plonk*
:)
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Fri, 27 Aug 1999 12:23:40 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: "Eumir Que Camara" <Eumir.Camara@software-engineering.com.ph>
Subject: Re: C Source Parser.
Message-Id: <si6721tnsj.fsf@cre.canon.co.uk>
Eumir Que Camara <Eumir.Camara@software-engineering.com.ph> wrote:
> I was wondering if anybody has a perl C source parser.
You could try building one yourself using some of these tools:
Jim Roskind's yacc grammar for C
ftp://iecc.com/pub/file/c++grammar/c5.y
Jeff Lee's lex/yacc grammar for C
ftp://iecc.com/pub/file/c-grammar.gz
Philippe Verdret's Parse::Lex module
Francois Desarmenien's Parse::Yapp module
http://www.perl.com/CPAN/modules/by-module/Parse/
--
Gareth Rees
------------------------------
Date: Fri, 27 Aug 1999 13:02:32 GMT
From: alghazn@my-deja.com
Subject: Re: calling scripts from other scripts HELP!
Message-Id: <7q6292$gar$1@nnrp1.deja.com>
In article
<mbudash-2308991253480001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>,
mbudash@sonic.net (Michael Budash) wrote:
> In article <7pr2v2$mom$1@nnrp1.deja.com>, alghazn@my-deja.com wrote:
>
> >Can someone guide me here please?
> >What I want to do is call one of my scripts (myscript.cgi) from my
main
> >script (mainscript.cgi) and pass it some arguments $A and $B
> >Tried system("perl myscript.cgi $A $B"); from within mainscript.cgi
but
> >it doesn't work!
>
> "doesn't work" is vague... where was myscript.cgi looking for the
args? if
> not in @ARGV, that's why...
Sorry about being not clear.
the one line script calling myscript.cgi with $A and $B gives a server
error (Premature end of script headers...the script mentioned is the
calling script and not myscript.cgi)
So myscript.cgi never gets called so it cannot, I think, be a problem
with myscript.cgi not looking for the arguments in the correct place.
Have also tried other variations such as:
exec "myscript.cgi?id=wqw100&entry=123oz";
or
exec ("myscript.cgi" , "qwe100", "123oz");
but everything (just a one line script each time...plus the perl
path) gives a server error BEFORE even running myscript.cgi
thanks for the help! More needed PLEASE!
alghazn
>
> >Can HTTP_REFER can be faked , for example, by
> >myscript.cgi?A=blah&&HTTP_REFER=mypage ,
>
> yes
thanks for the answer. Too bad though. It seemed like such a simple way
of handling non-critical password protection.
> > or is it safe to use it as a
> >kind of password for deeper access into a site (meaning only the
browser
> >can set it?
>
> no
> --
> | Michael Budash Consulting | 707-252-7670 voice |
> | Perl, Javascript, PHP, MySQL | 603-250-8679 fax |
> | Official Extropia Developer | mbudash@sonic.net |
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 27 Aug 1999 08:35:38 -0500
From: "Tim Bornholtz" <tbornhol@prioritytech.com>
Subject: Re: calling scripts from other scripts HELP!
Message-Id: <2BE009F72087C4D4.0AD451B40EF87C6F.63A401F0C07106EE@lp.airnews.net>
<alghazn@my-deja.com> wrote in message news:7q6292$gar$1@nnrp1.deja.com...
> In article
> <mbudash-2308991253480001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>,
> mbudash@sonic.net (Michael Budash) wrote:
> > In article <7pr2v2$mom$1@nnrp1.deja.com>, alghazn@my-deja.com wrote:
> >
> > >Can someone guide me here please?
> > >What I want to do is call one of my scripts (myscript.cgi) from my
> main
> > >script (mainscript.cgi) and pass it some arguments $A and $B
> > >Tried system("perl myscript.cgi $A $B"); from within mainscript.cgi
> but
> > >it doesn't work!
> >
Look up "do", "require" and "use" in the perlfunc. These are probably more
like what you want to use.
hth,
Tim Bornholtz
tbornhol@prioritytech.com
------------------------------
Date: Fri, 27 Aug 1999 09:45:09 -0400
From: "Herschel Weber" <hw@mpj.com>
Subject: Employment opportunity in NYC
Message-Id: <7q64jd$ofd$1@maceo.dti.net>
Looking for an expert in Unix shell scripting and Perl for a 6 month
contract in NYC. The client is a very prestigious financial institution (One
of the 5 largest in the world!). In addition, opportunities here are
exponential and abundant, If interested, please email your resume to
hw@mpj.com or call 212 968-1100. Job code is 31-NG
Herschel Weber
Recruiter
Morgan Parker & Johnson
------------------------------
Date: Fri, 27 Aug 1999 13:16:32 GMT
From: Shawn Powell <smp9@*home.com>
Subject: FormMail problem recognizing <form name> attribute
Message-Id: <Qcwx3.9537$y03.1831@news.rdc1.ct.home.com>
I posted the following message in comp.lang.javascript and didn't get a
single response--let's see if you guys are more helpful.
I have a JavaScript script within a web page I created using FrontPage
2000.
The script includes a function, fnTotal(), which references a form
called frmSecure_Order_Form further down on this page. Upon submitting
the form, the results are supposed to get sent to a cgi program called
FormMail (a Perl script) which converts the form results to an e-mail
message. The only
way I can get the JavaScript to run properly with this form is if I
write the form name twice in my HTML code, written as follows:
<form name="frmSecure_Order_Form">
<form method="POST" action="/cgi-bin/formmail.pl" onsubmit="return
frmSecure_Order_Form_Validator(this)" name="frmSecure_Order_Form">
However, if I have the <form name> attribute listed on an additional
line
from the other <form> tag, (as written above), then FormMail won't
return any results. To get FormMail to run properly, I need to have
*only* the following line:
<form method="POST" action="/cgi-bin/formmail.pl" onsubmit="return
frmSecure_Order_Form_Validator(this)" name="frmSecure_Order_form"
name="frmSecure_Order_Form">
But the Javascript won't run with the second setup (I keep getting an
error message saying "document.frmSecure_Order_Form has no
properties."). I can't seem to get BOTH FormMail and my JavaScript to
work simultaneously. Any suggestions?
===================================================
Shawn Powell
smp9@*home.com
To e-mail me, remove the asterisk from my address.
===================================================
------------------------------
Date: 27 Aug 1999 08:34:05 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: FormMail problem recognizing <form name> attribute
Message-Id: <slrn7sd541.pp.abigail@alexandra.delanet.com>
Shawn Powell (smp9@*home.com) wrote on MMCLXXXVII September MCMXCIII in
<URL:news:Qcwx3.9537$y03.1831@news.rdc1.ct.home.com>:
{} I posted the following message in comp.lang.javascript and didn't get a
{} single response--let's see if you guys are more helpful.
You didn't ask a Perl question.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 27 Aug 1999 11:47:08 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: grab random image --> post into browser
Message-Id: <7q5trs$jhv$1@lublin.zrz.tu-berlin.de>
Phil Schaechter <phil@proteacher.com> wrote in comp.lang.perl.misc:
>I ran in to this same problem. Use a bit a javascript and tack on a random
>number to the end of your perl cgi image call
[...]
>David Ford wrote in message ...
>>Hello,
>>
>>I am totally new at this, and am hoping to find the answer here.
[...]
Two objections, Phil: Your post is jeopardy style. And it's off topic.
Anno
------------------------------
Date: 27 Aug 1999 12:04:43 +0200
From: Andi Hechtbauer <anti-clpm@spin.de>
Subject: Re: Integrating CORBA and Perl
Message-Id: <m3r9kp1qv8.fsf@hic.hq.spin.de>
>[people searching corba perl projects]
you might want to look at COPE - some COrba PErl effort.
(http://www.lunatech.com/research/corba/cope/)
There's a link to ILU+Perl, which is kind of interesting, too.
(http://www.gtk.org/~otaylor/ilu/index.html)
regards,
Andi Hechtbauer
------------------------------
Date: Fri, 27 Aug 1999 14:35:13 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: mirror.pl on OS/2 Question
Message-Id: <Pine.HPP.3.95a.990827143403.24393B-100000@hpplus03.cern.ch>
On Fri, 27 Aug 1999, David D. Huff Jr. wrote:
> This question is only open to anyone who has responded
> to this news group LESS THAN ONE-HUNDRED AND ELEVEN TIMES IN THE LAST 7
> DAYS
Excellent. You're openly demanding the misleading/bogus answer that
you richly deserve. I wish you every success with it.
------------------------------
Date: 27 Aug 1999 13:44:28 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: mirror.pl on OS/2 Question
Message-Id: <slrn7sd5hs.fkr.M.Ray@carlova.ulcc.ac.uk>
On Fri, 27 Aug 1999 01:44:58 GMT, David D. Huff Jr. <huffd@nls.net> wrote:
>This question is only open to anyone who has responded
>to this news group LESS THAN ONE-HUNDRED AND ELEVEN TIMES IN THE LAST 7
>DAYS
>Whom, might actually help the needy by asking a pertinent question,
>general or otherwise.
>Someone who is not easily offended by one's lack of proper etiquette.
>And can give instruction without witticisms.
That'd be me, then.
>"David D. Huff Jr." wrote:
>
>> How do I make mirror.pl delete files on the target
>> server that do not exist on the source server?
>>
>> I am mirroring a server that deletes outdated
>> files. Mirror.pl does not delete the files on my
>> OS/2 server it tries to unlink then it says it
>> cannot find the file/directory.
>>
>> Thanks
The main reason you're getting unhelpful responses is that you've
given people almost nothing to work with. Perhaps you think that
everyone is familiar with 'mirror.pl', but that's such a generic
name for a program that there are probably a dozen scripts called
that littering the Perl repositories.
You need to post the relevant section of code which is failing to
delete the files (cut and paste, don't type it in), along with the
exact error message (not the hint you've given us). Then you'll
cease being sport and become someone worth helping.
--
Malcolm Ray University of London Computer Centre
------------------------------
Date: Fri, 27 Aug 1999 11:59:55 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: New Perl Book "Object Oriented Perl" not really available ...yet
Message-Id: <pudge-2708990800010001@192.168.0.16>
In article <7pufuu$4l6$1@nnrp1.deja.com>, gmmengel@my-deja.com wrote:
# Just a note to let all know that Manning publishers has opened the door
# via their web site (www.manning.com) to order the new book "Object
# Oriented Perl" by Damian Conway. The printer is NOT ready yet. If you
# order the book, you will get "Object Oriented Application Frameworks".
# Not what the doctor ordered..
# You might want to wait another week or so if you want this book. By
# the way, the distributor Bookmasters Distribution Service, has been
# more than helpful. My emails to Manning though were not answered, sad
# to say.
It is available. Borders was selling copies at TPC 3.0 on Monday.
Whether or not you will be able to get it is another matter. But I have
my copy sitting here, and several people I know bought it Monday and
Tuesday.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Fri, 27 Aug 1999 11:01:53 GMT
From: reynolds@kcc.com (John Reynolds)
Subject: Re: Newbie RegEx question
Message-Id: <37c66984.58197635@netnews.kcc.com>
On 27 Aug 1999 08:40:58 GMT, "Doug Bennett"
<dbennett@hsstelford.freeserve.co.uk> wrote:
>I want to check whether a string includes the characters:
>tsj
>in it. I want this to be true only if the characters appear in that order,
>eg
>"this joint" would return true, whereas
>"short jump" would return false even though the three characters appear in
>this phrase.
>The check should be case insensitive.
$myString =~ /t.*s.*j.*/i
will match strings like "this joint" and "This joint", the '/i' makes
it case insensitive. This will also match "ts joint" because the .*
after the t matches zero or more characters.
$myString =~ /t.+s.+j.+/i
will match only if there are one or more characters after the letters
you want. Depending on what you're trying to match/exclude, you may
want to use some of the character classes.
$myString =~ /t\w+s\b.+\bj.+/i
says the t and the j must appear after a word boundry, there must be
one or more alpha-numeric characters after the t and one or more of
any characters after the s and the j.
"leave this joint" would match
"these jumpers" would not because there is no word boundry following
the s.
I found this to be a decent tutorial. Look for the "basic regular
expression syntax table" link.
http://www.wdvl.com/Authoring/Languages/Perl/PerlfortheWeb/pattern_matching.html
HTH
John
------------------------------
Date: Fri, 27 Aug 1999 15:20:15 +0200
From: Georg Weissenbacher <georg.weissenbacher@altavista.net>
Subject: Re: Newbie RegEx question
Message-Id: <37C6908F.FFD703@altavista.net>
Steffen Koehler wrote:
>
> Doug Bennett (dbennett@hsstelford.freeserve.co.uk) wrote:
> man perlre
>
> but for this time use /t.*s.*j/
/t.*s.*j/i
mfG,
Georg
------------------------------
Date: Fri, 27 Aug 1999 13:23:07 GMT
From: James Cohen <james.usenet@jump-around.com>
Subject: permissions problems on mounted vfat filesystem
Message-Id: <7q63fg$h5j$1@nnrp1.deja.com>
Hi,
Thanks for taking the time to read this message.
I am having problems with a perl / cgi script. The script should be
creating a directory on a mounted vfat file system. I am using Redhat
6.0 and because of the way (single user) the permissions are set up I am
unable to create the directory.
I have tried changing defaults for the partition using "fsconf",
changing the Apache user and group setup, still no luck.
Please let me know if you can help.
Many thanks,
James Cohen
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 27 Aug 1999 15:13:36 +0200
From: Rolf Raven <rolf.raven@quantis.nl>
Subject: Re: PHP/mySQL problem
Message-Id: <37C68F00.6D20AE48@quantis.nl>
> You can use PHP to read data from a MySQL database, but can PHP be also used
> to write data into a MySQL database (say contents of a Web form) ? If so,
> how?
No problem:
mysql_connect("host.domain","username","password");
$result = mysql_db_query("databasename","insert into tablename
values($field1,$field2);
if (!$result) { oops(); }
where $field1,$field2 are results of, for example
<input type="text" name="field1">
<textarea name="field2"></textarea>
More information and a (online) manual can be found at http://www.php.net/
Hope this helps,
floR
------------------------------
Date: Fri, 27 Aug 1999 11:49:33 GMT
From: alexander.zinniker@trivadis.com
Subject: Re: Please help me
Message-Id: <7q5u0b$dcr$1@nnrp1.deja.com>
Hi
Maybe the user your web server is running with is not allowed to write
in your directory. To see the reason use:
open (OUT, ">$myfile") || die print "content-type:text/plain\n\nError:
$!\n";
$! contains the error which occurs, when your CGI tries to create your
file.
-Alex
In article <7q5emb$3gt$1@nnrp1.deja.com>,
kalakala@my-deja.com wrote:
> Hello sir,
> I want to create a file in my dir using CGI-PERL.
> I want to give the name of the file and the content from the web ie
> thru'
> html.
>
> The perl-cgi program the one which i've is nicely run from the prompt
> but
> if i call from the html form element by giving the action=file.cgi,it
> doesn't create the output file.
>
> How can i create the output file via web?.
>
> If i get the reply,it'll be verymuch useful.
>
> Thanks in advance.
>
> -kala
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 27 Aug 1999 11:56:43 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: print dollar format?
Message-Id: <7q5udr$jj7$1@lublin.zrz.tu-berlin.de>
Phil Schaechter <phil@proteacher.com> wrote in comp.lang.perl.misc:
>Count the number of digits. The rest is easy.
>
>print strlen % 3 digits, then a comma, then three digits, then comma until
>you hit . - then print remaining digits..
>
>Phil Schaechter
>
>b chung wrote in message <37C455BF.5BECAA04@ci.south-el-monte.ca.us>...
>>Hi, all
>>
>>In Perl How do I print the 22343.87 like this $22,232.87
Phil, if you want to play, play by the rules. You violated four in
your post:
1 - You placed the answer above the question.
2 - You answered a faq with your own ad-hoc solution.
3 - You didn't test your solution.
4 - Your answer is wrong.
You won't have much fun if you continue this way.
Anno
------------------------------
Date: Fri, 27 Aug 1999 13:32:58 +0100
From: "Peter Wilkinson" <peterw@innate.co.uk>
Subject: Re: Security on files in WINNT
Message-Id: <935757439.25383.0.nnrp-12.c3ada081@news.demon.co.uk>
Depends how you are running the perl script. If running from
a command prompt like
c:perl myscript.pl
it runs as the user running the script.
If running as a CGI script under IIS there are a couple of different
models. Here if the security model is 'anonymous login' or something
like that, then the scrip is run as the 'default anonymous web user' who's
identity can be set from IIS. If 'basic authentication' or 'NT
authentication'
are used then the script is run as the user who logged into the website.
regards
Peter
Arjen Jansen <ajansen@glasshouse.nl> wrote in message
news:935736629.350987@cyperus.glasshouse.net...
> Hi,
>
> I got ActivePerl 5.1.9 installed on a WinNT 4.0 server. Now I have the
> problem that a perl script needs to write a file into a directory. And I
am
> not sure who or what kind of access to allow on that directory to make
this
> work.
>
> So far I have only been able to write into directories where everyone has
> full rights. You can imagine thats not what I want.
>
> I am wondering as what kind of user Perl accesses files.
>
> Anybody got any idea?
>
> Arjen Jansen
>
>
>
------------------------------
Date: 27 Aug 1999 10:05:06 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: SIGCHLD fun and games.
Message-Id: <7q5nsi$j85$1@lublin.zrz.tu-berlin.de>
Edward Sumerfield <ed.summerfield@lexis-nexix.com> wrote in comp.lang.perl.misc:
>I have a script that traps the SIGCHLD signal and it works fine. The
>problem is that I don't have the process id of the child that ended in
>that signal handler.
Look up the wait() and waitpid() functions.
Anno
------------------------------
Date: Fri, 27 Aug 1999 20:21:48 +1000
From: Malcolm Garbutt <mgarbutt@ozland.net.au>
Subject: Re: text file reading > newfile
Message-Id: <37C666BB.B0221B85@ozland.net.au>
Hi Gary,
This worked great, many thanks.
Gary O'Keefe wrote:
> >Hi Guys, Gals and Guru's,
> >
> >I have been reading the perl online doc's, newsgroups and Que's Perl 5
> >by example book to solve a small job I want to do, but I can't seem to
> >grasp the code I need to write.
> >If someone could write the small code for me I would appreciate it.
> >
> >What I want to do is read a text file that has invoice records separate
> >by the word new, the next line of the record is a username, that I want
> >to be the name of an output file which is to contain the contents
> >between the new statements.
> >For example the text file below has 2 records in the usernames of max
> >and evih, I would like the data for max to be read and written to a text
> >file called max, then the data for evih read and written to a text file
> >called evih, etc.
>
> [ financial records that I just snipped. ]
>
> Try this:
>
> #!/usr/local/bin/perl -w
>
> use strict;
>
> # redefine the end-of-line marker
> # now every record is a line
>
> $/ = "new\n";
>
> while ( <DATA> ) {
>
> # remove the end-of-line chars and if the line has words on
> # it, get the first word for the filename
>
> chomp;
> if ( m/(\w+)/ ) {
>
> open ( OUT, ">$1" ) ||
> die "Could not open $1 for writing. $!.\n";
> print OUT;
> close ( OUT ) ||
> die "Could not close $1 after writing. $!.\n";
>
> }
>
> }
>
> __DATA__
> [ insert the test data that I'm not going to republish here ]
>
> Hope that helps
>
> Gary
> --
> Gary O'Keefe
> gary@onegoodidea.com
>
------------------------------
Date: Fri, 27 Aug 1999 20:24:45 +1000
From: Malcolm Garbutt <mgarbutt@ozland.net.au>
Subject: Re: text file reading > newfile
Message-Id: <37C6676D.1985DBDE@ozland.net.au>
Hi Gary,
This worked great, many thanks.
Gary O'Keefe wrote:
> >Hi Guys, Gals and Guru's,
> >
> >I have been reading the perl online doc's, newsgroups and Que's Perl 5
> >by example book to solve a small job I want to do, but I can't seem to
> >grasp the code I need to write.
> >If someone could write the small code for me I would appreciate it.
> >
> >What I want to do is read a text file that has invoice records separate
> >by the word new, the next line of the record is a username, that I want
> >to be the name of an output file which is to contain the contents
> >between the new statements.
> >For example the text file below has 2 records in the usernames of max
> >and evih, I would like the data for max to be read and written to a text
> >file called max, then the data for evih read and written to a text file
> >called evih, etc.
>
> [ financial records that I just snipped. ]
>
> Try this:
>
> #!/usr/local/bin/perl -w
>
> use strict;
>
> # redefine the end-of-line marker
> # now every record is a line
>
> $/ = "new\n";
>
> while ( <DATA> ) {
>
> # remove the end-of-line chars and if the line has words on
> # it, get the first word for the filename
>
> chomp;
> if ( m/(\w+)/ ) {
>
> open ( OUT, ">$1" ) ||
> die "Could not open $1 for writing. $!.\n";
> print OUT;
> close ( OUT ) ||
> die "Could not close $1 after writing. $!.\n";
>
> }
>
> }
>
> __DATA__
> [ insert the test data that I'm not going to republish here ]
>
> Hope that helps
>
> Gary
> --
> Gary O'Keefe
> gary@onegoodidea.com
>
------------------------------
Date: Fri, 27 Aug 1999 11:07:56 GMT
From: gary@onegoodidea.com (Gary O'Keefe)
Subject: Re: text file reading > newfile
Message-Id: <37c66bce.8318626@news.hydro.co.uk>
A keyboard was whacked upside Malcolm Garbutt's head and out came:
>Hi Gary,
>
>This worked great, many thanks.
>
>Gary O'Keefe wrote:
>
>> >Hi Guys, Gals and Guru's,
>> >
>> >I have been reading the perl online doc's, newsgroups and Que's Perl 5
>> >by example book to solve a small job I want to do, but I can't seem to
>> >grasp the code I need to write.
>> >If someone could write the small code for me I would appreciate it.
>> >
>> >What I want to do is read a text file that has invoice records separate
>> >by the word new, the next line of the record is a username, that I want
>> >to be the name of an output file which is to contain the contents
>> >between the new statements.
>> >For example the text file below has 2 records in the usernames of max
>> >and evih, I would like the data for max to be read and written to a text
>> >file called max, then the data for evih read and written to a text file
>> >called evih, etc.
>>
>> [ financial records that I just snipped. ]
Hmmm. There appears to be a line indicating snippage missing here. I
take it you are guilty as charged then?
<LECTURE>
Now, I know that I'm no authority figure in this group but, well gosh,
I like you people and I don't want to see you poor-assed and in jail
(remember: when the big guys tell you you're going to be their punk,
they don't want you to grow a Mohican, stick a safety pin through your
nose, and listen to the Sex Pistols... Well maybe they do, but how
likely is that?)
So please be careful about what data you post. Especially no real
names and addresses. Apart from prosecution through whatever data
protection legislation your respective countries have, there are some
very real nutters out there and you never know who's reading your
posts.
<\LECTURE>
Be careful out there
Gary
--
Gary O'Keefe
gary@onegoodidea.com
You know the score - my current employer has nothing to do with what I post
------------------------------
Date: 27 Aug 1999 14:03:51 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: The extent of double-quotish interpolation
Message-Id: <7q65s7$jv4$2@info2.uah.edu>
In article <m1u2pm4av8.fsf@halfdome.holdit.com>,
merlyn@stonehenge.com (Randal L. Schwartz) writes:
: >>>>> "Abigail" == Abigail <abigail@delanet.com> writes:
:
: Abigail> Really? Tell me, which variable is interpolated in:
:
: Abigail> "${\+3}"
:
: The variable that comes from dereferencing the reference taken to +3.
: Sure, it's read-only, but it's still syntactically a variable.
Larry himself has said that those curly braces are a block. I think
your rule is in need of revision.
: Witness:
:
: $ perl -ce '${\+3} = 17'
: -e syntax OK
:
: So when I say "variable", I mean, things that can go on the left side
: of an assignment operator.
Don't we usually call those lvalues? :-)
: With the additional criterion that it
: cannot have imbedded whitespace if it's being interpolated.
$h{"some key"} = 42;
print "The value is $h{'some key'}\n";
: And notwithstanding the new lvalue subs. :) :)
Mmmm.. lvalue subs. :-)
Greg
--
Give a man a fish and he will eat for a day. Teach him how to fish,
and he will sit in a boat and drink beer all day.
-- George Carlin
------------------------------
Date: Fri, 27 Aug 1999 13:39:41 GMT
From: gmiller@iglou.com (Greg Miller)
Subject: Using a customized debugger.
Message-Id: <37c69287.1321052@news.iglou.com>
I'm attempting to customize the debugger, and can't seem to
get the PERL5DB enviroment variable to work correctly. On Linux, perl
seems to ignore the enviroment variable completley. On Win32, if the
PERL5DB variable is set, perl complains that the sub DB::DB doesn't
exist.
The following are some of the values I've tried:
BEGIN { require "mydb.pl"}
BEGIN { require "/home/gmiller/mydb.pl"}
BEGIN { require "SomeFileThatDoesntExist.pl"}
sub DB::DB {}
asdfasdfasdfasdfasdflkjasdlfjklsdkjasd
(I've tried all of the examples in the perldebug man page on both
Linux and Win32.)
All values have the same exact behaviour.
To start, I'm using an exact copy of perl5db.pl. If I rename
mydb.pl to perl5db.pl and rename the real debugger to something else,
it works fine. But I'd like to keep the real debugger installed, so I
can use the customized version only when I need it.
------------------------------
Date: Fri, 27 Aug 1999 14:04:03 GMT
From: gmiller@iglou.com (Greg Miller)
Subject: Re: Using a customized debugger.
Message-Id: <37c69a6b.3341997@news.iglou.com>
I managed to get it to work by calling my custom debugger
perl5db.pl, putting it in the current directory, and running perl
with:
perl -I. -d test.pl
Any better solutions would be appreciated.
------------------------------
Date: 27 Aug 1999 10:28:19 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Visibility of inlined subs
Message-Id: <7q5p83$ja7$1@lublin.zrz.tu-berlin.de>
Paul Wood <john.wood@diamond.co.uk> wrote in comp.lang.perl.misc:
>I've read all the man pages etc... I still can't spot what's wrong.
>Here's a breakdown of the code...
>
># in file.pl
>
>use Modules;
>
>package main;
>require "library_file.pl";
>
>&function( CONST1 | CONST2 );
>
># in library_file.pl
>
>package main;
>
>sub CONST1 () { 0 }
>sub CONST2 () { 1 }
>sub CONST3 () { 2 }
>
>sub function {
>.
>.
>.
>}
>
>If I check the vales of the constants from inside the library file, they're
>fine. If I try to use them from the main file, I get the string values of
>the sub names instead.
You didn't switch on warnings before posting to clpm. Gack.
While you're at it, also use strict.
Anno
------------------------------
Date: Fri, 27 Aug 1999 15:32:19 +0200
From: Friedrich Dominicus <Friedrich.Dominicus@inka.de>
Subject: Re: Why use Python when we've got Perl?
Message-Id: <37C69363.DC8B6723@inka.de>
William Tanksley wrote:
>
> On Thu, 26 Aug 1999 10:44:48 -0400, David Oppenheimer wrote:
>
> >That being said, are there ways to integrate Python and Perl to do things
> >that neither one can do alone?!
>
> Minotaur is an attempt to do exactly that -- they've got Python, Perl,
> Tcl, Ruby, Forth, and several other languages all glued together and all
> callable from each other, with good data interchange.
Would be helpful to know how they are doing and where
Regards
Friedrich
------------------------------
Date: 27 Aug 1999 07:27:04 -0600
From: ljp <ljp@209.204.251.8>
Subject: Re: www.perl.com broken
Message-Id: <67211hhz.fsf@wind.localdomain>
You can get modules by running the command-
perl -MCPAN -eshell
if you use linux or such, or if you are on windows- activeperl-
perl ppm.bat
or
perl ppm.pl
danny@hendrix.postino.com (Danny Aldham) writes:
>X-Newsreader: TIN [version 1.2 PL2]
>
>I went to www.perl.com tonight to get connected to CPAN. Using both
>Netscape & Lynx I selected CPAN which went to www.perl.com/CPAN/readme.html
>and then selected "select a site manually". This links leads to
>www.perl.com/CPAN/ which displays the same page, and selecting the same
>link leads back to the same page again. Kind of bush league O'Reilly.
>
>--
>Danny Aldham Providing Certified Internetworking Solutions to Business
>www.postino.com E-Mail, Web Servers, Mail Lists, Web Databases, SQL & Perl
--
- "Peace cannot be kept by force. It can only be achieved by
understanding."
- "Whoever undertakes to set himself up as judge in the
field of truth and knowledge is shipwrecked by the
laughter of the Gods." -A. Einstein
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. Due to their sizes, neither the Meta-FAQ nor
the FAQ are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq" from
almanac@ruby.oce.orst.edu.
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 V9 Issue 661
*************************************