[9321] in Perl-Users-Digest
Perl-Users Digest, Issue: 2916 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 19 18:07:25 1998
Date: Fri, 19 Jun 98 15:00:25 -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 Fri, 19 Jun 1998 Volume: 8 Number: 2916
Today's topics:
Re: Copying an Anonymous Hash <rootbeer@teleport.com>
database corruption problems rrichey@my-dejanews.com
Re: first language birgitt@my-dejanews.com
Re: first language (Larry Rosler)
Re: Help Customizing yForm.cgi <rootbeer@teleport.com>
Re: How do you pre-append using "open" <webmaster@triologic.com>
Re: How do you pre-append using "open" <webmaster@triologic.com>
How to use ora_bind with an array in DBD::Oracle? (Wing Choy)
Re: Little help on grabbing text (Larry Rosler)
Re: loops and subroutines <rootbeer@teleport.com>
Re: My child dies...but why? andrew@ugh.net.au
Re: My child dies...but why? andrew@ugh.net.au
Re: perl in html email <rootbeer@teleport.com>
Re: printf in assignments <rootbeer@teleport.com>
Re: Regular Expression Question <*@qz.to>
Re: Regular Expression Question <*@qz.to>
Re: the ?PATTERN? match syntax (Larry Rosler)
Re: the ?PATTERN? match syntax (Ilya Zakharevich)
Re: the ?PATTERN? match syntax (Ilya Zakharevich)
Uploading perl scripts with a perl script. rpearce@my-dejanews.com
Win32 file path separator <mikep@5circles.com>
Re: Writing to a file on the same line <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 19 Jun 1998 20:03:30 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Copying an Anonymous Hash
Message-Id: <Pine.GSO.3.96.980619130138.15366R-100000@user2.teleport.com>
On 19 Jun 1998, Craig Berry wrote:
> Sean McAfee (mcafee@qbert.rs.itd.umich.edu) wrote:
> : >Is there no way to do this without doing a key-by-key copy?
> :
> : $h2 = { %$h1 };
>
> No need for that anon-hash-ctor wrapper, which actually just wastes a
> whole lot of processing time to achieve exactly the same effect as
>
> $h2 = %$h1;
I believe that you're mistaken. And if you merely omitted a backslash,
then you're still mistaken. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 19 Jun 1998 20:52:28 GMT
From: rrichey@my-dejanews.com
Subject: database corruption problems
Message-Id: <6mej2c$igr$1@nnrp1.dejanews.com>
I am having database corruption problems with a moderately large database
file of 1290 records that I am accessing with a Perl hash. My Perl is
version 5.004_04, and my OS is BSDI 3.1 on a Pentium platform. Since the
script evolved from an old perl 4 script, I am still using dbmopen and
dbmclose, though since I am on BSD, I am inherently using the Berkeley DB.
After going through a foreach loop to parse through my database and add stuff
to various records (including records not necessarily pointed to by the
current key provided by the foreach iterator), I find that 82 records have
mysteriously disappeared. Upon closer examination, I have found that after
the loop is completed but immediately before I do the dbmclose, I still have
all 1290 records. However, after I do dbmclose, I then immediately do
another dbmopen in the same script, and find that 82 of my records are simply
gone. I then have to restore from backup.
I have several suspicions as to what the problem could be, and I'm looking for
feedback regarding the following:
1) Is the new tie function more robust than dbmopen?
2) In order to conveniently manipulate my database, I am opening additional
instances of the same database using different hashes while the initial hash
is still open. Is this a problem? I've never had problems doing this in the
past--and I've done it a lot, even on this same database.
3) I have been using this same script on this same database for several
months, but have only seen the problem manifest in the last few days. The
only thing I can correlate this with, is the continued growth of one
particular database record to over 5k in size. I've seen evidence that the
corruption is indirectly related to occasions when I add additional stuff to
this record.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Fri, 19 Jun 1998 20:56:58 GMT
From: birgitt@my-dejanews.com
Subject: Re: first language
Message-Id: <6mejaq$j5q$1@nnrp1.dejanews.com>
In article <8cbtrpbgn2.fsf@gadget.cscaper.com>,
Randal Schwartz <merlyn@stonehenge.com> wrote:
>
> >>>>> "Dan" == Dan Nguyen <nguyend7@egr.msu.edu> writes:
>
> Dan> The person needs to be a "natural" programmer. Generally I feel that
> Dan> most people have hard time not with the language but with the process
> Dan> of programming. A person could learn Perl as a first language very
> Dan> easily and have no problems, while others could become stuck on the
> Dan> syntax of the language.
>
> I'll second this. I see far too many people *attempting* programming
> that would probably have a better time being firefighters or line
> chefs or congressmen or something. Sure, maybe nearly anyone with
> enough effort can hack out a VB script to automate a repeated task,
> but programming *well* seems to require a twisted aptitude only some
> small percentage of the population seems to have. I think I was lucky
> to be born with it, given the time at which I was born. :-) No
> ordinary amount of education can seem to teach people how to "think"
> like a progammer. ("You have these seven transformations possible and
> this problem requires converting Q to W... go!")
Aren't you both talking more about talent and gift ? No amount of
education in music composition seems to teach people either how to
compose like Beethoven.
The question, I think, was how you best learn to program. I have run
into many who believe that it is a matter of self-study and trial
and error. But I feel that is not enough.
What is then a structured way of learning how to program? How is it
taught at universities? (Not that I think being a Ph.D.candidate in
computer science makes you an expert automatically, but at least there
is a fair chance that you might become one, whereas the chance to become
one through self-study is most probably quite remote).
I still have the question what percentage of good professional
programmers you think *had* to go through formal education
at university level and how *real* the assumption is that
one can learn to program acceptable well (so that you can perform
tha tasks which are requested from you in the work environment
responsibly) by just *doing it* in self-study with no more guidance
than books and your computer on which to try out whatever you want.
I wouldn't really follow up on this question, if I weren't
physically located in the U.S., where this formal education
costs in the range of $9,000.00 - $23,000.00 a year and
the decision to go though a curriculum like that is a major one,
especially if it's the second round and kids have to go through
their first round too.
The desire to learn by yourself what is taught at U.S. universities
is a major one, considering the prices you have to pay. So I
feel the question how many professionals are really self-taught
is legitimate, especially as the technological development is
so fast and universities might not keep up adjusting their curricula or
getting funding for newer approaches. Many things you just
*have* to teach yourself anyway as they are brand new.
Just for comparison, I posted the same question in de.comp.lang.perl
a couple of month ago, basically saying: "Hi, I want to learn to
program, got my degree in xyz 25 years ago and am not much in a
mood to go back to a five year curriculum in Computer Science at
my Alma Mater in Germany (which wouldn't cost me anything)
What would be the best way to do it ?"
Some relaxed answers like "Hmm, we can understand that, I wouldn't
want to spend five years too, so why don't you take just class xyz,
uvw, ijk and qwt, get yourself these books and make a start." End of
story and I know what to do and where to start. But that is, because
it doesn't cost me anything to go through a structured curriculum
and I wouldn't spend a minute on thinking I would do the whole shebang
by myself over there.
Sorry for the lengthy explanation, just to give some hint why
some newbies have some weird questions in their mind.
And thanks for your patience.
Birgitt Funk
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Fri, 19 Jun 1998 14:47:00 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: first language
Message-Id: <MPG.ff47c2f250e4d769896ae@nntp.hpl.hp.com>
In article <6me11n$itv$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net>
says...
...
> So I pondered my two choices: (1) Avoid sprintf, perhaps by giving them a
scanf (minor brain-o)
> library of special-purpose input routines, or (2) Cover pointers very
> early on.
>
> I decided that (1) was essentially a waste of time, because the skills
> and techniques they learned for dealing with my special-purpose input
> functions would be useless.
>
> But more important, I asked myself where the problem was really coming
> from. I want to teach scanf, but to do that, I have to teach
> pointers. Why does scanf need pointers?
>
> `scanf' needs pointers because without them it cannot modify variables
> in the calling subroutine. Why not?
>
> `scanf' cannot modify variables in the calling subroutine without
> pointers because the variables are lexically scoped so that they can
> be hidden from other subroutines.
No, that is not the reason at all. Scanf cannot modify argument
variables *anywhere* because of C's intractable call-by-value semantics.
In order for a C function to modify any of its arguments, the argument
must be a pointer to the actual lvalue to be modified. This is
independent of the scope of that lvalue.
> That decided me. Data hiding and encapsulation issues must be at the
> heart of any programming course. By avoiding pointers, I would be
> avoiding these elementary issues.
>
> It turned out that pointers were very important and very essential.
> They presented themselves in the earliest parts of the material not
> out of perversity, but because they were central to the topic.
As I said, they are central to C function linkage.
> So I went with choice 2, and I discussed functions and private
> variables in the second lecture. Then, by the fourth lecture, with
> the idea of private variables already established, I discussed scanf
> and pointers. I did not discuss arrays or pointer arithmetic until
> much later.
As you know, arrays are passed as pointers, which leads beginners to all
kinds of confusion between a[N] (which allocates storage) and *a (which
points to storage -- one hopes!).
> This all worked very well. It is a very little pill to swallow.
> Everyone understood. Later on, when we discussed arrays, the pointer
> arithmetic part was a smaller pill because everyone was already
> familiar with pointers.
>
> It was a huge success, and it left me convinced that the problems with
> teaching people pointers are on the delivering end, not the receiving
> end. I think that people teach pointers the wrong way, and usually
> the instructors do not understand pointers themselves.
Well, I think I really do understand pointers and can teach them the
right way. But I think they introduce concepts of physical address way
too soon for programmers who are trying to learn their first "higher-
level" language.
> Summary:
>
> Pointers are an essential part of the solution to the data hiding
> problem, which is an essential issue. Therefore, they cannot be
> avoided, and in fact should be addressed as soon as possible. The
> idea of a pointer should be separated from issues of pointer
> arithmetic, which is not necessary until later.
Pointers are needed only for allocated storage, not for named storage in
any scope. I think learning them should be delayed until necessary,
while the principles of expression evaluation and program structure are
being learned. Having to use pointers for data input is an annoying
burden.
Summary:
My *real* choice for a first language for students who want to become
"real" (i.e., professional) programmers would be an abstract assembly
language such as MIX (Knuth, vol. 1). With that as a basis, the C
concept of pointers becomes transparent.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 19 Jun 1998 20:59:19 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Help Customizing yForm.cgi
Message-Id: <Pine.GSO.3.96.980619135713.15366W-100000@user2.teleport.com>
On Fri, 19 Jun 1998, Bradely wrote:
> I am using yForm on my site to email and record form data. However, I
> have one problem. It does not allow me to exclude form fields from the
> email and HTML report. I am very new to programmig perl, and cannot
> determine a way to have the program do this. Can anyone help me out?
If you wish to hire someone, the 'jobs' newsgroups would be a good place
to start. If you wish to do it yourself, we're here to help. How far have
you gotten? Try to show just a few lines which illustrate the problem
you're having, rather than posting a large script. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 19 Jun 1998 21:04:24 GMT
From: Nick Forte <webmaster@triologic.com>
To: Tad McClellan <tadmc@flash.net>
Subject: Re: How do you pre-append using "open"
Message-Id: <358AD0BB.32D1C1C3@triologic.com>
Hey Tad -
Looked through the FAQ - and I'm not an expert like yourself. The FAQ does a
shitty job in explaining it to a beginner like myself. So don't get testicle
on me!
Tad McClellan wrote:
> Nick Forte (webmaster@triologic.com) wrote:
> : I'm trying to pre-append a record to a flat file. I want the record to
> : be inserted on the first line everytime instead of appending it to the
> : end. Can someone help me?
>
> You can help yourself (and get the answer MUCH faster too) by taking
> 180 seconds out of your busy day to see if your question has already
> been answered countless times before.
>
> I guess you must have missed it somehow when you searched for your
> Frequently Asked Question before posting...
>
> from the Perl FAQ, part 5:
>
> "How do I change one line in a file/
> delete a line in a file/
> insert a line in the middle of a file/
> append to the beginning of a file?"
>
> : Thanks!
>
> Yeah, right.
>
> --
> Tad McClellan SGML Consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
------------------------------
Date: Fri, 19 Jun 1998 21:18:20 GMT
From: Nick Forte <webmaster@triologic.com>
To: Deva Seetharam <psdspss@execpc.com>
Subject: Re: How do you pre-append using "open"
Message-Id: <358AD3FE.B3A4F4E@triologic.com>
Deva - Thanks - works perfectly.
Deva Seetharam wrote:
> Nick Forte wrote:
>
> > I'm trying to pre-append a record to a flat file. I want the record to
> > be inserted on the first line everytime instead of appending it to the
> > end. Can someone help me?
> >
> > Thanks!
>
> You need to seek the first position of the file, write your
> record and then write the original records of the file.
> As the following snippet does :
>
> #! /usr/local/bin/perl
>
> #Open the file in **read/write** mode.
> open (IN, "+<data") or die "Could not open the file : $!";
>
> #Preserve the original records.
> @records = <IN>;
>
> # Record to be inserted.
> $insert = "1 1 1";
>
> #Go to the beginnig of file.
> seek(IN, 0, 0);
>
> # Write the new record and then the original.
> print IN "$insert\n";
> print IN @records;
>
> close (IN) or die "Could not close the file : $!";
>
> *********************************
> Hope that helps.
------------------------------
Date: 19 Jun 1998 20:57:03 GMT
From: whc@mink.att.com (Wing Choy)
Subject: How to use ora_bind with an array in DBD::Oracle?
Message-Id: <6mejav$pn3@newsb.netnews.att.com>
In DBD::Oracle, I understand how to bind to
a single substitution:
$sql = "select firstn,lastn from customer where custid=:1";
$csr = &ora_open($ld, $sql);
&ora_bind($csr, '123');
However, if I want to change my SQL stmt to use 'in' clause:
select firstn,lastn from customer where custid in ('123', '234');
How do I translate this SQL into oracle bind format:
$sql = "select firstn,lastn from customer where custid in (:1)";
$csr = &ora_open($ld, $sql);
&ora_bind($csr, @array);
^____________ what should I put in here?
I would appreciate any tips and pointers.
Thanks.
Wing
------------------------------
Date: Fri, 19 Jun 1998 14:41:09 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Little help on grabbing text
Message-Id: <MPG.ff47ad4de90b4b69896ac@nntp.hpl.hp.com>
In article <MPG.ff46a71cabf05b49896a9@nntp.hpl.hp.com>, Larry Rosler
<lr@hpl.hp.com> says...
Subject: Re: Little help on grabbing text
From: lr@hpl.hp.com (Larry Rosler)
Organization: Hewlett-Packard Laboratories
References: <358959FA.E7D26062@newfangled.com>
<3589837F.A379C13B@matrox.com> <358ABF98.A4AD6F9C@newfangled.com>
In article <358ABF98.A4AD6F9C@newfangled.com>, Michael S. Brito, Jr.
<mike@newfangled.com> says...
> Thanx, seriously. You and Tom are providing some good tips. I've only been at
> this for like 3 weeks so I need all the help I can get! Here is how I fixed
> my problem (before reading your posting):
>
> $filename = "body.txt";
> $T = $/;
> $/ = "";
> open(INF,$filename);
> $indata = <INF>;
> close(INF);
> $/ = $T;
>
> assuming I add your suggested code is there anything else I should
> try/add?????
This is much neater, because it does what you want automatically:
{ local $/; $indata = <INF> }
One line for four (you can figure out which four :-).
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 19 Jun 1998 19:55:19 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: loops and subroutines
Message-Id: <Pine.GSO.3.96.980619125212.15366P-100000@user2.teleport.com>
On Fri, 19 Jun 1998, Masaru Furukawa wrote:
> Newsgroups: comp.lang.perl.tk
> Subject: loops and subroutines
Did you mean to post this question to this newsgroup? Perhaps you meant to
use c.l.p.misc. Followups set.
> I'm trying to call a subroutine in a for loop and for some reason the
> loop stops icrementing (breaks out of the loop) as soon as I call the
> subrouthine. Does anyone know how I can keep on going with the loop?
There's nothing about what you're saying that would result in that
behavior by default. But maybe you're not returning from the subroutine?
Or maybe the subroutine is modifying the control variable of the loop? If
you can make a short example (say, half a dozen lines or so) you could
post that to show what you mean. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 20 Jun 1998 06:49:22 +1000
From: andrew@ugh.net.au
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: My child dies...but why?
Message-Id: <Pine.BSF.3.96.980620064718.19534F-100000@house.key.net.au>
On Fri, 19 Jun 1998, Tom Phoenix wrote:
> > Subject: My child dies...but why?
>
> > It dies with the message 'Alarm Clock'.
>
> Sounds as if you've gotten the signal from alarm(), or the equivalent.
but why does this only happen when in the debugger? I assume the debugger
must have set up some timers which get shortened by my script and expire
as I'm too slow hitting s.
If I set a breakpoint after this block of code and hit r I make it through
OK but I still get the TTY error and cant work out why my child is dieing
:-(
Thanks for your answer though,
Andrew
------------------------------
Date: Sat, 20 Jun 1998 07:08:42 +1000
From: andrew@ugh.net.au
Subject: Re: My child dies...but why?
Message-Id: <Pine.BSF.3.96.980620070701.19534G-100000@house.key.net.au>
On Sat, 20 Jun 1998 andrew@ugh.net.au wrote:
> Unfortunatly under certain circumstances my child dies (parent receives
The value left in $? after waitpid is 14. Is this helpful? Anyone wnat to
help me interpret this number? I know the 1 is the exit value, which
leaves 4 to be the status feild but thats were my knowledge stops (if it
didnt stop a little earlier :-).
Thanks,
Andrew
------------------------------
Date: Fri, 19 Jun 1998 20:54:15 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: perl in html email
Message-Id: <Pine.GSO.3.96.980619134602.15366V-100000@user2.teleport.com>
On Fri, 19 Jun 1998, Randy Kimple wrote:
> I've tried posting this question to various microsoft and netscape
> newgroups to no avail. Hopefully this group has someone who can help
> me.
If this newsgroup isn't the most appropriate venue for you to find an
answer your question, why should we encourage you to post here? If it is
the most appropriate, why did you waste time asking elsewhere? :-)
> I want to do error checking of the form elements. Mainly just an ID and
> several other elements. Can anyone suggest a way to do this in perl?
Perhaps you want to start with the information on validating input in the
FAQ. Of course, there's nothing Microsoft- or Netscape-specific about
checking the validity of data, so maybe you need something else. Good
luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 19 Jun 1998 21:03:33 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: printf in assignments
Message-Id: <Pine.GSO.3.96.980619140307.15366Y-100000@user2.teleport.com>
On Fri, 19 Jun 1998, the count wrote:
> I want to assign the contents of a printf
Maybe you mean sprintf? Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 19 Jun 1998 21:07:45 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Regular Expression Question
Message-Id: <eli$9806191659@qz.little-neck.ny.us>
In comp.lang.perl.misc, Eric <tallguy999@hotmail.com> wrote:
> foreach (@dir)
> {
> print $_ ."\n" if /$match/i;
> ## Note case insensitive! Might want to remove i for unix
> }
grep and map are your friends.
@matched = grep /$match/i, @dir;
{ local $"="\n"; print "@matched\n"; }
map {print "$_\n" if /$match/i} @dir;
Elijah
------
likes $"
------------------------------
Date: 19 Jun 1998 21:42:11 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Regular Expression Question
Message-Id: <eli$9806191717@qz.little-neck.ny.us>
In comp.lang.perl.misc, Tkil <tkil@scrye.com> wrote:
> thus, a glob pattern of "*.c" would turn into the perl regexp of
> m/.*\.c/, possibly anchored with ^ and $ (e.g. m/^.*\.c$/). watch
> out for case, if you're hitting windows filesystems. some more
> translations:
>
> GLOB Perl RE
> ---- -------
> file.name ^file\.name$
> *.ext \.ext$
> file.* ^file\.
> *.* \.
For fast and cheap globbing, yes. For better globbing
glob perl RE
---- -------
*.foo ^[^.].*\.foo$
> [notice various shortcuts for leading/trailing "*" in the glob
> pattern.]
I don't know about dos, etc, but in Unix "*.foo" will not match
a file named ".foo".
> p.s. fish: http://www.scrye.com/~tkil/glob_to_re.pl
Perl's method of globing via csh when <glob> is used offers {}
as well, you might want to add those in for a more full featured
globber. Basically:
glob perl RE
---- -------
*.{c,h,pl} ^[^.].*\.(c|h|pl)$
Which can be achieved (in part) through this:
s/\{([^}]*)\}/my$c=$1;$c=~y:,:|:;"($c)"/ge;
Elijah
------
being obscure
------------------------------
Date: Fri, 19 Jun 1998 14:02:04 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: the ?PATTERN? match syntax
Message-Id: <MPG.ff471a5d09fe1789896aa@nntp.hpl.hp.com>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
In article <6mdt89$ham$1@csnews.cs.colorado.edu>, Tom Christiansen
<tchrist@mox.perl.com> says...
> In comp.lang.perl.misc,
> mjd@op.net (Mark-Jason Dominus) writes:
> :When is ?...? useful? What do you do with it?
So I looked through some code and found something useful, and perhaps a
bug in perl. What I found was that the regex ?.\?? successfully matches
(once) a non-\n followed by a question mark, as expected. But the regex
?\?? produces the diagnostic:
/?/: ?+*{} follows nothing in regexp as try line 5.
If I try /\?/ it knows that the ? is literal, not a quantifier. Bug in
?regex? ?
This is perl, version 5.004_03
For extra credit: What reasonable purpose am I trying to implement with
this regex ?\?? ? (There are *many* other ways to do it, but this one
seems to require the fewest characters.)
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 19 Jun 1998 21:54:01 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: the ?PATTERN? match syntax
Message-Id: <6memlp$ess$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Larry Rosler
<lr@hpl.hp.com>],
who wrote in article <MPG.ff471a5d09fe1789896aa@nntp.hpl.hp.com>:
> (once) a non-\n followed by a question mark, as expected. But the regex
> ?\?? produces the diagnostic:
>
> /?/: ?+*{} follows nothing in regexp as try line 5.
As you see from the message, RE in ?\?? is the same as in m'?' or /?/.
Similarly, RE in ?/? is the same as in /\//. See the rule? This has
nothing to do with RE, it is just the Perl quoting.
Ilya
------------------------------
Date: 19 Jun 1998 21:56:01 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: the ?PATTERN? match syntax
Message-Id: <6memph$f7t$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Eli the Bearded
<*@qz.to>],
who wrote in article <eli$9806191529@qz.little-neck.ny.us>:
> In comp.lang.perl.misc, Ilya Zakharevich <ilya@math.ohio-state.edu>
> followed up to me:
> > > It should be documented in perlre, and not just perlop.
> > No. Perlre is about RE, and there is no difference between REs in
> > /RE/ and ?RE?.
>
> Yes but it does change the way the RE works.
No. It changes how the RE is *used* by Perl. Thus perlop.
(Not that I like this perlop/perlre division, but it is quite logical.)
Ilya
------------------------------
Date: Fri, 19 Jun 1998 20:54:39 GMT
From: rpearce@my-dejanews.com
Subject: Uploading perl scripts with a perl script.
Message-Id: <6mej6e$ioo$1@nnrp1.dejanews.com>
Ok, I've done a search of dejanews to find an answer, but didn't get anything
clear enough.
Senario: Need to upload a perl script to my ISP's server from work. Work is
behind a firewall and I can't use ftp/wsftp (tried several firewall settings,
but none work)
Tried uploading the scripts with a file upload script and a simple create file
script from a textarea form.
The upload and/or create works, but when I try to run the script I get an
error message:
CGIwrap Error: System Error: execv() failed
Error: No such file or directory (2)
I believe the second line is referring to the shebang line in the script. It
can't find perl because of (possibly?) an added \r ?maybe?
I've tried writing a script to strip out \r's after it's been uploaded, but
still get the same results.
Any pointers or suggestions in the right direction would be appreciated.
Thanks,
Rick...
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Fri, 19 Jun 1998 14:20:26 -0700
From: "Mike Pritchard" <mikep@5circles.com>
Subject: Win32 file path separator
Message-Id: <6mekph$n07$1@news7.ispnews.com>
I'm sorry to be posting this - I'm sure it is a subject that has had lots of
discussion and resolution, but I can't find an answer. Perhaps I'm using
the wrong terminology. Or ..
Anyway, I'm trying to use the ActiveWare Win32 (5.00307 build 316) to debug
some scripts that should work cross platform, and even has a parameter
setting for PC. It is running on Linux properly, but on Win32 the file path
separators cause problems.
One script stores a directory name in a file, along with a bunch of other
information.
On Linux, the stored directory looks like this -
/home/mikep/public_html/dir1
On Win32, the stored directory looks like this - c:/inetpub/wwwroot/dir1
I've tried using backslashes in the directory, but this generates an error
Can't stat c:inetpubwwwrootdir1
[Maybe this is really the source of the problem - this directory is
specified in a config file as "c:\inetpub\wwwroot\dir1"]
A second script reads the directory name from $_ and is supposed to set up a
$dir variable appropriately. The code looks like this:
if(m:^(/.*):){
$dir = $1;
}
The Linux system works fine. The Win32 match fails so $dir is never
initialized.
I'm betting this is really simple, but I'm probably looking too closely at
it. Any help would be greatly appreciated.
Thanks
Mike
------------------------------
Date: Fri, 19 Jun 1998 21:02:17 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Writing to a file on the same line
Message-Id: <Pine.GSO.3.96.980619140105.15366X-100000@user2.teleport.com>
On Fri, 19 Jun 1998, Ying Peng wrote:
> open(OUTFILE, ">/tmp/webinf");
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
> Error code 500
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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". 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 2916
**************************************