[24603] in Perl-Users-Digest
Perl-Users Digest, Issue: 6779 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 8 18:05:50 2004
Date: Thu, 8 Jul 2004 15:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 8 Jul 2004 Volume: 10 Number: 6779
Today's topics:
Re: A doubt about m//'s related variables <bik.mido@tiscalinet.it>
Re: Auto die on failed sys calls? <jkrugman345@yahbitoo.com>
hash as argument <aaron@deloachcorp.com>
Re: hash as argument <perl@my-header.org>
Re: Matching of optional parts in regular expressions (Ulrich Schöbel)
Negation of RegEx (Dan)
Re: Negation of RegEx <andre.wisniewski@gmx.de>
Re: Not sure if Perl or browser problem..... <Joe.Smith@inwap.com>
Re: Not sure if Perl or browser problem..... (Scott J)
Re: Not sure if Perl or browser problem..... <spamtrap@dot-app.org>
Re: out of memory <M@linux.ca>
Re: out of memory <noreply@gunnar.cc>
Re: out of memory <M@linux.ca>
Re: out of memory <M@linux.ca>
Re: out of memory <xx087@freenet.carleton.ca>
Re: perl cgi problem <mritty@gmail.com>
Re: perl cgi problem <sbryce@scottbryce.com>
Re: perl cgi problem <pfancy@bscn.com>
Re: perl cgi problem <noreply@gunnar.cc>
Re: perl cgi problem <pfancy@bscn.com>
Re: perl cgi problem <pfancy@bscn.com>
Re: perl cgi problem <pfancy@bscn.com>
Perl newbie please help (Jordy Keighan)
Re: Perl newbie please help <mritty@gmail.com>
Problem with Archive::Tar <qa3653@email.mot.com>
Re: Problem with Archive::Tar <odyniec-usenet@odyniec.net>
Returns / list context <chrisnewton@no.junk.please.btinternet.com>
Re: What does this do? <spamtrap@dot-app.org>
Re: What does this do? <bmb@ginger.libs.uga.edu>
Re: What does this do? <abigail@abigail.nl>
Re: What does this do? (Peter J. Acklam)
Re: Why use dollar sign $ for variables <bik.mido@tiscalinet.it>
Re: Writing a Lisp interpreter in Perl? <odyniec-usenet@odyniec.net>
Re: Writing a Lisp interpreter in Perl? <nilram@hotpop.com>
Re: Writing a Lisp interpreter in Perl? <sap6210@rit.edu>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 08 Jul 2004 20:44:57 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: A doubt about m//'s related variables
Message-Id: <rj4re0d91n58ai3iq844qiafk9j99ngr4l@4ax.com>
On Wed, 7 Jul 2004 16:38:17 -0400, Jeff 'japhy' Pinyan
<pinyaj@rpi.edu> wrote:
>>I mean: are $`, $' and $1 those coming from the
>>*first* pattern matching in all cases?
>
>You could have determined that on your own with testing. As it stands,
Yes, indeed I could have! :-p
But for once my judgement was to better express my laziness asking on
clpmisc...
>yes they are. I'm a little surprised about $` and $', but that's because
>split() doesn't affect them. Had you done:
>
> if ( /\{([\w:]+)\}/ ) {
> do_something($`, $', $1 =~ /[^:]*/g);
> }
>
>you would get rather unexpected results.
Well, in this case I'd say "expected unexpected results"!
>I also advise against using $` and $' and $& if you can avoid them.
Actually I can hardly remember having used them in more than two or
three cases before. But in a particular script I have, it happens that
I "have to", for a particularly relaxed acceptation of "to have to",
i.e. as it is now, I'm not using them (an the script does work), or
better, I'm using them in an undoubtedly safe form, but to use them as
hinted above would really come handy.
Michele
--
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
"perl bug File::Basename and Perl's nature"
------------------------------
Date: Thu, 8 Jul 2004 20:26:03 +0000 (UTC)
From: J Krugman <jkrugman345@yahbitoo.com>
Subject: Re: Auto die on failed sys calls?
Message-Id: <cckakr$qn5$1@reader2.panix.com>
In <40EBE293.CB5490A6@acm.org> "John W. Krahn" <krahnj@acm.org> writes:
>J Krugman wrote:
>>
>> Is there any way to instruct perl to die whenever a system call
>> (e.g. through open, opendir, backticks, system, etc.) fails?
>>
>> The aim is to be able to enclose a series of such calls in a single
>> eval block, and catch any failures at the end, instead of checking
>> for them after each system call.
>perldoc Fatal
Great!
Thanks!
jill
--
To s&e^n]d me m~a}i]l r%e*m?o\v[e bit from my a|d)d:r{e:s]s.
------------------------------
Date: Thu, 8 Jul 2004 16:41:44 -0500
From: "Aaron DeLoach" <aaron@deloachcorp.com>
Subject: hash as argument
Message-Id: <A7Gdne3lgYMFInDdRVn-sw@eatel.net>
I am trying to call a sub with two arguments. One being a hash generated
from a sub, the other being a string. I've tried other variations but can
only get the receiving sub to recognize either the hash or the string, but
never both.
e.g, &do_something(&create_hash, "This is the string.");
sub do_something
{
my (%hash, $string) = @_;
process...
}
sub create_hash
{
my %h;
# construct the hash ...
return %h;
}
Can anyone get me in the right direction?
Regards,
Aaron
------------------------------
Date: Thu, 08 Jul 2004 23:56:28 +0200
From: Matija Papec <perl@my-header.org>
Subject: Re: hash as argument
Message-Id: <fkgre0hj8hnmkin37di5ilqlfckvbrf43p@4ax.com>
X-Ftn-To: Aaron DeLoach
"Aaron DeLoach" <aaron@deloachcorp.com> wrote:
>I am trying to call a sub with two arguments. One being a hash generated
>from a sub, the other being a string. I've tried other variations but can
>only get the receiving sub to recognize either the hash or the string, but
>never both.
>
>e.g, &do_something(&create_hash, "This is the string.");
>
>sub do_something
>{
> my (%hash, $string) = @_;
>
> process...
>}
>
>sub create_hash
>{
> my %h;
> # construct the hash ...
> return %h;
>}
>
>Can anyone get me in the right direction?
Try,
my ($string, %hash) = @_;
this is for the same reason you can't
my (@arr, $string) = @_;
as @arr gets all arguments from @_
--
Matija
------------------------------
Date: Thu, 8 Jul 2004 18:03:47 +0200
From: usus@aladyn.de (Ulrich Schöbel)
Subject: Re: Matching of optional parts in regular expressions
Message-Id: <39rjcc.h6n.ln@usus.aladyn.de>
In article <40ed1d8f.0407080602.bd6de25@posting.google.com>,
Markus.Elfring@web.de (Markus Elfring) writes:
> Does this example show an error in the implementation?
No. All three examples work absolutely correct.
>
> % regexp {\s*(\d+)(?:%(\w+))?} { !123!} z a b
> 1
> % foreach X {a b} {puts "$X=|[set $X]|"}
> a=|123|
> b=||
Regex is not anchored. It matches no whitespace (\s*),
three digits (\d+) and no word introduced by a % sign.
> % regexp {\s*(\d+)(?:%(\w+))?$} { !123!} z a b
> 0
Same as before, but anchored at the end. The final ! is
not matched, so the entire regex doesn't match.
> % regexp {\s*(\d+)(?:%(\w+))?} { 456%} z a b
> 1
> % foreach X {a b} {puts "$X=|[set $X]|"}
> a=|456|
> b=||
Same as first example.
>
> I think that the specified strings must not match to the pattern.
> How do you think about it?
Everything is working ok.
Best regards
Ulrich
--
For those of you who don't get this e-mail, let me know and I'll re-send it.
------------------------------
Date: 8 Jul 2004 11:47:53 -0700
From: dan_yuan@trendmicro.com (Dan)
Subject: Negation of RegEx
Message-Id: <4c135583.0407081047.6aa63fe6@posting.google.com>
Hi everybody,
I have a special problem as the following:
$sentence="a hard problem";
I want to build a regular expression for searching there is
no word "hard" in the above sentence.
Usually, we could try $sentence !~/RegEx/ for this problem.
But, I am not allowed to use "!~", I can only use "=~" for this
problem, which means that /RegEx/ is a pattern for searching no
"hard" in a sentence.
Is there anyone who konws the solution of this problem?
Thanks in advance
Dan
------------------------------
Date: Thu, 08 Jul 2004 20:53:46 +0200
From: "Andre Wisniewski" <andre.wisniewski@gmx.de>
Subject: Re: Negation of RegEx
Message-Id: <opsat1fwpdudlqzq@ares>
> I have a special problem as the following:
>
> $sentence="a hard problem";
>
> I want to build a regular expression for searching there is
> no word "hard" in the above sentence.
> Usually, we could try $sentence !~/RegEx/ for this problem.
> But, I am not allowed to use "!~", I can only use "=~" for this
> problem, which means that /RegEx/ is a pattern for searching no
> "hard" in a sentence.
>
> Is there anyone who konws the solution of this problem?
Two weeks ago this problem was discussed already.
Subject: REGEX negation
First read this.
--
Andre
---
Fighting for peace is like f..ing for virginity
------------------------------
Date: Thu, 08 Jul 2004 18:37:13 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Not sure if Perl or browser problem.....
Message-Id: <tvgHc.45911$IQ4.21094@attbi_s02>
Scott J wrote:
> print qq($lastName $firstName);
>
> If this script is running on a windows machine, I remember reading how
> using the qq() operator wont work, fyi.
You remember incorrectly. q($lastName $firstName) won't work but qq() will.
-Joe
------------------------------
Date: 8 Jul 2004 12:45:30 -0700
From: scottjou@farnell.ns.ca (Scott J)
Subject: Re: Not sure if Perl or browser problem.....
Message-Id: <eccfc6d8.0407081145.4b665562@posting.google.com>
Hey sherm...first off, I wasn't criticizing anyone. I was offering
help to someone who was asking. I have no problem leaving this group a
scant day after I came, if my input isn't welcome.
Sherm Pendley <spamtrap@dot-app.org> wrote in message news:<Y9-dnc6Zef5zwnDd4p2dnA@adelphia.com>...
> Scott J wrote:
>
> > You have loaded the CGI module, but you have not initialized it.
>
> Have you ever actually looked at the CGI.pm docs? The function-based style
> is perfectly valid; an example of it is given as the very first thing in
> the CGI.pm man page, in the synopsis section.
>
> There is a thorough discussion of the two styles in the "Programming Style"
> section as well - the very first section in the full docs.
I have read the CGI.pm docs. After re-reading, you are correct. Before
my next post I will spend no less than 2 hours scouring the web to
ensure my answer is as exact and flawless as is expected. TMTOWTDI.
>
> > $query = new CGI;
>
> This does not "initialize" the CGI.pm module. It creates a new instance of
> class CGI, which has the param() method you use later.
>
It appears I chose the wrong word (initialized). In the future I will
"try" to be as exact and flawless as is expected. TWTOWTDI.
> > print "Content-type: text/html\n\n";
>
> If you're going to criticize how others use CGI.pm, you'd better use it
> correctly yourself:
>
> print header("text/html");
>
> Or, with the OOP style:
>
> print $query->header("text/html");
>
TMTOWDI.
> > If this script is running on a windows machine, I remember reading how
> > using the qq() operator wont work, fyi.
>
> Do you have any supporting evidence for this? I haven't heard about this bug
> before, and Google didn't turn up anything. Given the error-riddled nature
> of the rest of your post, I'm sceptical.
>
Not a bug, but a feature that wasn't available with all ports of perl.
I read this in a book somewhere. I did a quick search on the net and
couldn't find anything either. So, if I'm wrong, I certainly hope I go
to hell.
> >>Is there something with IE6 on WinXP that would stop my HTML forms
> >>from processing the entered information to my perl script. I just
> >>switched
> >>systems from Win95 / IE5.5 (where the form and script worked fine), to
> >>XP Pro with IE6.
>
> >>FORM:
> >><form action="cgi-bin/Home.pl" method=post>
> >>First Name: <input type=text name="firstName"><br>
> >>Last Name: <input type=text name="lastName">
> >><p align=center><input type=submit value="Continue"><br><br></p>
> >></form>
>
> This is not valid HTML 4.01/Strict. Using that DTD, input elements cannot
> "float" loose inside a form; they have to be contained in a block element,
> which in turn is contained by the form. Try this instead:
>
> <form action="cgi-bin/Home.pl" method=post>
> <p>First Name: <input type=text name="firstName"><br>
> Last Name: <input type=text name="lastName"></p>
>
> <p align=center><input type=submit value="Continue"><br><br></p>
> </form>
>
> While it might seem like nit-picking, this might actually make a difference
> in IE6, which has so-called "strict" and "quirks" modes that are triggered
> by the DTD declaration. If it's working in "strict" mode, IE6 could be
> ignoring the invalid inputs.
>
> sherm--
To recap, I offered my help. I have been wrong in the past and you
have been too!! You being anyone, not specifically you.
Well, I wasted enough of my time and energy replying to this.
Scott
------------------------------
Date: Thu, 08 Jul 2004 16:22:25 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Not sure if Perl or browser problem.....
Message-Id: <ZZednQFrM7eeMHDdRVn-ig@adelphia.com>
Scott J wrote:
> Hey sherm...first off, I wasn't criticizing anyone. I was offering
> help to someone who was asking.
*Shrug* Call it what you will, the fact remains that you incorrectly pointed
out mistakes in the code that weren't really mistakes, and posted a
"solution" that had mistakes of its own.
> I have no problem leaving this group a
> scant day after I came, if my input isn't welcome.
> my next post I will spend no less than 2 hours scouring the web to
> ensure my answer is as exact and flawless as is expected. TMTOWTDI.
> It appears I chose the wrong word (initialized). In the future I will
> "try" to be as exact and flawless as is expected. TWTOWTDI.
> So, if I'm wrong, I certainly hope I go to hell.
Do you always over-react this much?
No one asked you to leave, no one told you to go to hell, and it took 2
seconds glancing at 'perldoc CGI', not "2 hours scouring the web" to verify
my posting. And finally, initializing a module and instantiating an object
are *completely* different concepts, not just a minor difference in
terminology.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Thu, 8 Jul 2004 10:58:44 -0400
From: marathon <M@linux.ca>
Subject: Re: out of memory
Message-Id: <slrnceqo94.4p4.M@barnyard.sweetpig.dyndns.org>
On Wed, 7 Jul 2004 23:27:07 -0400, Paul Lalli in comp.lang.perl.misc wrote:
>On Wed, 7 Jul 2004, marathon wrote:
>> Folks:
>>
>> I'm attempting to run a script that converts dmg2iso. Each attempt to
>> run, it terminates with an out of memory error.
>>
>> Is this a fault of the script or something else?
>>
>> FWIW, I get the same result, when I run the application as a script on Debian,
>> or as an executable binary on Windoze.
>Exactly how do you expect anyone to answer this question? You want us to
>tell you if there's a problem with a script we can't see?
Sorry, I'm not a Perl programmer and I was asking in the generic sense.
I wished to know where to look, system or script. Now that I know it's
the script, I'll ask the other helpful gentleman, who mentioned the
line. Appears he knows the script.
Thanks for the help, astonishing how the rest of the thread as
detoriated. Is this indicative of the level of maturity found here? I
hope not, reading some of the threads, this group sounds like an 'alt'
group...
--
S.Allen
-----------------------------------------------
barnyard Thursday Jul 08 2004 10:55:01 AM EDT
-----------------------------------------------
HERE LIES LESTER MOORE
SHOT 4 TIMES WITH A .44
NO LES
NO MOORE
-- tombstone, in Tombstone, AZ
------------------------------
Date: Thu, 08 Jul 2004 17:26:16 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: out of memory
Message-Id: <2l57k1F8r7qsU1@uni-berlin.de>
marathon wrote:
> Sorry, I'm not a Perl programmer and I was asking in the generic
> sense.
BS! You were referring to errors resulting from your attempts to run a
script. Now I realize that it was probably just a veiled homework
question. :(
> Now that I know it's the script, I'll ask the other helpful
> gentleman, who mentioned the line. Appears he knows the script.
I thought it was the kind of answer your question deserved. Your
'clarification' did not make me change my mind.
> Thanks for the help, astonishing how the rest of the thread as
> detoriated.
http://www.catb.org/~esr/faqs/smart-questions.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 8 Jul 2004 11:10:05 -0400
From: marathon <M@linux.ca>
Subject: Re: out of memory
Message-Id: <slrnceqoud.4p4.M@barnyard.sweetpig.dyndns.org>
On Thu, 08 Jul 2004 05:15:23 +0200, Gunnar Hjalmarsson in comp.lang.perl.misc wrote:
>marathon wrote:
>> I'm attempting to run a script that converts dmg2iso. Each attempt
>> to run, it terminates with an out of memory error.
>>
>> Is this a fault of the script or something else?
>It's the script. The problem is caused by the bug on line 679.
Oh really?! OK so you're being facetious, I understand.
I've put the script online, it's viewable here;
<http://sweetpig.dyndns.org:1000/~steve123/dmg2iso.txt>
What's output when run, is the following;
reading property list...found 1 partitions
decompressing:
partition 0
Out of memory!
--
S.Allen
-----------------------------------------------
barnyard Thursday Jul 08 2004 11:00:01 AM EDT
-----------------------------------------------
One of the disadvantages of having children is that they eventually get old
enough to give you presents they make at school.
-- Robert Byrne
------------------------------
Date: Thu, 8 Jul 2004 12:20:25 -0400
From: marathon <M@linux.ca>
Subject: Re: out of memory
Message-Id: <slrnceqt29.63e.M@barnyard.sweetpig.dyndns.org>
On Thu, 08 Jul 2004 17:26:16 +0200, Gunnar Hjalmarsson in comp.lang.perl.misc wrote:
>marathon wrote:
>> Sorry, I'm not a Perl programmer and I was asking in the generic
>> sense.
>BS! You were referring to errors resulting from your attempts to run a
>script. Now I realize that it was probably just a veiled homework
>question. :(
Now you're attempting to be a clarivoyant, a very poor one I might add.
I'm not taking any perl courses my friend. So please take your
susupicious nature somewhere else.
I'm a layperson, asking a lay question. Is that too hard for you to
grasp?
>> Now that I know it's the script, I'll ask the other helpful
>> gentleman, who mentioned the line. Appears he knows the script.
>I thought it was the kind of answer your question deserved. Your
>'clarification' did not make me change my mind.
>> Thanks for the help, astonishing how the rest of the thread as
>> detoriated.
>http://www.catb.org/~esr/faqs/smart-questions.html
Just to clarify, I suspected it was the script, but I needed
clarification before posting the script in question. In hindsight, that
perhaps wasn't the thing to do, but unlike you I'm not perfect.
Have a good day chump! The world needs more helpful people like you.
--
S.Allen
-----------------------------------------------
barnyard Thursday Jul 08 2004 12:10:02 PM EDT
-----------------------------------------------
Who is D.B. Cooper, and where is he now?
------------------------------
Date: 8 Jul 2004 17:15:00 GMT
From: Glenn Jackman <xx087@freenet.carleton.ca>
Subject: Re: out of memory
Message-Id: <slrncer08k.416.xx087@smeagol.ncf.ca>
marathon <M@linux.ca> wrote:
> >marathon wrote:
> >> I'm attempting to run a script that converts dmg2iso. Each attempt
> >> to run, it terminates with an out of memory error.
[...]
>
> I've put the script online, it's viewable here;
>
> <http://sweetpig.dyndns.org:1000/~steve123/dmg2iso.txt>
>
> What's output when run, is the following;
>
> reading property list...found 1 partitions
> decompressing:
> partition 0
> Out of memory!
Have you tried debugging your script? For example, how big is $in_size
when you try to read? What is the $block_type just before you run out
of memory? How big is $output when you inflate your $tmp string?
--
Glenn Jackman
NCF Sysadmin
glennj@ncf.ca
------------------------------
Date: Thu, 8 Jul 2004 16:58:06 -0400
From: Paul Lalli <mritty@gmail.com>
Subject: Re: perl cgi problem
Message-Id: <20040708165518.J15079@barbara.cs.rpi.edu>
On Thu, 8 Jul 2004, pfancy wrote:
> Ok. since this is perl and it deals with cgi i was hoping someone can help
> me out. I am working on a guest book and I get to the addguest part. and
> when i click on the submit button to add it to the cgi part it says it can
> not find my guestbook.cgi file. i have that file in my cgi-bin folder what
> is up
> It may because i don't have a sendmail thing. what can you tell me and am i
> not adding something that needs to be there?
There's no way I'm going to look through this massive amounts of code to
find a possible error. However . . . .
>
> $guestbookurl = "http://www.yourhost.com/guestbook/guestbook.html";
> $guestbookreal = "/home/yourhostt/guestbook/guestbook.html";
^^^^^
Is that intentional? everywhere else, it says 'yourhost', but here it's
'yourhostt'. Is it possible that's the file it can't find?
> $guestlog = "http://www.yourhost.com/guestbook/guestlog.html";
> $cgiurl = "http://www.yourhost.com/guestbook/cgi-bin/guestbook.pl";
^^^^
You said it can't find your guestbook.cgi file, but you're posting to
a guestbook.pl file. Is this possibly the cause of your error?
Paul Lalli
<snipped a LOT of lines>
------------------------------
Date: Thu, 08 Jul 2004 15:10:14 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: perl cgi problem
Message-Id: <10ere1nibor9ned@corp.supernews.com>
pfancy wrote:
> # Copyright 1996 Matt Wright mattw@scriptarchive.com
> #
> # Created 4/21/95 Last Modified 10/29/95
> #
> # Scripts Archive at: http://www.scriptarchive.com/
That is part of the problem right there. There is a drop-in replacement
for this script here:
http://nms-cgi.sourceforge.net/scripts.shtml
It is much better and more secure.
------------------------------
Date: Thu, 8 Jul 2004 16:14:19 -0500
From: "pfancy" <pfancy@bscn.com>
Subject: Re: perl cgi problem
Message-Id: <40edd3cd@news.greennet.net>
"Paul Lalli" <mritty@gmail.com> wrote in message
news:20040708165518.J15079@barbara.cs.rpi.edu...
> On Thu, 8 Jul 2004, pfancy wrote:
>
> > Ok. since this is perl and it deals with cgi i was hoping someone can
help
> > me out. I am working on a guest book and I get to the addguest part.
and
> > when i click on the submit button to add it to the cgi part it says it
can
> > not find my guestbook.cgi file. i have that file in my cgi-bin folder
what
> > is up
> > It may because i don't have a sendmail thing. what can you tell me and
am i
> > not adding something that needs to be there?
>
> There's no way I'm going to look through this massive amounts of code to
> find a possible error. However . . . .
>
> >
> > $guestbookurl = "http://www.yourhost.com/guestbook/guestbook.html";
> > $guestbookreal = "/home/yourhostt/guestbook/guestbook.html";
> ^^^^^
> Is that intentional? everywhere else, it says 'yourhost', but here it's
> 'yourhostt'. Is it possible that's the file it can't find?
>
> > $guestlog = "http://www.yourhost.com/guestbook/guestlog.html";
> > $cgiurl = "http://www.yourhost.com/guestbook/cgi-bin/guestbook.pl";
> ^^^^
>
> You said it can't find your guestbook.cgi file, but you're posting to
> a guestbook.pl file. Is this possibly the cause of your error?
>
> Paul Lalli
>
> <snipped a LOT of lines>
> > $guestbookreal = "/home/yourhostt/guestbook/guestbook.html";
> ^^^^^
No typo. thanks for noticing. that could be it. i going to look at that.
that could be it. Thanks a million.
------------------------------
Date: Thu, 08 Jul 2004 23:18:56 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: perl cgi problem
Message-Id: <2l5ru7F9dlqeU1@uni-berlin.de>
pfancy wrote:
> I am working on a guest book ...
Are you? To me it appears as if you are just configuring Matt's
guestbook script. Even if it makes me nostalgic (modifying that script
was my first acquaintance with Perl), you'd better pick another
script, such as the guestbook script here, instead:
http://nms-cgi.sourceforge.net/scripts.shtml
> It may because i don't have a sendmail thing.
What would the "sendmail thing" have to do with a guestbook script?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 8 Jul 2004 16:23:12 -0500
From: "pfancy" <pfancy@bscn.com>
Subject: Re: perl cgi problem
Message-Id: <40edd5e2@news.greennet.net>
"Paul Lalli" <mritty@gmail.com> wrote in message
news:20040708165518.J15079@barbara.cs.rpi.edu...
> On Thu, 8 Jul 2004, pfancy wrote:
>
> > Ok. since this is perl and it deals with cgi i was hoping someone can
help
> > me out. I am working on a guest book and I get to the addguest part.
and
> > when i click on the submit button to add it to the cgi part it says it
can
> > not find my guestbook.cgi file. i have that file in my cgi-bin folder
what
> > is up
> > It may because i don't have a sendmail thing. what can you tell me and
am i
> > not adding something that needs to be there?
>
> There's no way I'm going to look through this massive amounts of code to
> find a possible error. However . . . .
>
> >
> > $guestbookurl = "http://www.yourhost.com/guestbook/guestbook.html";
> > $guestbookreal = "/home/yourhostt/guestbook/guestbook.html";
> ^^^^^
> Is that intentional? everywhere else, it says 'yourhost', but here it's
> 'yourhostt'. Is it possible that's the file it can't find?
>
> > $guestlog = "http://www.yourhost.com/guestbook/guestlog.html";
> > $cgiurl = "http://www.yourhost.com/guestbook/cgi-bin/guestbook.pl";
> ^^^^
>
> You said it can't find your guestbook.cgi file, but you're posting to
> a guestbook.pl file. Is this possibly the cause of your error?
>
> Paul Lalli
> <snipped a LOT of lines>
I did look into that. i did notice i wrote guestbook.cgi i have been so
frustrated in trying to get it figured out. I'm sorry. i wrote the wrong
one done. i looked in to. i did mean .pl though. instead of .cgi. I'm sorr
for such a long code. but i did not know what else to do. but it gives me
the 404 error. I'm beginning to think that i have some code typed wrong
because it looks for the guestbook.pl file and says it can't find it, it
told me to set the chmod for 755 and i did. but it claims it can't find the
file but i have placed the guestbook.pl into the cgi bin.
------------------------------
Date: Thu, 8 Jul 2004 16:40:01 -0500
From: "pfancy" <pfancy@bscn.com>
Subject: Re: perl cgi problem
Message-Id: <40edd9d3@news.greennet.net>
> I did look into that. i did notice i wrote guestbook.cgi i have been so
> frustrated in trying to get it figured out. I'm sorry. i wrote the
wrong
> one done. i looked in to. i did mean .pl though. instead of .cgi. I'm
sorr
> for such a long code. but i did not know what else to do. but it gives
me
> the 404 error. I'm beginning to think that i have some code typed wrong
> because it looks for the guestbook.pl file and says it can't find it, it
> told me to set the chmod for 755 and i did. but it claims it can't find
the
> file but i have placed the guestbook.pl into the cgi bin.
here is the link from where i found that guestbook at
http://www.scriptarchive.com/
>
>
------------------------------
Date: Thu, 8 Jul 2004 16:44:05 -0500
From: "pfancy" <pfancy@bscn.com>
Subject: Re: perl cgi problem
Message-Id: <40eddac7@news.greennet.net>
"pfancy" <pfancy@bscn.com> wrote in message
news:40edd9d3@news.greennet.net...
>
> > I did look into that. i did notice i wrote guestbook.cgi i have been so
> > frustrated in trying to get it figured out. I'm sorry. i wrote the
> wrong
> > one done. i looked in to. i did mean .pl though. instead of .cgi. I'm
> sorr
> > for such a long code. but i did not know what else to do. but it gives
> me
> > the 404 error. I'm beginning to think that i have some code typed wrong
> > because it looks for the guestbook.pl file and says it can't find it,
it
> > told me to set the chmod for 755 and i did. but it claims it can't find
> the
> > file but i have placed the guestbook.pl into the cgi bin.
>
>
> here is the link from where i found that guestbook at
> http://www.scriptarchive.com/
>
> >
> >
> the link you guys gave me. Unless my download program did not consider it
a different file it look like it is the same one i have. is there a place
where we can show what the program will look like?
>
------------------------------
Date: 8 Jul 2004 13:31:30 -0700
From: jkeighan@cubewerx.com (Jordy Keighan)
Subject: Perl newbie please help
Message-Id: <98e56c89.0407081231.6157b2b8@posting.google.com>
I am trying to compose a URI with some values that I get
from parsing a XML string.
If I print $user_array[0] ===> value = 'bob'
but if I us it in URI->new( ... $user_array[0] ... ) the program
hangs.
If I manualy put 'bob' in $user_array[0]
all is good and the URI->new( ... $user_array[0] ... ) statement
works.
Wy can't I use the string I got from my XML parsing ???
Here is my code:
my $user_string = "";
my $parser = XML::DOM::Parser->new();
my $doc = $parser->parse($xml);
foreach my $key ($doc->getElementsByTagName('credentials')){
$user_string = $user_string . $key->getAttribute('name') .
" ";
}
@user_array = split(" ", $user_string);
print $user_array[0]; # VALUE OK prints bob!!!!
my $uri = URI->new("https://" . $ENV{HTTP_HOST} .
/cgi-bin/dacs/dacs_group.cgi?OPERATION=LIST_GROUP_MEMBERSHIP&MEMBER_NAME="
. $ENV{DACS_ACS_JURISDICTION} . ":" . $user_array[0].
"&JURISDICTION=CUBEWERX&DACS_VERSION=1.2&FORMAT=xml"); # STATEMENT
HANGS !!!!
Please help.
Jordy
...
------------------------------
Date: Thu, 8 Jul 2004 16:51:57 -0400
From: Paul Lalli <mritty@gmail.com>
Subject: Re: Perl newbie please help
Message-Id: <20040708164532.W15079@barbara.cs.rpi.edu>
On Thu, 8 Jul 2004, Jordy Keighan wrote:
> Subject: Perl newbie please help
This is a very unhelpful subject. In the future, you should try to use a
subject that actually describes your problem. In this case, perhaps
"URI->new() hanging" or something similar.
> I am trying to compose a URI with some values that I get
> from parsing a XML string.
>
> If I print $user_array[0] ===> value = 'bob'
> but if I us it in URI->new( ... $user_array[0] ... ) the program
> hangs.
>
> If I manualy put 'bob' in $user_array[0]
> all is good and the URI->new( ... $user_array[0] ... ) statement
> works.
>
> Wy can't I use the string I got from my XML parsing ???
>
> Here is my code:
>
> my $user_string = "";
> my $parser = XML::DOM::Parser->new();
> my $doc = $parser->parse($xml);
> foreach my $key ($doc->getElementsByTagName('credentials')){
> $user_string = $user_string . $key->getAttribute('name') .
> " ";
> }
> @user_array = split(" ", $user_string);
Why are you doing this? Why are you composing one large string, manually
separating each field with spaces, and then using split to get an array
back out? Unless you're using $user_string later in unshown code (and if
you are, feel free to ignore me here), conider changing this to:
my @user_array;
foreach my $key ($doc->getElementsByTagName('credentials')){
push @user_array, $key->getAttribute('name');
}
> print $user_array[0]; # VALUE OK prints bob!!!!
out of curiousity, does it really print *just* bob? Or does the value
perhaps have extra whitespace attached to either end? What does this
print?
print "'$user_array[0]'\n";
>
>
> my $uri = URI->new("https://" . $ENV{HTTP_HOST} .
> /cgi-bin/dacs/dacs_group.cgi?OPERATION=LIST_GROUP_MEMBERSHIP&MEMBER_NAME="
There's a problem here. You're missing a double-quote. That should be a
syntax error. This leads me to believe you have not shown us your actual
code, but have instead re-typed it into this post. That's a Bad Thing.
Please make sure you copy and paste the actual text, so we can verify
we're looking at exactly what you're lookin gat.
> . $ENV{DACS_ACS_JURISDICTION} . ":" . $user_array[0].
> "&JURISDICTION=CUBEWERX&DACS_VERSION=1.2&FORMAT=xml"); # STATEMENT
> HANGS !!!!
>
What exactly do you mean by "hangs"? If you put a print statement
immediately after this line, like:
print "debuggin!\n";
does this line not get printed?
Paul Lalli
------------------------------
Date: Thu, 08 Jul 2004 10:57:02 -0500
From: Mark Newman <qa3653@email.mot.com>
Subject: Problem with Archive::Tar
Message-Id: <ccjqc0$cst$1@avnika.corp.mot.com>
Not sure if this is a known problem or not, so here goes... I'm using
ActivePerl 5.8.3.809, trying to write a fairly simple piece of code that
will grab all of the management web pages from device that I have, and
then create a tar file with the all of the files inside of it. I have
no problem grabbing the html files, and even creating a flat tar file.
The problem occurs when I try to create some sort of directory structure
inside of the tar file (so that I can grab files from multiple devices,
and file them say by IP address). Every attempt that I have made to get
Archive::Tar to accept a nested file name is ignored. Here is sample code:
sub generateElement
{
my $hostName = shift;
my $pwd = shift;
my $deviceType = shift;
my @deviceTemplate = @{$Templates{$deviceType}};
for(my $i= 0; $i < scalar(@deviceTemplate); $i += 2)
{
print "$deviceTemplate[$i] -> $deviceTemplate[$i+1] \n";
if(!$www->doURLQuery("http://$hostName/$deviceTemplate[$i+1]"))
{
print "ERROR: $hostName = " . $www->getErrorMessage() . "\n";
} else {
$tar->add_data("dir1\\$deviceTemplate[$i+1]",$www->httpResponse());
}
}
}
The various webpages are successfully grabbed and stored in a .tar file,
but the "dir1\\" path is ignored. All files are in the root directory.
Any suggestions?
Thanks,
Mark
------------------------------
Date: 08 Jul 2004 19:28:42 +0200
From: Michal Wojciechowski <odyniec-usenet@odyniec.net>
Subject: Re: Problem with Archive::Tar
Message-Id: <87wu1es911.fsf@orion.odyniec.net>
Mark Newman <qa3653@email.mot.com> writes:
[...]
> The various webpages are successfully grabbed and stored in a .tar
> file, but the "dir1\\" path is ignored. All files are in the root
> directory.
Just guessing: maybe Archive::Tar uses a '/' as directory separator,
regardless of whatever character is used by the operating system?
--
Michal Wojciechowski : for(<>){/\s/,$l{$m=$`}=$'}$_ : 10 PRINT "Yet another"
odyniec()odyniec;net : =$l{$c},/O\s/?$c=$'-1:y/"//d : 20 PRINT "Perl hacker"
http://odyniec.net : ,/T\s/?print$':0while$c++<$m : 30 GOTO 10
------------------------------
Date: Thu, 8 Jul 2004 21:26:03 +0000 (UTC)
From: Chris Newton <chrisnewton@no.junk.please.btinternet.com>
Subject: Returns / list context
Message-Id: <ccke5b$s0v$1@hercules.btinternet.com>
Hi all,
I think I've been looking at this too long, now, and I'm just missing
the blindingly obvious...
I want to pass back a sequence of values from a function, to put into a
hash mapping from strings onto string arrays. I tried this (obviously
simplified here) approach:
my %hash;
my $key = "key";
@hash{$key} = values();
sub values
{
return ("value1", "value2");
}
After this, @hash{"key"} seems to be an array containing just the one
string "value1". Why wouldn't this call be working in list context, and
stuffing both values into the hash entry?
Thanks in advance for any insights.
Chris
------------------------------
Date: Thu, 08 Jul 2004 11:08:29 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: What does this do?
Message-Id: <SbKdnRTXVvny_nDdRVn-ug@adelphia.com>
Bob wrote:
> $|++;
>
> I see that in code but my searches have come up with nothing.
If it helps, the default value of $| is undef, or zero in numeric context,
so incrementing it with ++ makes it non-zero. The results of assigning a
non-zero value to $| are documented in 'perldoc perlvar'.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Thu, 8 Jul 2004 13:27:23 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: What does this do?
Message-Id: <Pine.A41.4.58.0407081326430.43112@ginger.libs.uga.edu>
On Thu, 8 Jul 2004, gnari wrote:
> "Bob" <bobx@linuxmail.org> wrote in message
> news:1001ff04.0407080616.626e95b1@posting.google.com...
> > $|++;
> >
> > I see that in code but my searches have come up with nothing.
>
> $| is explained in
> perldoc perlvar
>
> the ++ is just a cute way to set it to a true value. if assumes
> the value is not -1
>
> gnari
The value is NEVER -1. :-)
Regards,
Brad
------------------------------
Date: 08 Jul 2004 19:16:27 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: What does this do?
Message-Id: <slrncer7cb.4g9.abigail@alexandra.abigail.nl>
Bob (bobx@linuxmail.org) wrote on MMMCMLXIV September MCMXCIII in
<URL:news:1001ff04.0407080616.626e95b1@posting.google.com>:
)) $|++;
))
)) I see that in code but my searches have come up with nothing.
It's an obscure way of turning buffering off - a way that has unfortunally
cargo culted its way into way to many programs.
There's no advantage of writing '$| ++' instead of '$| = 1', but the
latter is far less obscure.
Abigail
--
print 74.117.115.116.32, 97.110.111.116.104.101.114.32,
80.101.114.108.32, 72.97.99.107.101.114.10;
------------------------------
Date: 08 Jul 2004 23:11:24 +0200
From: pjacklam@online.no (Peter J. Acklam)
Subject: Re: What does this do?
Message-Id: <3c4219xf.fsf@online.no>
Abigail <abigail@abigail.nl> wrote:
> There's no advantage of writing '$| ++' instead of '$| = 1', but
> the latter is far less obscure.
And the latter turns on buffering also in the extremely unlikely
event that $| should ever be -1, in which case $|++ would turn it
off.
Peter
--
#!/local/bin/perl5 -wp -*- mode: cperl; coding: iso-8859-1; -*-
# matlab comment stripper (strips comments from Matlab m-files)
s/^((?:(?:[])}\w.]'+|[^'%])+|'[^'\n]*(?:''[^'\n]*)*')*).*/$1/x;
------------------------------
Date: Thu, 08 Jul 2004 20:44:58 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Why use dollar sign $ for variables
Message-Id: <lv4re0h9p939n1ht3h0b99ai49vo083o5t@4ax.com>
On Wed, 07 Jul 2004 20:12:33 GMT, Charlton Wilbur
<cwilbur@mithril.chromatico.net> wrote:
>Or, stated another way, most of the power of Objective-C is in the
>libraries, and the language is pretty much just the glue that holds
>the library calls together. Much of the power of Perl is in the core
>language. Because of this, any tool such as sigils on variables that
>makes Perl code easier for humans to parse and understand --
>regardless of the ease with which computers may parse and understand
>it -- is useful.
Good point!
Michele
--
# This prints: Just another Perl hacker,
seek DATA,15,0 and print q... <DATA>;
__END__
------------------------------
Date: 08 Jul 2004 18:48:45 +0200
From: Michal Wojciechowski <odyniec-usenet@odyniec.net>
Subject: Re: Writing a Lisp interpreter in Perl?
Message-Id: <871xjmtpg2.fsf@orion.odyniec.net>
sap6210@rit.edu writes:
[...]
> Ah well. Maybe I'll do one anyway. Or maybe I'll think up another
> project. We'll see.
Perl interpreter in Lisp, maybe? :)
--
Michal Wojciechowski : for(<>){/\s/,$l{$m=$`}=$'}$_ : 10 PRINT "Yet another"
odyniec()odyniec;net : =$l{$c},/O\s/?$c=$'-1:y/"//d : 20 PRINT "Perl hacker"
http://odyniec.net : ,/T\s/?print$':0while$c++<$m : 30 GOTO 10
------------------------------
Date: 08 Jul 2004 12:57:28 -0500
From: Dale Henderson <nilram@hotpop.com>
Subject: Re: Writing a Lisp interpreter in Perl?
Message-Id: <87pt76bcvr.fsf@camel.tamu-commerce.edu>
>>>>> "MW" == Michal Wojciechowski <odyniec-usenet@odyniec.net> writes:
MW> sap6210@rit.edu writes: [...]
>> Ah well. Maybe I'll do one anyway. Or maybe I'll think up
>> another project. We'll see.
MW> Perl interpreter in Lisp, maybe? :)
Now that would be cool. Then I could write emacs extensions in
Perl. :)
I know about perlmacs. But thats a different binary.
--
Dale Henderson
"Imaginary universes are so much more beautiful than this stupidly-
constructed 'real' one..." -- G. H. Hardy
------------------------------
Date: 8 Jul 2004 12:36:25 -0700
From: "Steven Pow" <sap6210@rit.edu>
Subject: Re: Writing a Lisp interpreter in Perl?
Message-Id: <cck7np$ujo@odah37.prod.google.com>
> MW> Perl interpreter in Lisp, maybe? :)
>
> Now that would be cool. Then I could write emacs extensions in
> Perl. :)
>
> I know about perlmacs. But thats a different binary.
Yikes, that would be an interesting project. That's not really a bad
idea, just for something to try. I can def see some ugliness (regex in
Lisp? *groan).
But that is a cool idea. Maybe I'll do some planning, see if I can
come up with an idea for it.
Thanks!
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 6779
***************************************