[8611] in Perl-Users-Digest
Perl-Users Digest, Issue: 2228 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 1 20:07:20 1998
Date: Wed, 1 Apr 98 17:00:29 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 1 Apr 1998 Volume: 8 Number: 2228
Today's topics:
?: Usage Question <bruceh@interaccess.com>
Re: ?: Usage Question (James Watson)
Re: ?: Usage Question (Craig Berry)
Re: ANNOUNCE: /bin/sh to Perl translator finally availa <sneaker@mediaone.net>
Re: Can't delete file using a perl script (James Watson)
Change in autoload in 5.004_04 is notnice. <flaviovs@centroin.com.br-ZZZ->
Re: File locking <jdf@pobox.com>
Re: gathering EMail address via CGI (I R A Aggie)
Re: gathering EMail address via CGI <ben@wallroyds.demon.co.uk>
Re: God Help Us All (was: Re: Sneex having problems) <sneaker@mediaone.net>
Re: God Help Us All (was: Re: Sneex having problems) <sneaker@mediaone.net>
Re: Help with Password <sneaker@mediaone.net>
Re: How can I replace from a list? <jdf@pobox.com>
Re: Is there a "Newsgroup" for Newbies to Perl? (I R A Aggie)
Re: Keyword Searching a web page <sonny@88net.net>
Re: Munging addresses (was: Re: Perl Cgi Questions) (Greg Bacon)
newbie's question on file IO in PERL <ravi.narayanan@citicorp.com>
Re: newbie's question on file IO in PERL <ebohlman@netcom.com>
Re: Overriding compile time builtins? (namely, "use") <sneaker@mediaone.net>
Problems trying to embed perl in a Win32 programme (Cory C. Albrecht)
Purify Run on Perl5.004_04 Solaris 2.5.1(sparc) (Andrew E Page)
Re: Reading Mail (Greg Bacon)
Re: s/PATTERN/<how to concat here>/g (Craig Berry)
Re: Sorting a Delimeted Text File? <palincss@tidalwave.net>
Use of implicit split to @_ is deprecated (Peter Scott)
Re: Use of implicit split to @_ is deprecated <jdf@pobox.com>
Re: verifying email address -- how? (Brand and Karina Hilton)
Web Master position-Need some info <peterm@chameleons.com>
Win32::Internet Problem carruda@propub2.com
YACQ (Stuart McDow)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 01 Apr 1998 17:03:40 -0500
From: Bruce Hodo <bruceh@interaccess.com>
Subject: ?: Usage Question
Message-Id: <3522B9BC.CEE40F4F@interaccess.com>
I'm trying to check a database field for a value of zero: if it is zero,
I want to replace it with a blank and use it in a table. If it is not
zero, I want to prepend a "$" and use it in the same table in the same
field. I coded the following (I'm using CGI.pm):
($pageinfo->param('StdSglWinter') eq 0) ?
$StdSglWinter = '' : #single quotes, defining a null
string#
$StdSglWinter = '$'.$pageinfo->param('StdSglWinter');
What I get is always $num, whether the num is 0 or not. The data is
coming from a semi-colon delimited text file; the particular value is
numeric. I'm probably doing something stupid, but I'm not sure what. Can
anyone help me?
--
Bruce Hodo - Webmaster, GetAwayNetwork, Inc.
==Providing unique vacation information on the World Wide Web==
For Villas, Resorts, Hotels, Air/Hotel Packages, Charter Airfares
And Now Offering Travel Auctions!
=============== Visit us at http://getawaynet.com ===============
------------------------------
Date: Wed, 01 Apr 1998 18:16:02 GMT
From: james_vs_watson@yahoo.com (James Watson)
Subject: Re: ?: Usage Question
Message-Id: <35238421.110580902@news.erols.com>
On Wed, 01 Apr 1998 17:03:40 -0500, Bruce Hodo
<bruceh@interaccess.com> wrote:
>($pageinfo->param('StdSglWinter') eq 0) ?
You may want this line to read
($pageinfo->param('StdSglWinter') == 0)
Just a thought.
- James V. S. Watson
------------------------------
Date: 2 Apr 1998 00:10:12 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: ?: Usage Question
Message-Id: <6ful14$h8$2@marina.cinenet.net>
Bruce Hodo (bruceh@interaccess.com) wrote:
: I'm trying to check a database field for a value of zero: if it is zero,
: I want to replace it with a blank and use it in a table. If it is not
: zero, I want to prepend a "$" and use it in the same table in the same
: field. I coded the following (I'm using CGI.pm):
:
: ($pageinfo->param('StdSglWinter') eq 0) ?
: $StdSglWinter = '' : #single quotes, defining a null
: string#
: $StdSglWinter = '$'.$pageinfo->param('StdSglWinter');
You have the useage of ?: sort of inside-out. Also, I'd be tempted to put
that long lookup into a temporary so you can more easily reuse it. What
you probably want to say is:
my $ssw = $pageinfo->param('StdSglWinter');
$StdSglWinter = ($ssw eq 0) ? '' : "\$$ssw";
Also, that 'eq 0' looks suspect -- string equality to the integer 0? Are
you sure you don't mean == ? If you're willing to make the test for any
'false' value -- 0, '', or undef -- you can write the second line even
more simply as
$StdSglWinter = $ssw ? "\$$ssw" : '';
(Note that I've reversed the 'polarity' of the condition, and hence the
order of the second and third expressions.)
HTH...
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Thu, 02 Apr 1998 00:35:17 GMT
From: Sneaker's Nest <sneaker@mediaone.net>
Subject: Re: ANNOUNCE: /bin/sh to Perl translator finally available!
Message-Id: <3522DBD5.54B7@mediaone.net>
Stuart McDow wrote:
>
> Randal Schwartz <merlyn@stonehenge.com> writes:
> >
> > Yes! Finally! The long-awaited "Shell to Perl" translator is now available!
>
> Damn!! I fell for it!! Forgot to check the date. D'oh!!! Very cute.
>
> --
> Stuart McDow Applied Research Laboratories
> smcdow@arlut.utexas.edu The University of Texas at Austin
> "It is obvious that about 750,000 people ago, Austin was a wonderful City."
I can't find the man pages for StuffyFunk!
I was jipped!
:-)
------------------------------
Date: Wed, 01 Apr 1998 18:09:21 GMT
From: james_vs_watson@yahoo.com (James Watson)
Subject: Re: Can't delete file using a perl script
Message-Id: <35228273.110150853@news.erols.com>
On Tue, 31 Mar 1998 12:43:01 -0800, Tom Phoenix
<rootbeer@teleport.com> wrote:
>On Sat, 28 Mar 1998, Leslie Long wrote:
>
>> The script runs perfectly when I Telnet into the server and run 'perl
>> myprog.cgi', but, when I try from a browser, the write and delete parts
>> of my script don't work.
>
I had a similar problem and found out that the computer the CGI was
running throught was using an older version of Perl and did not have
all of the modules that the computer I telnetted into had. That was
why it would work through Telnet and not when I used CGI.
Hope this solves your problem.
- James V. S. Watson
------------------------------
Date: Wed, 1 Apr 1998 19:10:15 -0300
From: Flavio Veloso <flaviovs@centroin.com.br-ZZZ->
Subject: Change in autoload in 5.004_04 is notnice.
Message-Id: <Pine.BSI.3.96.980401185132.2115A-100000@trex.centroin.com.br>
Hi all. (Please, remove the "-ZZZ-" at the end of the mail address if
replying to me directly.)
What's wrong with non-method functions begin autoloaded? I have many
modules (initially created with "h2xs -X") that uses the AUTOLOAD
feature to minimize program size and load time. These modules have no
OOP and contains only simple functions (i.e. they are what we used to
call "libraries"). Now 5.004_04 complains (if -w) with a:
"Use of inherited AUTOLOAD for non-method Module::Function() is
deprecated"
Perldelta(1) says:
"Perl 5.005 will use method lookup only for methods'
AUTOLOADs. However, there is a significant base of
existing code that may be using the old behavior. So, as
an interim step, Perl 5.004 issues an optional warning
when a non-method uses an inherited AUTOLOAD."
Does this mean that the autoloading of functions (not methods) will
not be supported in near future? Why? This is a great feature, even
for the no-OOP thing!
If you want to see it:
$ h2xs -X -n "NewModule"
$ cd NewModule
$ vi NewModule.pm
(create a function MyFunc() after the __END__ so it will be
autoloaded)
$ >MANIFEST
$ rm test.pl
$ mkdir t
$ cat > t/test.t
use NewModule;
print "1..1\n"; MyFunc(); print "ok\n";
^D
$ perl5 Makefile.PL # perl5 == perl 5.004_04
$ make
$ make test
(stuff deleted)
t/test..............Use of inherited AUTOLOAD for non-method
NewModule::MyFunc() is deprecated at t/teste.t line 2.
ok
(stuff deleted)
- Flavio
------------------------------
Date: 01 Apr 1998 17:05:47 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: File locking
Message-Id: <sonxw62s.fsf@mailhost.panix.com>
prn@bsu.edu (Paul Neubauer) writes:
> It appears that the "normal" idiom for locking would go something like:
>
> open FH, ">$filename" or die("can't open $filename : $!");
> flock (FH, LOCK_EX);
> ...print stuff to file ...
> flock (FH, LOCK_UN);
> close FH;
No; do not explicitly unlock your file. Simply close it, which will
safely remove the lock.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Wed, 01 Apr 1998 17:18:53 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: gathering EMail address via CGI
Message-Id: <fl_aggie-0104981718540001@aggie.coaps.fsu.edu>
In article <3522A034.41855B74@state.or.us>, Glenn Schworak
<Glenn.J.Schworak@state.or.us> wrote:
+ Is it posible with perl to ask the uer's browser what their EMail
+ address is?
No. That sort of information should _never_ be given out by the
browser to a CGI script. Never. Previous versions had a bug where
this was possible via (I think) a Javascript.
The only time it might be acceptable is when accessing an anonymous
ftp:// link...
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: Thu, 2 Apr 1998 00:25:29 +0100
From: "Ben" <ben@wallroyds.demon.co.uk>
Subject: Re: gathering EMail address via CGI
Message-Id: <891473139.28885.0.nnrp-02.c2de5b4a@news.demon.co.uk>
Short answer - You can't.
Long answer - You might can, but most browsers don't support it.
HTTP_FROM ... (CGI environment variables)
It works for me ... Collected about 10% of the surfers' email addresses.
Best Regards
Ben Fletcher :-)
Glenn Schworak wrote in message <3522A034.41855B74@state.or.us>...
>Is it posible with perl to ask the uer's browser what their EMail
>address is?
>
>That may be over simplified, but I know that most web browsers store or
>at least can access the user's EMail address for use when the user
>clicks a mailto: type of link.
>
>I think it would be nice to pre-fill in part of a form that is being
>generated by my perl script by asking the user's browser for their EMail
>address and using that as the default value for one of the blanks on the
>form.
>
>Thanks for any help you can offer.
>
>
>(just to chalange you, I was something like this done with java once but
>can't find it again)
>
>
------------------------------
Date: Thu, 02 Apr 1998 00:03:52 GMT
From: Sneaker's Nest <sneaker@mediaone.net>
Subject: Re: God Help Us All (was: Re: Sneex having problems)
Message-Id: <3522D478.1CC2@mediaone.net>
Mark Stackhouse wrote:
>
> Sorry Sneex. It just erks me when the Tower beats on anyone.
> From now on, I'll stand my own ground :-) I have to deal with
> this sort, face to face, in the real world. It's a cake walk to
> face off against a monitor!
All is done and over with :-)
------------------------------
Date: Thu, 02 Apr 1998 00:02:03 GMT
From: Sneaker's Nest <sneaker@mediaone.net>
Subject: Re: God Help Us All (was: Re: Sneex having problems)
Message-Id: <3522D407.F69@mediaone.net>
Patrick Timmins wrote:
>
> Sneaker's Nest wrote:
> >
> > What's so bad about being a newbie is
> > one day I can look forward to being
> > an old fart.
> >
> > A hateful one...
>
> Sneex,
>
> $rule = "perl is nice";
> if ($rule =~ /p(e)r(l)( )(i)(s)( )(n)(i)(c)(e)/) {
> print "$5$4$2$1$7$9$10$3$8$5$6go$2d$1$7\n";
> }
>
> Hope that helps.
>
> Patrick Timmins
> U. Nebraska Medical Center
Yes, and also interesting...
Thanks,
Bill :-)
------------------------------
Date: Thu, 02 Apr 1998 00:50:37 GMT
From: Sneaker's Nest <sneaker@mediaone.net>
Subject: Re: Help with Password
Message-Id: <3522DF6D.228E@mediaone.net>
Gerald wrote:
>
> I have been having a bit of a problem getting my password page to Work this is what i
> have got at the moment
>
> &PrintHeader
> &ReadParse(*input);
<cgi-lib.pl related code deleted.>
> The problem is that it comes up with an internal server error 500
You may wish to rethink your strategy and use CGI.pm. Also, Do you have
the security, level and premissions, right to do what you want to do?
HTH,
Sneex
------------------------------
Date: 01 Apr 1998 17:03:53 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: How can I replace from a list?
Message-Id: <u38dw65y.fsf@mailhost.panix.com>
delegz <delegz@NOSPAM.rpi.edu> writes:
> P.S. I never looked at Perl before until this morning,
> at someone's suggestion. Thanks for any help!
You really must crawl before you walk, and you're trying to jog.
Please, please buy the book _Learning Perl_ and spend a week or longer
reading it from cover to cover, doing all of the exercises. Then, if
you're still having trouble with what you're trying to do, you'll find
help here (unless, of course, your question is answered in one of the
documents that accompany perl).
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Wed, 01 Apr 1998 17:22:18 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <fl_aggie-0104981722190001@aggie.coaps.fsu.edu>
In article <35227297.BF419C8C@mindspring.com>, keithmur@mindspring.com wrote:
+ Not taking sides on what happened, didn't happen (how could I, not being
+ there?), but I'd just like to share one of my few insights gained in
+ life:
Oh, yes you did. Take sides, that is.
[list of behaviours]
+ Not saying any of this applies to Randal Schwarz, for whom I have the
+ greatest respect.
With all due respect, you have. Maybe not directly, but you sure have
left it hanging in the breeze for anyone with two brain cells to
rub together to figure it out. Even clueless newbies who can't
'perldoc perlfaq' can figure it out...
Followups set appropriately...
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: Wed, 01 Apr 1998 16:03:55 -0600
From: sonny <sonny@88net.net>
Subject: Re: Keyword Searching a web page
Message-Id: <3522B9CA.1E3180BA@88net.net>
Search for ICE
sonny
Frank Vollono wrote:
> Hello all. I am building a web site and would like to have a keyword
> script function on it.
>
> We have a large amount of images that we would like to assign keywords to
> and have people look for them. For example, if they search for 'offices'
> all the images we have should show on the page.
>
> Also how much would it be to have someone do this? or can we get pre-made
> scripts?
>
> Thanks
> Frank Vollono
> hlc4loc@earthlink.net
------------------------------
Date: 1 Apr 1998 22:26:12 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Munging addresses (was: Re: Perl Cgi Questions)
Message-Id: <6fueu4$mi8$3@info.uah.edu>
In article <352257d8.1077128@news.omen.net.au>,
UCE-trap_synic@omen.net.au (Peter Caffin) writes:
: Tom Phoenix <rootbeer@teleport.com> did cunningly address to
: comp.lang.perl.misc..
:
: Think about what's more efficient when it comes to talking NNTP.
: You could check far more articles by pulling down the header only for three
: newsgroups than checking the headers+bodies of one. Commonsense. [1]
What happens when someone posts a followup with a Cc: to the original
poster and did take the time to unmunge the Cc:'d address? You still
lose. All your munging has bought you is the irritation of others
and breaking a system that has always worked.
: :Why not do that? Because most folks won't bother to un-munge; I know I
: :won't. Cheers!
:
: Who cares about the lazy? ;).
Lazy? Are you lazy because you would probably object to dialing a
telephone number along with its length and the sum of the digits
modulo ten?
Munging is cutting the baby in half. Don't beat up your playmates
because some jerk comes and pisses in the sandbox.
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Wed, 01 Apr 1998 14:51:25 -0800
From: Ravi Narayanan <ravi.narayanan@citicorp.com>
Subject: newbie's question on file IO in PERL
Message-Id: <3522C4ED.46EDAD5C@citicorp.com>
hi!
once i open a file in the input mode how do i assign a variable the
value of the input ?
Pl. help...
thanks in advance.
damle
------------------------------
Date: Wed, 1 Apr 1998 23:09:38 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: newbie's question on file IO in PERL
Message-Id: <ebohlmanEqrCC3.AAs@netcom.com>
Ravi Narayanan <ravi.narayanan@citicorp.com> wrote:
: once i open a file in the input mode how do i assign a variable the
: value of the input ?
perldoc perlop, look in the section on file input operators.
------------------------------
Date: Thu, 02 Apr 1998 00:08:46 GMT
From: Sneaker's Nest <sneaker@mediaone.net>
Subject: Re: Overriding compile time builtins? (namely, "use")
Message-Id: <3522D59D.49CC@mediaone.net>
Zenin wrote:
>
> Is there anyway to override compile time builtins, namely "use"?
> Method to my madness:
>
> I'd like to extend use to be able to search compressed file
> archives for modules and maybe even be able to use URLs
> as well to locate them, ala Java's "jar" files and such. I
> thought about creating a "loadmod" function, however this
> would meen that I'd have to change every use statement in
> every module including the core modules. So much for
> reusability. :-/
>
> --
> -Zenin
> zenin@archive.rhps.org
I do no the answer, however I would be interested in considering the
impact on system performamce as the only way I can think of is
duplicating similar funcnality to this -
use { `gzip -d perlmods.tgz | tar t - | grep modwanted` }
Or some such. When I use the first two thirds my Ultrasparc hates me
for a while...
Just curious,
Sneex :)
------------------------------
Date: Wed, 01 Apr 1998 23:16:11 GMT
From: coryalbrecht@hotmail.com (Cory C. Albrecht)
Subject: Problems trying to embed perl in a Win32 programme
Message-Id: <6fuhrr$3d0_002@news.sentex.ca>
Keywords: perl5 embed win32 windows95 perl5.004_2
Hello all,
OK, I'm starting off on the road to embedding a Perl interpreter in my own=
=20
programmes, except I have come up against a rather silly error. :-( I'm usi=
ng=20
the 5.004_2 Win32 build by Gurusamy Sarathy which I downloaded from=20
www.perl.com. Problem is, upon compiling, I get the following error:
D:\h\direct.h(68): Error! E125: col(28) invalid redefinition of the typedef=
=20
name 'DIR'=20
D:\h\direct.h(68): Note! N392: col(28) 'DIR' defined in:=20
C:\Perl\lib\core\dirent.h(39) (col 3)=20
My question is this - can I just comment out the appropriate #include for o=
ne=20
of either direct.h or dirent.h, so that only one gets processed? Or is stuf=
f=20
from both files necessary, such that I am going to have to muck about diren=
t.h=20
(and perhaps other *.h files in C:\Perl\lib\CORE) so that the conflict is n=
ot=20
there? My guess right now is to look through all the *.h files and change a=
ny=20
reference from DIR to struct _dir_struct. The lack of that typedef is not=20
going to affect anything that I haven't thought of, eh?
Thanks in advance.
--
Cory C. Albrecht
http://www.sentex.ca/~cory/
PGP Key Fingerprint: FA8C A548 5261 D415 C20C 424C 703F 32F2
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/CM d+(-) s+: a- C++($) UB+>++++ P++(+++) L(+) E--- W++(+) N++ o K? w(++=
) V--
!M PS+ PE- Y+ PGP+ t+ 5+ X R- tv+ b++ DI(+) D G(+) e>++ h! y?=20
------END GEEK CODE BLOCK------
------------------------------
Date: Wed, 1 Apr 1998 23:11:28 GMT
From: aep@world.std.com (Andrew E Page)
Subject: Purify Run on Perl5.004_04 Solaris 2.5.1(sparc)
Message-Id: <EqrCF4.89n@world.std.com>
I ran Purify on perl5.004_04 while doing a 'make test'.
The results were pretty clean, but it still turned up
a few things that someone might want to look at.
Is there anywhere I can send the exported purify logs?
--
Andrew E. Page (Warrior Poet) | Decision and Effort The Archer and Arrow
Mac Consultant | The difference between what we are
Macintosh and DSP Technology | and what we want to be.
------------------------------
Date: 1 Apr 1998 22:35:46 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Reading Mail
Message-Id: <6fufg2$mi8$4@info.uah.edu>
In article <3522675D.3221A8A1@sabre.com>,
Harry Blanek <hblanek@sabre.com> writes:
: --------------043DA3ACF1A0FFB5DE2F2B60
: Content-Type: text/plain; charset=us-ascii
: Content-Transfer-Encoding: 7bit
:-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-(
:-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-(
:-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-(
No mimes here, please. No HTML here, please.
: Can someone help me with what I hope is a pretty easy problem? I am
: playing with Graham Barr's mail filtering scripts from the Spring 96
: issue of TPJ. How do I tell my script to periodically glance at
: /var/mail/me and do something if there is a new message there. I am
: using the Mail::Internet Module and it works on creating a message.
: Then Mr. Barr suggests getting mail from stdin which doesn't seem to be
: to useful for a filter. What am I missing here. Thanks
You're attacking the problem the wrong way. Design a filter that accepts
an email message on STDIN. When you've written it, do this:
% cat >$HOME/.forward
"|/path/to/your/home/dir/filter youruserid"
This tells sendmail to deliver each incoming mail message to the STDIN
of a program called filter that lives in your home directory.
This really isn't a Perl question, though. :-)
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: 1 Apr 1998 23:56:49 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: s/PATTERN/<how to concat here>/g
Message-Id: <6fuk81$h8$1@marina.cinenet.net>
Robert Lopez (Robert.Lopez@abq.sc.philips.com) wrote:
: How is string concatenation done on
: the left side of substitution?
:
: This is what I am trying to do:
: $_ = "STT,31-Mar-98";
: s/(STT,\d\d*\-\w\w*\-)(\d\d)/$1.19.$2/g; #1
: s/\.//g; #2
:
: I can not figure how to do #1 and #2 in one line.
Note that that your pattern is unnecessarily complex; I've fixed that
below, and also shown how to solve your problem:
s/(STT,\d+-\w+-)(\d{2})/${1}19$2/g;
Note how the ${} variable naming syntax is used to separate the name of
variable $1 from the 19 which follows.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Wed, 01 Apr 1998 17:11:59 -0800
From: Steve Palincsar <palincss@tidalwave.net>
Subject: Re: Sorting a Delimeted Text File?
Message-Id: <3522E5DF.5847@tidalwave.net>
And don't forget Joseph Hall's Sort::Fields module, also on CPAN.
Tom Phoenix wrote:
>
> On Tue, 31 Mar 1998, Anthony F. Sanchez wrote:
>
> > Does anyone know of a simple way to "sort" a field or fields in a
> > delimited text file?
>
> Yes. Some of them are in the Perl docs, FAQs, and in the FMTEYEWTK about
> sorting, all of which can be found on CPAN. Cheers!
------------------------------
Date: 1 Apr 1998 21:59:46 GMT
From: psf@euclid.jpl.nasa.gov (Peter Scott)
Subject: Use of implicit split to @_ is deprecated
Message-Id: <6fudci$r6n@netline.jpl.nasa.gov>
Is it really necessary for perl to give this warning (with -w)
when I'm using split in a scalar context? I can trigger this with
perl -we '$x = split'. I would have thought it should only happen
in void context? What am I missing?
"This is perl, version 5.004_04 built for sun4-solaris"
--
This is news. This is your | Peter Scott, NASA/JPL/Caltech
brain on news. Any questions? | (psf@euclid.jpl.nasa.gov)
Disclaimer: These comments are the personal opinions of the author, and
have not been adopted, authorized, ratified, or approved by JPL.
------------------------------
Date: 01 Apr 1998 17:10:23 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: psf@euclid.jpl.nasa.gov (Peter Scott)
Subject: Re: Use of implicit split to @_ is deprecated
Message-Id: <ra3hw5v4.fsf@mailhost.panix.com>
[posted and mailed]
psf@euclid.jpl.nasa.gov (Peter Scott) writes:
> Is it really necessary for perl to give this warning (with -w)
> when I'm using split in a scalar context? I can trigger this with
> perl -we '$x = split'.
Just out of curiosity, why *are* you using split in a scalar context?
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Wed, 1 Apr 1998 23:20:06 GMT
From: bkhilton@netcom.com (Brand and Karina Hilton)
Subject: Re: verifying email address -- how?
Message-Id: <bkhiltonEqrCtJ.GED@netcom.com>
In article <6fiela$o2d$1@client2.news.psi.net>,
Abigail <abigail@fnx.com> wrote:
>
>Regexes are limited (though 5.005 will make them better).
Ooh! I'm salivating! What are the planned enhancements?
Brand
------------------------------
Date: Wed, 01 Apr 1998 14:58:13 -0800
From: Peter McIntosh <peterm@chameleons.com>
Subject: Web Master position-Need some info
Message-Id: <3522C685.78D6F6A3@chameleons.com>
Greetings, I am looking to post two positions for a Sr and Jr Web Master
full time position. Can
anybody tell me where I can find quality candidates for the position in
San Francisco and Foster
City? The reason I am asking you is that the position requires some
knowledge of Perl (not a
lot) then the typical HTML, Some Java, NT, minor Unix and Photoshop /
illustrator. The pay is
excellent. Please let me know where I can send a Job description and
Salary.
===========================================================
Peter McIntosh
Chameleon Consulting, Inc
peterm@chameleons.com
www.chameleons.com
------------------------------
Date: Wed, 01 Apr 1998 17:46:49 -0600
From: carruda@propub2.com
To: carruda@propub2.com
Subject: Win32::Internet Problem
Message-Id: <6fujf5$tet$1@nnrp1.dejanews.com>
I'm using the Win32::Internet module and it works fine with FetchURL,
but not with OpenRequest. I really need help with this one.
I get the following error from many sites when requesting a file with
FetchURL:
HTTP/1.1 406 No acceptable objects were found
Server: Microsoft-IIS/4.0
So, I'm using the following code to "try" to tell the server
to send the right type:
$INET = new Win32::Internet();
$HTTP = $INET->HTTP("$host", "$user", "$pass");
$HTTP->OpenRequest($REQ, "$path$extra");
$REQ->AddHeader("Accept: text/html");
$REQ->SendRequest();
$file = $REQ->ReadEntireFile();
$REQ->Close();
$HTTP->Close();
But I get the following error:
"Can't call method "OpenRequest" without a package or object reference..."
This is the exact "sample" that came with Win32::Internet - could this
be a bug in the module?
Is there another way to stop the server from giving me an "Error 406"?
Please email the reply to me.
Thanks.
Charles Arruda
Progressive Publishing Inc.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 1 Apr 1998 22:58:22 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: YACQ
Message-Id: <6fugqe$3ct$1@ns1.arlut.utexas.edu>
Yet another compiler question: when using -MO=Bytecode, is the
resulting bytecode platform (in)dependent? I read through the README
and the NOTES for the Compiler module, and I couldn't find anything
definitive. I built the compiler on a Solaris2.6-x86 machine with
gcc2.8.0 and on a Solaris2.5.1-sparc machine with gcc2.7.2. I compiled
a program down to bytecode on each machine and the bytecode ran
interchangably on either machine. Those machines were the only ones I
had at my disposal. Did I just get lucky or is the bytecode platform
independent?
Why do I ask? I downloaded the source for the Netscape Browser today
and I've been perusing through it. I got to thinking about the
possibilities...it sure would be interesting if it could be hacked so
that it could run perl bytecode internally. Cobble together some sort
of API and we could have true perl applets. The we can finally get rid
of that mess called java.
Just a thought.
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"It is obvious that about 750,000 people ago, Austin was a wonderful City."
------------------------------
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 2228
**************************************