[11955] in Perl-Users-Digest
Perl-Users Digest, Issue: 5555 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 3 23:07:14 1999
Date: Mon, 3 May 99 20:00:18 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 3 May 1999 Volume: 8 Number: 5555
Today's topics:
Re: embed cgi in HTML (Scruffles)
Re: embed cgi in HTML (Scruffles)
Error: Can't do inplace edit without backup. <hawkwynd@adelphia.net>
Re: finding the right doc WAS Re: using perl to manage <ebohlman@netcom.com>
Re: Finding x^y? <ebohlman@netcom.com>
Re: for ($i = 0, $i <= 29470, $i++} -- 29470 too high? <dbohling@pacbell.net>
Re: for ($i = 0, $i <= 29470, $i++} -- 29470 too high? <dbohling@pacbell.net>
Re: for ($i = 0, $i <= 29470, $i++} -- 29470 too high? <dbohling@pacbell.net>
Help with multiple text files, search and replace, rena <hawkwynd@adelphia.net>
ISO random sentence parser (like spew) <geestarr@geedev.com>
Re: ISPs that offer cgi space?? <cassell@mail.cor.epa.gov>
Re: ISPs that offer cgi space?? (Tad McClellan)
Re: looking at directories (Tad McClellan)
Re: need user to be able to submit files from browser <design@raincloud-studios.com>
Re: need user to be able to submit files from browser <design@raincloud-studios.com>
Newbie question metamorphon@hotmail.com
Re: Newbie question <cassell@mail.cor.epa.gov>
Oops... Re: pattern matching <webmaster@chatbase.com>
Re: pattern matching <webmaster@chatbase.com>
Perl install problems - bsdos <citeckeb@citec.qld.gov.au>
Re: Problem in calling subroutine inside another routin (Tad McClellan)
return codes from called scripts jrobens@my-dejanews.com
return codes from called scripts jrobens@my-dejanews.com
Re: Stumped on Regex routine <ebohlman@netcom.com>
Re: Stumped on Regex routine <cassell@mail.cor.epa.gov>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 04 May 1999 01:10:02 GMT
From: scruffles*nospam*@geocities.com (Scruffles)
Subject: Re: embed cgi in HTML
Message-Id: <372e48b6.602601405@news.inlink.com>
Thanks for the help.. This was exactly what I was looking for.
On Sun, 2 May 1999 21:32:07 -0400, "Jane H." <memberjh@yahoo.com>
wrote:
>The proper term is "server side include".
>
>Try one of the search engines for further documentation. I did a search on
>http://www.alingo.com and it yielded:
>
>http://conan.itc.virginia.edu/ssi.html
>
>seems thorough enough.
>
>
>Scruffles wrote in message <372cf2cb.515071193@news.inlink.com>...
>>I want to inclued a CGI generated peice of HTML into a web page. I
>>would like to be able to load the web page into an HTML editor when
>>needed, so making the hole thing a Here document is out of the
>>question (unless I am missing something).
>>
>>What I want to do is something like
>><!--#exec cgi="/path/to/script.cgi"-->
>>to embed the script's output (I got this from
>>http://www.inlink.com/support/web/personal/cgi.html )
>>
>>or
>>
>>as geocities uses it: <!--#geoguide-->
>>
>>How do these work? Are they web server specific? Where can I get
>>more information?
>
>
------------------------------
Date: Tue, 04 May 1999 01:12:05 GMT
From: scruffles*nospam*@geocities.com (Scruffles)
Subject: Re: embed cgi in HTML
Message-Id: <372f4916.602697733@news.inlink.com>
Sorry if my post was a bit off topic... I had no way of knowing that
it was off topic until I got the reply.
On Mon, 03 May 1999 08:45:41 GMT, Daniel Pfeiffer
<occitan@esperanto.org> wrote:
>In article <7giu7n$did@dfw-ixnews12.ix.netcom.com>,
> "Jane H." <memberjh@yahoo.com> wrote:
>
>> Scruffles wrote in message <372cf2cb.515071193@news.inlink.com>...
>> >I want to inclued a CGI generated peice of HTML into a web page. I
>> >would like to be able to load the web page into an HTML editor when
>> >needed, so making the hole thing a Here document is out of the
>> >question (unless I am missing something).
>
>> >What I want to do is something like
>> ><!--#exec cgi="/path/to/script.cgi"-->
>> >to embed the script's output or <!--#geoguide-->
>
>> The proper term is "server side include".
>
>SSI implements a rather primitive language, that has nothing to do with
>a Perl newsgroup. Only through the, optionally disabled, exec command
>do we get the whole power of Unix, be it Shell, Perl or whatever.
>
>A comparable approach, based on nothing but plain Perl, is my inverse
>Perl or iPerl interpreter, which has both a command line frontend for
>offline treatment, and a cgi frontend to be activated in a webserver.
>The files are plain HTML, with specially marked snippets of Perl, that
>can generate output, or control what HTML gets output, potentially in a
>loop.
>
>Find the details in http://beam.to/iPerl/
>
>- Daniel
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 04 May 1999 02:04:10 GMT
From: "Hawkwynd" <hawkwynd@adelphia.net>
Subject: Error: Can't do inplace edit without backup.
Message-Id: <uAsX2.115$5g5.1356@server1.news.adelphia.net>
When I run the following command, I'm getting and error message:
perl -p -i -e "s/\xhex/ /g;" cat.txt
Can't do inplace edit without backup.
------------------------------
Date: Tue, 4 May 1999 01:28:01 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: finding the right doc WAS Re: using perl to manage passwords?
Message-Id: <ebohlmanFB6pEp.9Iv@netcom.com>
Jonathan Feinberg <jdf@pobox.com> wrote:
: Tom Christiansen <tchrist@mox.perl.com> writes:
: > In comp.lang.perl.misc, Dan Baker <dtbaker@bus-prod.com> writes:
: > :what will be the preferred documentation method of the future?
: >
: > Voice mail, with on of those push-button menus.
: You have reached Person Pages Interactive, formerly Man Pages. Our
: menu options have changed. Please listen to the following options,
: and select the most appropriate one.
[snip]
There are at least two companies (one is NetPhonics) that make systems
that will take an HTML document and actually turn it into a dialog like this.
: Or just stay on the line, and you will be connected to the next
: available reader of c.l.p.misc.
They haven't implemented this sort of functionality, though. Do you
think O'Reilly would be interested in publishing "Speech Technology for
Spammers"?
------------------------------
Date: Tue, 4 May 1999 01:43:11 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Finding x^y?
Message-Id: <ebohlmanFB6q3z.AKI@netcom.com>
Tad McClellan <tadmc@metronet.com> wrote:
: <aol> Me too! </aol>
Isn't it poor style to declare an element with non-empty content when
that content is a constant? Wouldn't a simple <aol/> (or <aol></aol> for
pre-WebSGML processors) make more sense?
------------------------------
Date: Mon, 03 May 1999 18:15:51 -0700
From: Daniel Bohling <dbohling@pacbell.net>
Subject: Re: for ($i = 0, $i <= 29470, $i++} -- 29470 too high?
Message-Id: <372E4A47.42C7C7FC@pacbell.net>
Hi everybody, and many thanks for the responses. That hit it right on
the head, it was because of the commas. I'm pretty new -- actually green as
hell, but i swear that script started out way smaller than it ended up,
just kept adding junk as it refused to work.
Anyway thanks for the help and time spent on such a lame question.
Daniel Bohling
Rob Sweet wrote:
> You should be using a semicolon not a comma as a delimiter. The
> commas are creating a list with three elements, which you are then
> iterating.
>
> Rob Sweet
>
> ----
>
> On Sun, 02 May 1999 15:10:46 -0700, Daniel <dbohling@earthlink.net>
> wrote:
>
> > Hi all, I am having a strange problem with the following for loop:
>
> > <...snip...>
>
> >for ($i = 0, $i <= 29470, $i++) {
------------------------------
Date: Mon, 03 May 1999 18:23:20 -0700
From: Daniel Bohling <dbohling@pacbell.net>
Subject: Re: for ($i = 0, $i <= 29470, $i++} -- 29470 too high?
Message-Id: <372E4C08.D801332@pacbell.net>
I'm laughing at myself right now 'cause i was so pleased to be working
with something
that i though was so big!! Guess everything is relative huh? Thanks for your
help -- and for bursting my bubble ;-D.
Tad McClellan wrote:
> : When i run this script (it reads from a very large text file to be
> : inputted into a database),
>
> 30,000 lines is not "very large" in my book.
>
> 'spose it depends on what you're used to though...
>
> :
------------------------------
Date: Mon, 03 May 1999 18:33:04 -0700
From: Daniel Bohling <dbohling@pacbell.net>
Subject: Re: for ($i = 0, $i <= 29470, $i++} -- 29470 too high?
Message-Id: <372E4E50.D22312F1@pacbell.net>
Rick Delaney wrote:
> Or without perl at all:
>
> $ tr \" \' < zips.txt > newzips.txt
>
> --
> Rick Delaney
> rick.delaney@home.com
Thanks a lot for spending the time to help. Didn't try that but damn
that's was easy!
I wound up using " foreach" and it worked just fine.
Thanks , Daniel Bohing
------------------------------
Date: Tue, 04 May 1999 01:40:54 GMT
From: "Hawkwynd" <hawkwynd@adelphia.net>
Subject: Help with multiple text files, search and replace, rename
Message-Id: <GesX2.111$5g5.1359@server1.news.adelphia.net>
I have a directory of text files, with the filename pattern such as :
33_1234.txt
33_1235.txt
33_1236.txt
Within each text file, which is ascii, are embedded characters that need to
be removed. The characters are not true ASCII, I think it's the extended
ASCII codes, which are the page breaks in Word.
Using Qedit, the two characters that are in need of replacement are chr$(12)
and chr$(13), of the character set. In qedit, the characters appear as the
music note and the male symbol, the music note is 13, and the male symbol
12.
Here's a pseudo of what needs to transpire:
- open a file for read
- s/note and male symbol/ remove /g;
- save the file and make a copy, but drop the TXT extension, and lose the
33_ prefix.
The script needs to perform this on every file in the directory, saving the
new file as a the 4-digit filename, with no trailing extension.
I'm writing this script to parse out some thousands of files, stored on
floppy disks.
I read that using the following would perform the job, however I am at a
loss for the search and replace part. How do I get perl to read these
characters, and replace them?
perl -p -i -e "s/ male symbol and music note/ /;" `cat.txt`
I've added in the two characters, to show what needs to happen.
Cat.txt is a list of all the files in the folder. Is there a way to have
perl just go through the dir, one file at a time, without TELLING perl which
files (cat.txt)?
Anyone's assistance on this would be HUGELY appreciated!
THanks in advance,
Scott
PS. Perfaq 5 was not of any assistance to me with this matter...
------------------------------
Date: Mon, 03 May 1999 19:29:01 -0700
From: "Gee Starr" <geestarr@geedev.com>
Subject: ISO random sentence parser (like spew)
Message-Id: <7gllmj$cvi$1@q.seanet.com>
I'm looking for a perl script that uses recursive grammar techniques to
generate random sentences. I've found several scripts that will throw up a
string of text chosen from a pre-made list, but I'd really like to find
something that generates sentences on the fly.
I know there've been a few non-perl solutions like Spew and the Dada Engine;
what I'm looking for doesn't have to be that complex -- Don Cross's
Javascript implementation is along the scale I'm thinking.
Anybody here know of something like that?
TIA, Gee
--
___
___ geestarr@geedev.com
o GeeDev Labs: www.geedev.com
------------------------------
Date: Mon, 03 May 1999 19:28:30 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: ISPs that offer cgi space??
Message-Id: <372E5B4E.64C29F3E@mail.cor.epa.gov>
Bob Trieger wrote:
>
> [ courtesy cc sent by mail if address not munged ]
>
> "Mike Flaherty" <mflaherty2@earthlink.net> wrote:
> >I haven't looked yet but this seems like to best place to start.
>
> Far from it! What gave you the idea that it was even a place to
> consider posting this?
>
> Perl is a programming language. The web is a place to find nekkid
> pictures. The 2 have nothing to do with each other.
Bob, please!
[1] It's not the *pictures that `r' nekkid.
[2] As we learned the other week, this ng is a place for
pornographers to solicit, errm, cgi work. If that's what
those kids call it these days...
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541) 754-4468
mathematical statistician fax: (541) 754-4716
------------------------------
Date: Mon, 3 May 1999 17:08:30 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: ISPs that offer cgi space??
Message-Id: <e83lg7.bt2.ln@magna.metronet.com>
Mike Flaherty (mflaherty2@earthlink.net) wrote:
: I haven't looked yet but this seems like to best place to start.
This is an awful place to start.
This is the Perl newsgroup.
We discuss Perl here.
What is your Perl question?
WWW and CGI are discussed elsewhere.
comp.infosystems.www.authoring.cgi
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 3 May 1999 17:12:00 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: looking at directories
Message-Id: <0f3lg7.bt2.ln@magna.metronet.com>
Alex Black (enigma@turingstudio.com) wrote:
: No documentation found for 'readdir'
: and my box won't accept -f...
Then find go find it yourself.
perl -ne 'print if /^=.*readdir/' perlfunc.pod
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 04 May 1999 02:16:08 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: need user to be able to submit files from browser
Message-Id: <ILsX2.771$iu1.1182@news.rdc1.tn.home.com>
>how is this done? I know netscape has an ftp feature built
into the browser
>but I need a script (or maybe its just an html thing) that will
allow
>retrieval of a file(specified by the user) from the users
machine.
Your answer comes in 2 parts... the first of which is the method
in which the file is submitted. That is CGI and handled in
comp.infosystems.www.authoring.cgi
After you get the CGI stuff in your grasp, look at the CGI Perl
module or CGI::Lite module to be able to do anything with the
upload once it is on the server.
If you want something for free, the Perl CGI Faq...
ftp://ftp.orst.edu/pub/packages/CPAN/doc/FAQs/cgi/idiots-guide.h
tml
ftp://ftp.cs.colorado.edu/pub/perl/CPAN/doc/FAQs/cgi/perl-cgi-fa
q.html
and you better eventually read this too...
ftp://mirror.xmission.com/CPAN/doc/FAQs/cgi/www-security-faq.htm
l
If you can (and should) spend $20.00...
You might consider the Visual QuickStart Guide to
'Perl and CGI for the World Wide Web'
by Elizabeth Castro. ISBN 0-201-35358-X.
The book is perfectly suited for taking your first steps towards
Perl based Web Solutions using CGI.
CT
------------------------------
Date: Tue, 04 May 1999 02:29:07 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: need user to be able to submit files from browser
Message-Id: <TXsX2.772$iu1.1108@news.rdc1.tn.home.com>
>Perl based Web Solutions using CGI.
Or is that CGI Web Solutions using Perl?
or Perl based CGI scripts for Web Development?
or yet another mispost?
I never know how to put it without someone telling me otherwise.
CT
--------
$message = "Just another newbie";
print $message;
------------------------------
Date: Mon, 03 May 1999 21:15:10 -0400
From: metamorphon@hotmail.com
Subject: Newbie question
Message-Id: <372E4A1D.84F431DB@hotmail.com>
Is there a good book out there for beginners where I could learn Perl or
CGI on windows 95.
I know absulatly nothing about programming, I'm a graphic designer, I
specialize on 3D animation and video editing. It's been few months I've
been doing web page design. I'm really desperate to learn Perl, could I
learn it from a book or should I take a course?
------------------------------
Date: Mon, 03 May 1999 19:52:38 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Newbie question
Message-Id: <372E60F6.B7B19862@mail.cor.epa.gov>
metamorphon@hotmail.com wrote:
>
> Is there a good book out there for beginners where I could learn Perl or
> CGI on windows 95.
> I know absulatly nothing about programming, I'm a graphic designer, I
> specialize on 3D animation and video editing. It's been few months I've
> been doing web page design. I'm really desperate to learn Perl, could I
> learn it from a book or should I take a course?
Hmmm, this is a bit of a poser. You see, the *good* books on Perl
more-or-less assume some basic programming background. Variables,
arrays, flow control, loops... There may be some good Perl books
which start at zero, but I don't know of any. Most of the books in
this category are 'for dummies' if you get my drift.. and they have
plenty of errors, which I guess they assume their users will never
notice. You can go to http://www.reference.perl.com/ and take a
look at the book reviews to see if any sound appealing. You
might consider "Teach Yourself Perl in 21 Days", although I've been
told that the similar "Teach Yourself [something with Perl and CGI
in the title] in [some number] Days" book has a lot of flaws and
should be avoided.
If you feel that your lack of programming background might be a
hindrance, you might want to look into a course. There are lots of
good Perl courses taught by very reputable Perlites. And you might
want to start out by scanning the web for some basic Perl
tutorials. Some of them are quite good, although I can't give you
any URLs.
One more thing: Perl is extremely powerful, but it is not
designed to be extremely consistent. You have to learn the rules.
It looks odd in places if you have no previous exposure to the
languages and tools it borrows from. You hsould get a nice e-mail
from gnat with hints about Perl programming. Print it off and
keep it. You'll appreciate the hints a lot more once you start
programming in Perl.
Good luck,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541) 754-4468
mathematical statistician fax: (541) 754-4716
------------------------------
Date: Mon, 03 May 1999 19:58:35 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
To: Hewitt Marjorie <revjack@radix.net>
Subject: Oops... Re: pattern matching
Message-Id: <372E625B.561458A9@chatbase.com>
[Posted & Mailed]
Hewitt Marjorie wrote:
>
> TRG Software : Tim Greer explains it all:
>
> :bing-du@tamu.edu wrote:
> :>
> :> Greetings all...
> :>
> :> I want to remove all the blank spaces before and after (but between 'a' and
> :> 'b') the comma ','. But the following code snippet did not work.
> :>
> :> $test = 'a, b c';
> :> $test =~ s/(\s+),(\s+)/,/;
> :> print "test is $test\n"; # the output is still 'a, b c' but rather 'a,b c'.
>
> :Did you mean:
> :$test =~ s/,(\s+)/,/;
>
> Why are you capturing? Anyways, this doesn't meet his stated requirements,
> as it ignores spaces before the comma. Larry got it right:
>
> s/\s*,\s*/,/g;
>
Actually, after re-reading the original post, I have to admit that I
missed something. I (for some off the wall reason), didn't read the
"blank spaces before and after the comma ','." sentence correctly, and
just saw his example string with no space before the comma.
Again, he hadn't stated that he wanted it to work this way in every
instance, so hence my answer. I overlooked that, or I certainly would
have answered it differently. Thanks for bringing that to my attention.
--
Regards,
Tim Greer: chatmaster@chatbase.com / software@linkworm.com
The Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software & The Link Worm: http://www.linkworm.com
Custom chat server scripts, CGI scripting in Perl/C, Trouble shooting,
Security, Modify & Debug, Freelance Scripting and more!
------------------------------
Date: Mon, 03 May 1999 19:45:59 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
To: Hewitt Marjorie <revjack@radix.net>
Subject: Re: pattern matching
Message-Id: <372E5F67.8C9760FD@chatbase.com>
[Posted & mailed]
Hewitt Marjorie wrote:
>
> TRG Software : Tim Greer explains it all:
>
> :bing-du@tamu.edu wrote:
> :>
> :> Greetings all...
> :>
> :> I want to remove all the blank spaces before and after (but between 'a' and
> :> 'b') the comma ','. But the following code snippet did not work.
> :>
> :> $test = 'a, b c';
> :> $test =~ s/(\s+),(\s+)/,/;
> :> print "test is $test\n"; # the output is still 'a, b c' but rather 'a,b c'.
>
> :Did you mean:
> :$test =~ s/,(\s+)/,/;
>
> Why are you capturing?
I assume *he* had a reason, ask him. :-)
> Anyways, this doesn't meet his stated requirements,
It did for his exact example. I didn't assume he wanted ot needed
anymore. He may not *want* to filter out all spaces. He never said he
did. In fact, he specifically stated he wanted the result to be:
'a,b c'. Which is now would be. If he asked how to filter out all spaces
between all commas, then my answer would have been different.
> as it ignores spaces before the comma.
I am aware, completely.
> Larry got it right:
>
> s/\s*,\s*/,/g;
>
I haven't seen Larry wrong yet. :-) I never stated that he didn't "have
it right", and I had replied to the post long before Larry did, or I
wouldn't have bothered posting after it's been answered. Larry's post
was to suggest that he might want to do that for ever comma in the line,
which he didn't know is what the guy was wanting or not. If so, then it
helped the guy a lot more then he knows. If not, then it'll help him
understand it better later perhaps. No one was 'wrong' or right. I gave
the guy the exact answer he was looking for, for his exact problem. I
didn't "assume" he wanted greater elaboration, why do you? :-)
I recall very clearly, that you were in the CGI NG not too many moons
ago, getting on everyone's case, and a good portion of it,. that you
didn't understand. (No offense, but I recall you asking how to create
some mailto script, that proves this). Perhaps you've learned a lot, or
have advanced greatly, and if not, I'm sure you will eventually.
However, I'd appreciate it if you didn't get on _my_ case, because I
didn't answer the posters question in more more elaborate manner.
I also ask, that you not start another "cyber-brawl" here either. (not
saying your post today was anything of the sort.), but from my
experience with you, I ask all the same.. and if nothing else, you take
it into private emails, so the rest of the group doesn't have to be
subjected to your remarks. Then again, perhaps you've moved beyond that
and won't do it here, which I thank you for. For now however, do me the
favor of not stating I was 'wrong', when I wasn't. :-)
--
Regards,
Tim Greer: chatmaster@chatbase.com / software@linkworm.com
The Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software & The Link Worm: http://www.linkworm.com
Custom chat server scripts, CGI scripting in Perl/C, Trouble shooting,
Security, Modify & Debug, Freelance Scripting and more!
------------------------------
Date: Tue, 04 May 1999 12:25:50 +1000
From: Ken Blinco <citeckeb@citec.qld.gov.au>
Subject: Perl install problems - bsdos
Message-Id: <372E5AAE.22362F38@citec.qld.gov.au>
Hi,
O/S: BSD/OS 3.1
Perl: perl5.005_03
I'm trying to install this version of perl on an Intel box running bsdos. I am
having no luck at the moment. The most common error message I get is:
shlicc2 -o miniperl miniperlmain.o libperl.a
pp.o: Undefined symbol _pow referenced from text segment
pp.o: Undefined symbol _atan2 referenced from text segment
pp.o: Undefined symbol _sin referenced from text segment
pp.o: Undefined symbol _cos referenced from text segment
pp.o: Undefined symbol _exp referenced from text segment
pp.o: Undefined symbol _log referenced from text segment
pp.o: Undefined symbol _sqrt referenced from text segment
pp.o: Undefined symbol _floor referenced from text segment
pp.o: Undefined symbol _floor referenced from text segment
*** Error code 1
Stop.
If anyone has any suggestions, it'd be appreciated.
I tried to find a binary distribution of perl for bsd/os but it seems that there
are none around. Does anyone know if there is a reason for this?
Thanks for any info.
Ken
----------------------------------------------------------
Ken Blinco E-Mail: Ken.Blinco@citec.com.au
Unix Support Group Phone: +61 7 322 76970
CITEC, GPO Box 297 Brisbane, Queensland 4001 Australia
------------------------------
Date: Mon, 3 May 1999 17:32:19 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Problem in calling subroutine inside another routine
Message-Id: <3l4lg7.bt2.ln@magna.metronet.com>
shaominchi@my-dejanews.com wrote:
: When I call func1() inside func2(), PERL complained.
: Can any one tell me why I got the following errors ?
perl is telling you.
: #========== Error message when try to run the program ==========
: # Prototype mismatch: sub main::func1 ($$) vs () at t2.pl line 19.
: # Too many arguments for main::func1 at t2.pl line 27, near "$type )"
: # Execution of t2.pl aborted due to compilation errors.
: sub func1() {
^^
^^ you are saying here that func1 takes no arguments
: $ret = func1( $ff, $type ); ### this is the complained line
Then you call it _with_ arguments.
If you don't lie to perl like that, then you won't have
such problems.
If you don't know how prototypes work, then don't use them.
Lose the empty parens (they are prototypes), or change
them so that they require the 2 scalar args that you seem
to want to use.
That is:
sub func1 { # no prototype
or
sub func1($$) { # prototype for 2 scalars
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 04 May 1999 01:47:11 GMT
From: jrobens@my-dejanews.com
Subject: return codes from called scripts
Message-Id: <7gljiu$3q3$1@nnrp1.dejanews.com>
I am trying to get the return code from a script called on the command line,
and the output from the command.
Now if I try the system() call, I get the return code, but there is no way to
get any messages returned other than saving it to a temporary file and reading
this file after. This solution sounds a bit messy.
The other way that I have tried is through the open(), but the return code for
this will tell me whether the open worked and what the file handle is, but not
the success of the called command.
I also tried the following:
# Run the program and keep the output
# Strangely enough PERL does not let you collect the result
# from a command and its output. :-)code= is the delimeter.
# If someone outputs this from a program, they can trick us.
my ($open_result) = open(PROCESS,
"$current_process 2>&1; echo \":-\)code=$?\" |");
my (@process_message) = <PROCESS>;
close(PROCESS);
But even though $current_process fails, the output is code=0.
So does PERL do something funny with the command? The output that I get is:
DB<10> p $process_message_string
cp: /home/test: No such file or directory
:-)code=0
What am I doing incorrectly?
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 04 May 1999 02:09:09 GMT
From: jrobens@my-dejanews.com
Subject: return codes from called scripts
Message-Id: <7glks3$4rm$1@nnrp1.dejanews.com>
I am trying to get the return code from a script called on the command line,
and the output from the command.
Now if I try the system() call, I get the return code, but there is no way to
get any messages returned other than saving it to a temporary file and reading
this file after. This solution sounds a bit messy.
The other way that I have tried is through the open(), but the return code for
this will tell me whether the open worked and what the file handle is, but not
the success of the called command.
I also tried the following:
# Run the program and keep the output
# Strangely enough PERL does not let you collect the result
# from a command and its output. :-)code= is the delimeter.
# If someone outputs this from a program, they can trick us.
my ($open_result) = open(PROCESS,
"$current_process 2>&1; echo \":-\)code=$?\" |");
my (@process_message) = <PROCESS>;
close(PROCESS);
But even though $current_process fails, the output is code=0.
So does PERL do something funny with the command? The output that I get is:
DB<10> p $process_message_string
cp: /home/test: No such file or directory
:-)code=0
What am I doing incorrectly?
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 4 May 1999 01:31:03 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Stumped on Regex routine
Message-Id: <ebohlmanFB6pJr.9wI@netcom.com>
Ala Qumsieh <aqumsieh@matrox.com> wrote:
: Jakob Larnforth <jakob@pris.bc.ca> writes:
: > $Url = 'http://www.somedomain.com/frugal/jummy.html';
: > $Url =~ s/\/.+?$//;
: >
: > I am trying to get the final output of $Url to eq
: > http://www.somedomain.com/frugal
: $Url =~ s-/[^/]+$--;
Anyone who would choose a delimiter like that is badly in need of being
whipped with a cat-o'-nine-tails made out of overcooked fettucine.
------------------------------
Date: Mon, 03 May 1999 19:55:03 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Stumped on Regex routine
Message-Id: <372E6187.22F459A@mail.cor.epa.gov>
Eric Bohlman wrote:
>
> Ala Qumsieh <aqumsieh@matrox.com> wrote:
> : Jakob Larnforth <jakob@pris.bc.ca> writes:
>
> : > $Url = 'http://www.somedomain.com/frugal/jummy.html';
> : > $Url =~ s/\/.+?$//;
> : >
> : > I am trying to get the final output of $Url to eq
> : > http://www.somedomain.com/frugal
>
> : $Url =~ s-/[^/]+$--;
>
> Anyone who would choose a delimiter like that is badly in need of being
> whipped with a cat-o'-nine-tails made out of overcooked fettucine.
Ala's just practicing. He's getting his entry for the obfuscated
Perl contest ready. :-)
I like using # as an alternate delimiter, but that plays havoc with
poorly-written comment strippers...
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541) 754-4468
mathematical statistician fax: (541) 754-4716
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". 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". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 5555
**************************************