[9309] in Perl-Users-Digest
Perl-Users Digest, Issue: 2905 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 18 18:07:14 1998
Date: Thu, 18 Jun 98 15:01:38 -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 Thu, 18 Jun 1998 Volume: 8 Number: 2905
Today's topics:
Matching Question (Ron Barnhart)
Re: Matching Question (Ron Barnhart)
Re: Matching Question (Steve Linberg)
Re: MODE in mkdir (Gabor)
Re: parsing <rootbeer@teleport.com>
Re: Perl CGI forms jmauney@my-dejanews.com
Re: Perl CGI forms (Bob Trieger)
Perl CGI problem with Netscape Fasttrack (Hu Liang)
Re: Pod::Text -- Unix only? <jhi@alpha.hut.fi>
redirecting stdout in WinNT <yary@apicom.com>
Re: REVIEW: Perl CGI Programming - No Experience Requir <jdporter@min.net>
Shop Cart/Search Wanted <no@spam.com>
Re: Shop Cart/Search Wanted <rootbeer@teleport.com>
Re: SORTING HASHES (THE NEWBIE WAY!!) <steph@hotkey.net.au>
Re: strange error message .. "value of <handle> ..." (Chip Salzenberg)
Re: subject and sender using open mail (Bob Trieger)
Re: Tied hash questions (Mark-Jason Dominus)
Re: Using PERL to do a remote TELNET <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 18 Jun 1998 21:34:08 GMT
From: barnhart@freewwweb.com (Ron Barnhart)
Subject: Matching Question
Message-Id: <358985f0.82890282@news.smart1.net>
Hello,
I have just purchased the Programming Perl book by Larry Wall.
In the first chapter, he describes pattern matching. However, it
doesn't make a lot of sense. I understand the concept of it, but the
syntax used seems extremely involved. Is there a resource or list
about pattern matching? An explanation of use may also be helpful. I
guess the hardest part are all of the different symbols and what they
mean. I looked at an example in the book: /<(.*?)>.*?<\/\1>/ I was
totally lost. How do you know which is supposed to be a normal
oporator and which is pattern symbols? They all seem to use similar
or same characters (all of those forward and back slashes are really
confusing too). If any one could offer some advice/assistance on
this, it would be greatly appreciated. Thanks
------------------------------
Date: Thu, 18 Jun 1998 21:37:03 GMT
From: barnhart@freewwweb.com (Ron Barnhart)
Subject: Re: Matching Question
Message-Id: <35898831.83467560@news.smart1.net>
I forgot to include my email address in the above post. If you could
send an email for information it would be helpful. Thanks.
Ron Barnhart
barnhart@freewwweb.com
On Thu, 18 Jun 1998 21:34:08 GMT, barnhart@freewwweb.com (Ron
Barnhart) wrote:
>Hello,
>
> I have just purchased the Programming Perl book by Larry Wall.
>In the first chapter, he describes pattern matching. However, it
>doesn't make a lot of sense. I understand the concept of it, but the
>syntax used seems extremely involved. Is there a resource or list
>about pattern matching? An explanation of use may also be helpful. I
>guess the hardest part are all of the different symbols and what they
>mean. I looked at an example in the book: /<(.*?)>.*?<\/\1>/ I was
>totally lost. How do you know which is supposed to be a normal
>oporator and which is pattern symbols? They all seem to use similar
>or same characters (all of those forward and back slashes are really
>confusing too). If any one could offer some advice/assistance on
>this, it would be greatly appreciated. Thanks
------------------------------
Date: Thu, 18 Jun 1998 17:59:27 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Matching Question
Message-Id: <linberg-1806981759270001@projdirc.literacy.upenn.edu>
In article <358985f0.82890282@news.smart1.net>, barnhart@freewwweb.com
(Ron Barnhart) wrote:
> I have just purchased the Programming Perl book by Larry Wall.
> In the first chapter, he describes pattern matching. However, it
> doesn't make a lot of sense. I understand the concept of it, but the
> syntax used seems extremely involved. Is there a resource or list
> about pattern matching? An explanation of use may also be helpful. I
> guess the hardest part are all of the different symbols and what they
> mean. I looked at an example in the book: /<(.*?)>.*?<\/\1>/ I was
> totally lost. How do you know which is supposed to be a normal
> oporator and which is pattern symbols? They all seem to use similar
> or same characters (all of those forward and back slashes are really
> confusing too). If any one could offer some advice/assistance on
> this, it would be greatly appreciated. Thanks
Putting this as gently as possible, I'd suggest sticking with it a little
longer. It actually makes all kinds of sense. So much sense it will
boggle your mind. You will have to work at it, though.
The syntax *is* extremely involved. All of the information you seek is in
the book in your hands. "How do you know which is supposed to be a normal
> oporator and which is pattern symbols?" You look on page 59 for the
list of metacharacters. Tools as insanely powerful as regular expressions
are rarely simple enough to absorb at first glance. Once you wrap your
head around them, you will wonder how you ever got along without them and
complain loudly every time you are forced to work in languages that don't
have them.
Programming Perl is the ****ing Bible. Read it again. Practice. Write
code. Test things. You'll get it. If you really want to dig in, you
might want to check out Mastering Regular Expressions, also published by
O'Reilly. You might also want to check the examples in the FAQ. If
you're really, really stuck, you can hire someone.
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: 18 Jun 1998 20:56:12 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: MODE in mkdir
Message-Id: <slrn6oivn6.quo.gabor@localhost.vmunix.com>
In comp.lang.perl.misc, marius77@my-dejanews.com <marius77@my-dejanews.com> wrote :
# I know this question has been asked before, but it wasn't answered in the way
# I needed. Here's my problem:
#
# I have a script that creates several new directories, but I'm having trouble
# with the permissions. I need them to be either
#
# drwxrwxrwx or drwxr_xrwx and I currently have a umask of 002.
#
# I've been able to get permissions up to drwxr_xr_x, but no further and it's
# killing me to be so close. I know I could do a chmod after the mkdir, but I
# am creating so many directories that the list would be quite long. There
# must be a way to get the permissions I want using only MODE. Thanks!
Set your umask beforehand, and then set it back to the original when
you're done.
------------------------------
Date: Thu, 18 Jun 1998 21:36:35 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: parsing
Message-Id: <Pine.GSO.3.96.980618143500.13348u-100000@user2.teleport.com>
On 18 Jun 1998, Amanda Silver wrote:
> i've been trying to write a script that takes a directory and then takes
> every file in that directory and parses it looking for the word 'foo'
> and changes the word to 'bar' but i can't figure out how parsing is
> done...
Parsing of what? Perl? Your text files? Some non-text format? Your
statement seems ambiguous. But maybe you want something resembling this
command.
perl -pi.bak -e 's/foo/bar/g' *
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 18 Jun 1998 21:36:31 GMT
From: jmauney@my-dejanews.com
Subject: Re: Perl CGI forms
Message-Id: <6mc190$nnk$1@nnrp1.dejanews.com>
In article <6m9vq4$109k@r02n01.cac.psu.edu>,
"Patrick Lanphier" <p-lanphier@psu.edu> wrote:
>
> The below script I thought would load a predifined page if no parameters of
> the following categories (listed in the script) were passed by a form which
> it does but when the form is filled out and submitted to the script again
> none of the parameters seem to be being passed hence it displays the same
> form again instead of validating the data and displaying a success form or
> an error form were corrections need to be made. Thank you in advance for
> your help.
>
> Patrick Lanphier
> Applied Research Laboratory
> ----------------------------------------------------------------------------
Replacing below if conditions with:
"unless (param()) {" allows form processing to start.
> if (($contact eq "")
> and ($company eq "")
> and ($userid eq "")
> and ($password eq "")
> and ($vpassword eq "")
> and ($telephone eq "")
> and ($email !~
> \@.+\..+/)){
HTH!
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Thu, 18 Jun 1998 21:47:12 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Perl CGI forms
Message-Id: <6mc20c$5q8$2@strato.ultra.net>
Keywords: Perl CGI forms
[ posted and mailed ]
"Patrick Lanphier" <p-lanphier@psu.edu> wrote:
->
-> #!D:\Perl\perl5\bin\perl
-> use CGI qw(:all);
-> $mail_prog = '/usr/lib/sendmail' ;
I ain't gonna debug your script and did you really need to post the whole
thing here.
Your first line suggest an M$ server, your 3rd is calling a Unix command. I
think that will be a start in debugging it.
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-239-0341
and hang up when the recording starts. "
------------------------------
Date: 18 Jun 1998 21:52:05 GMT
From: huliang@almaden.ibm.com (Hu Liang)
Subject: Perl CGI problem with Netscape Fasttrack
Message-Id: <6mc265$5mc@fox.almaden.ibm.com>
I really need help!!
My CGI-PERL programs work fine under Lotus GO server, but won't under Netscape
Fasttrack. I get a "cgi-parse-output reports: the CGI program /bal/bla did not
produce a valid header (name without value: got line " lc_all = (unset),")"
It's fine under GO! I check the output from command line, fed it through od
and no weird chars are printing out. Made sure the Header had 2 newlines after
it, GO didn't mind how many newlines...what's with Fasttrack!?
Any help would be greatly appreciated...thanks in advance.
If possible please email huliang@almaden.ibm.com
------------------------------
Date: 19 Jun 1998 00:00:21 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: Pod::Text -- Unix only?
Message-Id: <oee67hye87u.fsf@alpha.hut.fi>
Dan Schmidt <dfan@harmonixmusic.com> writes:
> Not to put down Pod::Text at all, but Perl itself is even more portable
> than that, since it runs on some non-Unix systems as well.
"some"? "SOME"??? :-)
AOS/RT
AS400
Acorn/RISCOS
AmigaOS
Atari/TOS
BeOS
LynxOS
MPE/ix
MSDOS
MVS
MacOS
Netware
OS/2
Plan9
QNX
Stratus/VOS
Tandem/Guardian
VMS
Win31
Win32
--
$jhi++; # http://www.iki.fi/~jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen
------------------------------
Date: Thu, 18 Jun 1998 13:19:12 -0700
From: Yary <yary@apicom.com>
Subject: redirecting stdout in WinNT
Message-Id: <35897606.3E2C@apicom.com>
Here's an odd one, using G.S's precompiled Win32 distribution:
D:>echo print "Hello" > bat.pl
D:>bat.pl
Hello
D:>bat.pl > bat.txt
D:>type bat.txt
(bat.txt is empty)
Why can I redirect the output of echo, but not bat.pl?
-yary
D:>perl -V
Summary of my perl5 (5.0 patchlevel 4 subversion 02) configuration:
Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32
uname=''
hint=recommended, useposix=true, d_sigaction=undef
bincompat3=undef useperlio=undef d_sfio=undef
Compiler:
cc='cl', optimize='-O', gccversion=
cppflags='-DWIN32'
ccflags ='-MD -DWIN32'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=0, d_casti32=define, d_castneg=define
intsize=4, alignbytes=8, usemymalloc=n, randbits=15
Linker and Libraries:
ld='link', ldflags ='-nologo -subsystem:windows'
libpth=d:\msdev\lib
libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.li
b advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib
wsock32.
lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
libc=msvcrt.lib, so=dll
useshrplib=undef, libperl=undef
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags='', lddlflags='-dll'
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING
Built under MSWin32
Compiled at Aug 9 1997 21:42:37
%ENV:
PERL5LIB="d:\QFS\BIN\perllib;d:\QFS\BIN\perllib\site;"
@INC:
d:\QFS\BIN\perllib
d:\QFS\BIN\perllib\site
d:\QFS\lib\site
d:\QFS\lib
c:\perl\lib
c:\perl\lib\site
c:\perl\lib\site
.
------------------------------
Date: Thu, 18 Jun 1998 21:14:52 GMT
From: John Porter <jdporter@min.net>
Subject: Re: REVIEW: Perl CGI Programming - No Experience Required
Message-Id: <35898507.709F@min.net>
Rahul Dhesi wrote:
>
> My next question is: If the only difference between the two is that one
> is in a single variable, and the other is explicitly enumerated, why are
> we making such a a big deal of this difference?
Only because some people are having a hard time grasping it.
Just how different is a school bus from a bunch of kids?
--
John Porter
------------------------------
Date: Thu, 18 Jun 1998 16:12:12 -0500
From: "jj" <no@spam.com>
Subject: Shop Cart/Search Wanted
Message-Id: <6mbvs0$2m$1@blackice.winternet.com>
I am looking for a programmer who may have a shopping cart system set up. I
need to have a small database of book that would be searchable by author,
subject, code numer and/or publisher. After coming up with a search result,
the viewer could see a brief description (or web page) describing the book.
They would need to be able to add/delete books to the shopping cart.
Must be Linux compatible
If you do programming, let me know if this is workable. Time frame is
short, however. Please also email me directly if you could. Thank you!
Jim
berg@globalsystems.com
------------------------------
Date: Thu, 18 Jun 1998 21:39:04 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Shop Cart/Search Wanted
Message-Id: <Pine.GSO.3.96.980618143823.13348v-100000@user2.teleport.com>
On Thu, 18 Jun 1998, jj wrote:
> I am looking for a programmer who may have a shopping cart system set up.
Perhaps you should be posting in a 'jobs' newsgroup, then. Hope this
helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 19 Jun 1998 07:07:49 +1000
From: Stephan Carydakis <steph@hotkey.net.au>
Subject: Re: SORTING HASHES (THE NEWBIE WAY!!)
Message-Id: <358981A5.7206@hotkey.net.au>
Hello Again,
Sorry to those who I cheesed of by using CAPITOLS in the subject line,
using too many 'bangs' in the subject line and generally having a pox
subject line.
I took your advice and looked in CPAN and perldocs. To tell you the
truth they didn't help me that much but between those and the camel I've
managed to come up with a solution. I still dont really understand it.
Heres my code:
foreach $key (sort {$ta_sort{$b} <=> $ta_sort{$a}} keys %ta_sort) {
print "$key: $ta_sort{$key}<br>";
}
What I don't understand is why I'm getting the hash sorted on the values
and not the keys?? Not that I'm complaining because that is exactly what
I wanted. :]
Thanks to all who replied
Stephan Carydakis steph@hotkey.net.au
------------------------------
Date: Thu, 18 Jun 1998 21:15:00 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: strange error message .. "value of <handle> ..."
Message-Id: <6mc03b$nvp$1@cyprus.atlantic.net>
According to lr@hpl.hp.com (Larry Rosler):
>In article <6m8v8s$ts2$1@nnrp1.dejanews.com>, jabrah15@my-dejanews.com
>says...
>> 1. the error message "Value of <HANDLE> construct can be 0" ...
>
>This warning may be generously described as "persnickety".
Thank you!
ChipDude
persnickety curmudgeon at extra large
------------------------------
Date: Thu, 18 Jun 1998 21:36:58 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: subject and sender using open mail
Message-Id: <6mc1d5$5q8$1@strato.ultra.net>
Tom Phoenix <rootbeer@teleport.com> wrote:
-> On Thu, 18 Jun 1998, Michael S. Brito, Jr. wrote:
->
-> > open (MAIL, "|$mailprog $recipient") || die "Cant open $mailprog!\n";
->
-> You should be aware that it's generally a Bad Thing to include a
-> user-specified email address on the command line to sendmail, since an
-> email address may contain shell metacharacters and yet still be valid.
-> Hope this helps!
It's also bad form to suggest platform dependent applications/commands when
the original poster did not specify his operating system. Not to mention that
you left at least a couple of comand line switches out of the sendmail
command.
The best advice Mr Brito could have given is to check the docs on Net::SMTP.
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-239-0341
and hang up when the recording starts. "
------------------------------
Date: 18 Jun 1998 17:30:19 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Tied hash questions
Message-Id: <6mc0tb$dbg$1@monet.op.net>
In article <35897BEB.F8BD2C9F@mci.com>, David Hinz <David.Hinz@mci.com> wrote:
>How do I use a tied hash to find the first specfied key value and all of
>the subsequent key values matching a specific key value?
You can't; that's backwards. That's like asking how you can use the
telephone book to find all the people who have the number 898-0834.
>I understand how to put data in the hash with corresponds to the STORE
>$self, $key, $value using $stuff{$key} = $value. But what is the syntax
>for the other methods?
>
>DELETE $self, $key
delete $hash{key};
delete @hash{key1, key2, key2};
>FETCH $self, $key
if ($hash{key} eq ...) { ... }
$value = $hash{key};
print $hash{key};
>EXISTS $self, $key
if (exists $hash{key}) { ... }
>FIRSTKEY $self
>NEXTKEY $self, $lastkey
These are invoked by `each', `keys', and `values'. See `perlfunc'
documentation included with Perl for full details.
------------------------------
Date: Thu, 18 Jun 1998 20:59:33 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Using PERL to do a remote TELNET
Message-Id: <Pine.GSO.3.96.980618135647.13348n-100000@user2.teleport.com>
On Thu, 18 Jun 1998, Kenneth wrote:
> Im not sure what you mean bye getting a module.. how would I add a
> module and where do I get it from?
Section eight of the FAQ talks about installing your own modules which you
can get from CPAN. (CPAN is discussed in section two of the FAQ. :-)
http://cpan.perl.org/doc/FAQs/
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 2905
**************************************