[16554] in Perl-Users-Digest
Perl-Users Digest, Issue: 3966 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 9 18:06:34 2000
Date: Wed, 9 Aug 2000 15:05:27 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <965858726-v9-i3966@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 9 Aug 2000 Volume: 9 Number: 3966
Today's topics:
Re: "use strict" error message <tina@streetmail.com>
Re: "use strict" error message (Decklin Foster)
Re: ??? (Jon S.)
Re: ??? (Greg Bacon)
Re: [SG]etgroups on HP <david.bitner@noaa.gov>
Re: A fork and Socket problem! <tim@ipac.caltech.edu>
Re: beginner problem <amonotod@netscape.net>
Call Java from Perl cfoley@state.nj.us
Calling other programs <rvanoni@e-estimating.com>
Re: Calling other programs <tony_curtis32@yahoo.com>
Re: Calling other programs <juex@deja.com>
calling several commands at the same time <slogan@staff.hpnc.com>
Re: calling several commands at the same time <uri@sysarch.com>
Re: calling several commands at the same time (Charles DeRykus)
Re: CGI / Pearl Interfacing w/ Dos Program Question (Jon S.)
Re: CGI.pm not passing ampersands properly <nospam@nospam.com>
Re: CGI.pm not passing ampersands properly <flavell@mail.cern.ch>
Re: CGI/Pearl Interfacing w/ DOS Program Question <mjcarman@home.com>
Re: CGI/Pearl Interfacing w/ DOS Program Question <godzilla@stomp.stomp.tokyo>
Check datatype <mail@mail.com>
Re: Convert URLs to links <amonotod@netscape.net>
Re: Converting from US dates/numbers to European dates/ <russ_jones@rac.ray.com>
Create a Static HTML file from a Dynamic Source <greg2@surfaid.org>
Re: Dereferencing correctly in regular expressions <lr@hpl.hp.com>
Digest MD5 2.09 & Irix (@)
Re: ecologically printed perldocs (MJames)
Re: ecologically printed perldocs <bcaligari@shipreg.com>
Re: ecologically printed perldocs (Greg Bacon)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 9 Aug 2000 18:51:50 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: "use strict" error message
Message-Id: <8ms986$79ek5$3@ID-24002.news.cis.dfn.de>
hi,
Ren Maddox <ren.maddox@tivoli.com> wrote:
> Javier Hijas <jhijas@yahoo.es> writes:
>> Could someone tell me what does it means?
>> Global symbol "$YP_DIR" requires explicit package name at ./usradm line
>> 16
> % splain -p <<EOF
> Global symbol "$YP_DIR" requires explicit package name at ./usradm line 16
> EOF
> Global symbol "" requires explicit package name at ./usradm line 16 (#1)
> [...]
wow... never heard of splain...
is that documented in perldoc or just in man splain?
tina
--
http://tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
please no answers via email unless followup is set to poster.
------------------------------
Date: Wed, 09 Aug 2000 19:04:43 GMT
From: decklin+usenet@red-bean.com (Decklin Foster)
Subject: Re: "use strict" error message
Message-Id: <fXhk5.14691$f_5.73379@news1.rdc1.ct.home.com>
amonotod <amonotod@netscape.net> writes:
> 2> use strict;
> 2> my $var = 1;
> 2> my @vars = ( 1, 2, 3);
> 2> my (@vars2, %vars3, $var4);
3> use strict;
3> $::var = 1;
3> $main::var = 1;
3> use vars qw($var); $var = 1;
--
There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There
are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6)
------------------------------
Date: Wed, 09 Aug 2000 19:59:41 GMT
From: jonceramic@nospammiesno.earthlink.net (Jon S.)
Subject: Re: ???
Message-Id: <3991b7fc.24427110@news.earthlink.net>
On Wed, 09 Aug 2000 01:15:40 GMT, vagabond_nomad@my-deja.com wrote:
>Why aren't any of my messages appearing?
>
>
>Sent via Deja.com http://www.deja.com/
Because this should read:
http://www.deja.com/ -w
use strict;
------------------------------
Date: Wed, 09 Aug 2000 20:29:51 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: ???
Message-Id: <sp3fpvc9n4t63@corp.supernews.com>
In article <Pine.GHP.4.21.0008091315480.23130-100000@hpplus03.cern.ch>,
Alan J. Flavell <flavell@mail.cern.ch> wrote:
: On Wed, 9 Aug 2000 vagabond_nomad@my-deja.com wrote:
:
: > Why aren't any of my messages appearing?
:
: Am I dreaming?
Yes. Because this is a dream and it won't hurt, liquidate all your
assets and mail me the proceeds.
Greg
--
A lot of people mistake a short memory for a clear conscience.
-- Doug Larson
------------------------------
Date: Wed, 09 Aug 2000 15:16:28 -0500
From: Dave Bitner <david.bitner@noaa.gov>
Subject: Re: [SG]etgroups on HP
Message-Id: <3991BC1C.21695E05@noaa.gov>
Still no response. Can't get around this problem.
Any gurus want to show off?
tim.szeliga@noaa.gov
Tim Szeliga wrote:
> Trying to compile Perl 5.6.0 on an HP 715 running HP-UX 11.0.
>
> The configuration script makes a big deal of asking me the data type
> of the pointer to the second variable in
> setgroups() and getgroups().
> Problem is, on HP, they are different.
>
> setgroups is const gid_t
> int setgroups(int ngroups, const gid_t *gidset);
> getgroups is gid_t .
> int getgroups(int ngroups, gid_t gidset[]);
>
> This is enough to make compilation fail.
> I tried configuring it both ways, but it failed in the mg.c routine.
>
> This failed using the HP ANSI-C compiler and the Gnu compiler.
> I recall I had the same problem a year or more ago and had hoped either
> HP or the Perl DevTeam had fixed it.
------------------------------
Date: Wed, 09 Aug 2000 11:05:27 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: A fork and Socket problem!
Message-Id: <39919D67.F56360DB@ipac.caltech.edu>
Are you saying these 2 statements work in the parent but not the child?
$proxy = IO::Socket::INET->new("research.soc.staffs.ac.uk:3128") or
die "Could not open socket: $!\n";
print $proxy "whatever\n" or
die "I can't write to the proxy!\n\$! $!\n pid: $pid\n";
Can you rig up a test case that just forks and tries these two statements, and
nothing else, first in the child and then in the parent? What happens?
The only obvious difference between parent and child in your code is the
'close($server);' statement. It doesn't seem like it should matter, but what
happens if it's removed?
Just grasping at straws ...
--
-- Tim Conrow tim@ipac.caltech.edu 626-395-8435
------------------------------
Date: Wed, 09 Aug 2000 17:58:57 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: beginner problem
Message-Id: <8ms64u$1gn$1@nnrp1.deja.com>
In article <8mrpvj$5vv$1@netnews.upenn.edu>,
dbaumann@mail2.sas.upenn.edu (3) wrote:
> 3 (dbaumann@mail1.sas.upenn.edu) wrote:
<snip some ugly code that wouldn't even compile for me...>
> thanks for the responses...but I jsut quickly typed in this code this
<snip>
> something unrelated to syntax....any other ideas?
>
> thanks,
> Don
>
#!perl -w
# faqgrep.pl
# by amonotod
# usage: perlfaq.pl pattern
use strict;
use File::Find;
my (@dirstruct, $status);
my $faq_directory = 'd:/perl/';
my $pattern = $ARGV[0] or die "no pattern available: $!";
find (\&wanted, $faq_directory);
print "Finding files in $faq_directory now...\n";
foreach my $afile (@dirstruct) {
$status = 0;
unless (open (FILE, $afile)) { die "Can't open $afile\n"; }
while (<FILE>){
if (m/$pattern/) {
$status = 1;
}
}
unless (close (FILE)) { die "Could not close $afile\n"; }
if ($status == 1) {
print "$pattern present in $afile\n";
}
}
sub wanted {
my $entry = "$File::Find::name" if -e;
push @dirstruct, $entry if (($entry ne '') && (( m/pod/) and (substr
$entry, 0, -3)));
}
HTH,
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 09 Aug 2000 18:39:17 GMT
From: cfoley@state.nj.us
Subject: Call Java from Perl
Message-Id: <8ms8gl$3cj$1@nnrp1.deja.com>
Can anybody tell me how to call a Java servlet from a PERL script? I
want to Call a Java servlet on an application server on another system
from a PERL script and interpret the results that come back.
Thanks.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 9 Aug 2000 16:03:47 -0400
From: "Rich" <rvanoni@e-estimating.com>
Subject: Calling other programs
Message-Id: <8msdgf$gsv$1@slb3.atl.mindspring.net>
Can anyone tell me how a perl program can call another perl program and pass
data or variables between them? Thanks. Rich.
------------------------------
Date: 09 Aug 2000 15:08:42 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Calling other programs
Message-Id: <87ittaryd1.fsf@limey.hpcc.uh.edu>
>> On Wed, 9 Aug 2000 16:03:47 -0400,
>> "Rich" <rvanoni@e-estimating.com> said:
> Can anyone tell me how a perl program can call another
> perl program and pass data or variables between them?
There are at least 2 answers depending on whether this is
a stealth CGI question.
1. command line = @ARGV
perldoc perlvar
2. CGI = GET/POST
perldoc CGI
perldoc lwpcook
hth
t
--
"With $10,000, we'd be millionaires!"
Homer Simpson
------------------------------
Date: Wed, 9 Aug 2000 13:28:56 -0700
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: Calling other programs
Message-Id: <3991bf09$1@news.microsoft.com>
"Rich" <rvanoni@e-estimating.com> wrote in message
news:8msdgf$gsv$1@slb3.atl.mindspring.net...
> Can anyone tell me how a perl program can call another perl program
system() or backticks `, depending on what you want
> and pass
> data or variables between them? Thanks. Rich.
Short data one way to the new process: just add the data as command
arguments.
Otherwise just like with any other inter-process communication: signals,
pipes, common files, or whatever crosses you mind (well, probably no shared
memory).
jue
------------------------------
Date: Wed, 09 Aug 2000 10:03:54 -0500
From: Steve Loan <slogan@staff.hpnc.com>
Subject: calling several commands at the same time
Message-Id: <399172D9.1608CB3B@stephenlogan.com>
I am trying to do something like this:
&foo;
sub foo {
somefunction; # takes several seconds
someotherfunction; # takes several seconds
yetanotherfunction; # takes several seconds
}
Is there anyway to have all of the functions in foo called at the exact
same time and not wait for the previous one to finish. One way I have
tried getting around it is using system and forking the process in the
background for each function. I'm sure there has to be a better way.
Any help will be greatly appreciated.
Thanks.
------------------------------
Date: Wed, 09 Aug 2000 20:27:04 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: calling several commands at the same time
Message-Id: <x77l9q18q5.fsf@home.sysarch.com>
>>>>> "SL" == Steve Loan <slogan@staff.hpnc.com> writes:
SL> sub foo {
SL> somefunction; # takes several seconds
SL> someotherfunction; # takes several seconds
SL> yetanotherfunction; # takes several seconds
SL> }
SL> Is there anyway to have all of the functions in foo called at the exact
SL> same time and not wait for the previous one to finish. One way I have
SL> tried getting around it is using system and forking the process in the
SL> background for each function. I'm sure there has to be a better way.
SL> Any help will be greatly appreciated.
use Parallel::Universe ;
if these are functions in perl, how could you expect them to run
simultaneously without some sort of parallelism like threads or
processes? and don't use threads with perl unless you know what you are
doing.
so if each of those is working hard (or really they are blocking), fork
off children and selecton their output. it is easy with open FH, "foo|"
and IO::Select.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Wed, 9 Aug 2000 21:15:07 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: calling several commands at the same time
Message-Id: <Fz1n17.3uJ@news.boeing.com>
In article <399172D9.1608CB3B@stephenlogan.com>,
Steve Loan <slogan@staff.hpnc.com> wrote:
>I am trying to do something like this:
>
>&foo;
>
>sub foo {
> somefunction; # takes several seconds
> someotherfunction; # takes several seconds
> yetanotherfunction; # takes several seconds
>}
>
>Is there anyway to have all of the functions in foo called at the exact
>same time and not wait for the previous one to finish. One way I have
>tried getting around it is using system and forking the process in the
>background for each function. I'm sure there has to be a better way.
>Any help will be greatly appreciated.
>
Not necessarily. Backgrounding may be perfectly reasonable
if you don't need to exchange data among processes and
don't care when they complete.
If you need more control, look into explicitly forking
or some of the methods mentioned in perlipc such as
piped opens, open2, socketpairs, etc.
perldoc perlipc
--
Charles DeRykus
------------------------------
Date: Wed, 09 Aug 2000 19:58:23 GMT
From: jonceramic@nospammiesno.earthlink.net (Jon S.)
Subject: Re: CGI / Pearl Interfacing w/ Dos Program Question
Message-Id: <3991b6f9.24167338@news.earthlink.net>
On Wed, 09 Aug 2000 00:58:58 GMT, vagabond_nomad@my-deja.com wrote:
>I am very, very, very new to CGI / Pearl
www.perl.com
"Learning Perl" from www.oreilly.com or Stein's "How to set up and
maintain a website". Skip straight to the chapters in these books on
how CGI and the web works from a client/server perspective. Then,
figure out if Perl is the language to do the job (I bet it is).
Try looking at the tutorials in places like webmonkey.com, etc.
And, finally, don't bug the regulars on comp.lang.perl.misc with
questions about cgi. Post those to
comp.infosystems.www.authoring.cgi.
Jon (also a newbie)
------------------------------
Date: 9 Aug 2000 18:46:10 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: CGI.pm not passing ampersands properly
Message-Id: <8ms8ti$3f1$0@216.155.33.80>
In article <3990a545.2130243@news.newsguy.com>, kcivey@cpcug.org (Keith
Calvert Ivey) wrote:
| Albert Dewey <timewarp@shentel.net> wrote:
|
| >If you are depending on the info from a text box in an html form
| >you might use a little javascript error checking in your page to
| >convert characters like the ampersand to %26 before it gets posted
| >and then decode it with your perl script once the server receives
| >it. This will prevent accidental parsing of your data by your
| >script at the '&' position in the text data.
|
| Of course then your browser will escape the data when posting
| it, and the '%26' will get changed to '%2526', unless of course
| JavaScript is disabled, in which case you'll still get '%26'
| (since the browser escapes the '&' in the data anyway when it
| post it). And then when your script receives the data it'll
| have to decide somehow whether to decode once or twice. And the
| purpose of all this is what? If your browser is sending '&' in
| the data without escaping it, then there's something seriously
| wrong with your browser.
|
| Of course, this has nothing to do with Perl, and I doubt the
| people in comp.infosystems.www.authoring.cgi will appreciate it
| either.
Officially the word is that & should be written as & not %26
according to the html 4.0 spec and previous. Any HTML Validator will
properly report this. (cf. iCab <http://www.icab.de/>, or the w3
validator at <http://validator.w3.org/>
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: Wed, 9 Aug 2000 21:09:16 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: CGI.pm not passing ampersands properly
Message-Id: <Pine.GHP.4.21.0008092057040.23130-100000@hpplus03.cern.ch>
On 9 Aug 2000, The WebDragon wrote:
> Officially the word is that & should be written as & not %26
Hang on, calm down. It's all straightforward if you keep the issues
clear in your mind. It's hopeless if one lashes out with random
escaping recipes.
Form submissions via method GET use the ampersand character (in the
query part of) the URL to separate the name=value pairs from each
other. IN THE URL, those ampersands need to be ampersands.
If you need an ampersand to be part of a URL without it playing its
special role, then you need to "URL-encode" it as %26 in the URL.
If you want it to play its special role, then you must leave it alone
in the URL - URLencoding it would be wrong.
> according to the html 4.0 spec
The HTML spec doesn't specify URLs; it specifies how to encode URLs
when they are used as the values of certain attributes, such as HREF=
or SRC= attributes. _WHEN_ using a URL that properly contains an
ampersand charcter, into such an attribute value, _THEN_ you need to
represent the ampersand in HTML's &-format, e.g &
But the clever move when dealing with hand-composed GETs is to follow
the advice in the HTML specs, and use semi-colon instead.
Fuller discussion at
http://ppewww.ph.gla.ac.uk/~flavell/www/formgetbyurl.html
Use a reasonably recent version of CGI.pm and it'll take care of
this (using its newstyle URLs pragma, which is now the default).
Keep clearly in mind the context of these various usages. If you
are typing a URL into the dialog window of a browser, for example,
there is absolutely no reason you should go trying to entify
ampersands into & - because you aren't writing HTML!!!
------------------------------
Date: Wed, 09 Aug 2000 12:46:21 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: CGI/Pearl Interfacing w/ DOS Program Question
Message-Id: <399198ED.CDC0AB7B@home.com>
vagabond_nomad@my-deja.com wrote:
>
> Perhaps a DOS emulator...(is that what WINE is?) would allow for the
> DOS program to run on a Unix machine?
WINE is actually a full-blown Windows emulator, popular among Linux
users who still need to run a few Win* apps. But yes, you'll probably
need to use an emulator. Your other options would be:
1) Recompiling as a Unix program, assuming that your source code
is reasonably portable. Kind of defeats the purpose, otherwise,
but then so would running under an emulator instead of a
real OS.
2) Hooking your Unix server up to a Win* box with some sort of
proxy allowing the server to run programs on the PC. Personally,
I haven't a clue how to do this, but it would strike me as the
better solution.
> The reason that this absolutely has to be a DOS program running
> on a Unix server is because (1) they want to run it on a Unix
> server in order to reach the largest possible number of people,
> and (2) this DOS program is ultimately going to be a component
> of a Win98 application but has only been compiled as a DOS
> program in order to get it to run on the Unix machine.
Bleach. Messy.
> The reason for doing all this is that they want beta testers to be able
> to run this component via the web and report bugs in the logic and to
> give feedback about ways to improve the process.
Maybe recompilation for your server would be okay, then...
> Is this the kind of detail that you were wanting?
Yes, it's helpful. At least I know that you really meant it when you
said you wanted a DOS program running under Unix.
> [H]ow exactly would I get this CGI/Perl script to
> interface with the DOS program?
Backticks, most likely:
$output = `myprogram $arg1 $arg2`;
BUT VERIFY AND DE-TAINT YOUR USER INPUT FIRST!
Otherwise, you open a massive hole on your server that allows anybody,
and I mean anybody, with web access to wreak havoc. You'll definately
want to read up on creating sercure CGI scripts.
> Note that we may just send this input back to the DOS program by
> setting command line flags, which the executable will recognize.
Might be the best way. You could interface through a shared file, but
then you have to worry about locking and all the potential messes of
keeping simultaneous users' IO straight. Another option is to make your
DOS program read from STDIN and write to STDOUT, so you can just pipe
data in and out. Which you use will depend on how complex the things you
need to pass in and out are.
Hrm. I have one more wild idea that may be useful for you: I've never
done it myself, but Perl can interface with other languages. E.g, you
can call C code from a Perl script. Again, this would mean recompilation
to run your code on the server directly, but that may be a reasonable
option for you if all you're really concerned about is the logic and
your program doesn't have any OS ties.
> 6. The DOS program will process the new input.
> 7. Receive its output.
> 8. Format its output as HTML.
> 9. Send this output HTML to the user's browser, etc, etc, etc.
The last couple of steps, at least, are easy. You want the CGI.pm
module. You can find it at CPAN if you don't have it installed already.
It has all the functionality you should need for the web side of your
interface. Between it's documentation and the FAQ, you should be able to
figure that part out.
-mjc
------------------------------
Date: Wed, 09 Aug 2000 12:54:38 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: CGI/Pearl Interfacing w/ DOS Program Question
Message-Id: <3991B6FE.7AD97E6B@stomp.stomp.tokyo>
vagabond_nomad@my-deja.com wrote:
(snippage)
> 1. Start the program.
> 2. Receive its output.
> 3. Format its output as HTML.
> 4. Send this output HTML to the user's browser.
> 5. ... user's browser ... input and send it back to the DOS program.
> 6. The DOS program will process the new input.
> 7. Receive its output.
> 8. Format its output as HTML.
> 9. Send this output HTML to the user's browser, etc, etc, etc.
I wish to be sure I understand what you want to do.
You want to write a Perl web interface.
You want your Perl script to interface with perl core.
You want your perl core to interface with a DOS exe.
You want your DOS exe. to run under DOS.
You want your DOS to interface with an emulator.
You want your emulator to interface with UNIX.
... and you want reliable two way traffic via this system?
You have an hour or so to wait for a simple word
like "Hello" to return to your web browser?
> So, with this new information, does anyone have any ideas?
Yes, hire a professional programmer to write this
program in C and install it for you via UNIX.
Godzilla!
------------------------------
Date: Wed, 09 Aug 2000 14:15:57 -0500
From: a <mail@mail.com>
Subject: Check datatype
Message-Id: <3991ADED.5F667844@mail.com>
How can I check the datatype. Right now I have:
if( ($numberRecords !=~ /\D/) || ($numberErrors !=~ /\D/) )
to see if the variable is a number.
------------------------------
Date: Wed, 09 Aug 2000 19:09:19 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Convert URLs to links
Message-Id: <8msa8r$4pi$1@nnrp1.deja.com>
In article <8mrg81$cpn$1@horn.hk.diyixian.com>,
"multiplexor" <abuse@localhost.com> wrote:
> "." is any character and "\w" is any alphanumeric character, which
> doesn't include full stop.
>
> Just a trial:
>
> ####
> $string = <<'EOC';
> http://anything.net
> www.anything.com
> http://www.anything.net
> EOC
> $string =~ s!((http://|www\.)\S*)!<a href=$1>$1</a>!gi;
> print $string;
> ####
>
> Expression: Starts with "http://" or "www." followed by optional
non-space
> characters.
> Protocol and domain name are case-insensitive, as I know.
>
> Hope this helps.
>
> "Fernando" <fm@via-rs.net> wrote
> > I want to write a regular expression that search if the user
supplied a
> > url(http://anything.net or www.anything.com for example) in a
texarea form
> > and convert it to a link.
> >
> > I tried the following:
> >
> > $string =~ s/(http:\/\/.+|www\..+)/<a href=$1>$1<\/a>/g;
> >
> > Well, of course it failed, but if I substitute the "." for a "\w"
it'll
> > still not do the right job.
>
>
#!perl -w
#
# by multiplexor
# enhanced by amonotod
use strict;
my $string = <<'EOC';
http://anything.net
anything.net
www.anything.com
http://www.anything.net
amonotod.freeservers.com
www.geocities.com/amonotod
pics.ebay.com/aw/pics/navbar/ebay_logo_home.gif
EOC
$string =~ s!((http://|\w*\.\w*)\S*)!<a href=$1>$1</a>!gi;
print $string;
exit;
Works better, but keep in mind that it'll take stuff like example.gif,
so be prepared for some potential weirdness...
HTH,
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 09 Aug 2000 13:36:53 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <3991A4C5.BFCDF0DA@rac.ray.com>
Larry Rosler wrote:
>
>
> How about 1 billion Chinese? The ISO-8601 standard -- 'the sensible
> one' -- is the date-time notation used in China (and may have been
> adapted from the Chinese standard representation, though I don't know
> the history).
>
I'd sure rather have 1 billion Chinese storming the gate in the US
than having 1 billion of them storming the gate in the UK!!!
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Wed, 09 Aug 2000 22:45:14 +0100
From: Greg Griffiths <greg2@surfaid.org>
Subject: Create a Static HTML file from a Dynamic Source
Message-Id: <3991D0EA.D3B27DD7@surfaid.org>
Dear All,
I've got a database driven website that has a navigation bar that is
dynamically built from the database each time it is called, thus making
its use in a tables based site very processor intensive, and Frames
cause problems with the way I want the site to function too. So, what i
want to do is this,
On Changing the elements of the navbar run some perl that will
write it all out to a temporary file
delete the current live copy
rename the file to the live copy
I assume that I can call this HTML file from the CGI-Bin and don't need
to copy it into the HTML directories ?
Any help would be appreciated
------------------------------
Date: Wed, 9 Aug 2000 11:22:47 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Dereferencing correctly in regular expressions
Message-Id: <MPG.13fb414f3e50b1c598ac52@nntp.hpl.hp.com>
In article <MPG.13fba278c6f1adab9896d0@news> on Wed, 09 Aug 2000
07:15:35 GMT, jason <elephant@squirrelgroup.com> says...
...
> the point I was making .. was that with
>
> print "if(1) { print 'abc'; }";
>
> you obviously don't want Perl to evaluate the code .. so .. somewhere
> between the above and
>
> print "blah $x->func() blah";
>
> there's a line .. so you want the line drawn somewhere between the two
>
> someone else obviously wanted the line drawn (more obviously if you ask
> me) at between variable interpolation and ANY code evaluation that
> wasn't directly required to interpolate a variable
...
> I think that a more obvious spot to drawn the line (it's certainly
> easier to explain to a beginner) is between variable interpolation and
> code evaluation .. I guess I should throw it back at you .. why bother
> increasing the scope of double-quoted string evaluation ? .. already
> there are tricks to have what you want .. so why change the language
> when there's currently a clear distinction - that of variable
> interpolation vs code evaluation ?
Actually, if I had the choice, I'd push the line the other way -- toward
interpolating a simple variable only -- no array indexing or hash
accessing. (There is precedent for this elsewhere, in filehandles, for
example, because of syntactic ambiguity.)
I abhor ambiguity resolution by white space, so that, for example:
/$x[0]/
interpolates the 0'th element of @x, but
/$x [0]/
matches a scalar interpolation of $x followed by a space, followed by a
character class containing '0'. Does it depend on whether @x is already
declared?
Does /$x{1}/ match $x or the element keyed by '1' in the hash %x? And
/$x {1}/ match $x followed by ' {1}'? Does it depend on whether %x is
already declared?
Sheesh! Try them out and see what happens.
Oh, for a formal language definition!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 9 Aug 2000 16:05:12 +0100
From: "Nick Gushlow" <nick.gushlow(@)usa.net>
Subject: Digest MD5 2.09 & Irix
Message-Id: <399173ac_1@nnrp1.news.uk.psi.net>
Help!!
I'm trying to install the Digest-MD5-2.09 module on my Irix 6.4 box and I'm
having problems compiling the Makefile.PL.
When executing perl Makefile.PL I get the following:
"u32align.c": Error: Invalid format revision (WHIRL::0.28:) for intermediate
compiler file (/tmp/ctmB.BAAa001k4)
Can't compile test program
Processing hints file hints/irix_6.pl
Writing Makefile for Digest::MD2
Writing Makefile for Digest::SHA1
Writing Makefile for Digest::MD5
I thought I might be able to ignore it and proceed with make but that just
throws up lots more errors, so obviously this is a problem; a problem well
outside my range of knowledge.
Ideas anyone?
TIA
--
Nick Gushlow
-------oOo-------
Email: nickg(@)dynamicweb.co.uk
-------oOo-------
------------------------------
Date: Wed, 09 Aug 2000 19:15:02 GMT
From: margaret.james@vistaeyecare.com (MJames)
Subject: Re: ecologically printed perldocs
Message-Id: <3991acf4.195557046@news.nationalvision.com>
On Sat, 29 Jul 2000 01:47:01 +0200, "Brendon Caligari"
<bcaligari@shipreg.com> wrote:
>Are there printed perldoc versions available from anywhere?
>It's a good thing to have on-line documentation, etc but nothing
>beats a good old printout. However, having printed perlfaq
>and perlfunc to add to my collection of man pages, craters are
>being nuked in my pocket and the ecological cost of all this
>printer toner and A4 paper is hitting me.
>
>Also, at cpan, there seem to be ps, html, etc versions of the perl
>documentaion. Is there a windows help file version around?
>Searched the web but found none.
>
>B
>
>ZCZC
>
>
Brendon, did you ever find your windows docs for perl? If not, I just
found a massive html gzip file on CPAN that contains all the docs.
It's at http://www.cpan.org/doc/manual/html/index.html - look for the
link labeld "gigantic GNU-zipped tarfile".
Mj
------------------------------
Date: Wed, 9 Aug 2000 22:01:11 +0200
From: "Brendon Caligari" <bcaligari@shipreg.com>
Subject: Re: ecologically printed perldocs
Message-Id: <8msclo$2vv$1@news.news-service.com>
> >
> >
>
> Brendon, did you ever find your windows docs for perl? If not, I just
> found a massive html gzip file on CPAN that contains all the docs.
> It's at http://www.cpan.org/doc/manual/html/index.html - look for the
> link labeld "gigantic GNU-zipped tarfile".
>
> Mj
Thanks 'mon
Same docs come pre-packed with the ActivePerl distribution...fantastic
thing. Haven't so far found a version of the docs in windows .hlp format.
I like the latter because it's small, cute and convenient...often carefully
indexed and easy to search.
Haven't found 'cheaply available' printouts of the docs. either...printed
perlfaq-perlfaq9 and had them binded.....dared go as far as print perlfunc
(a waste considering i had burnt a hole in my pocket with Programming Perl
and some other texts). However, given the 'love' many here express towards
their perlfaqs i'm surprised they haven't been binded in leather and sold on
amazon under the 'religious titles'.
thanks :))
Brendon
------------------------------
Date: Wed, 09 Aug 2000 20:27:30 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: ecologically printed perldocs
Message-Id: <sp3flibnn4t169@corp.supernews.com>
In article <8msclo$2vv$1@news.news-service.com>,
Brendon Caligari <bcaligari@shipreg.com> wrote:
: Haven't found 'cheaply available' printouts of the docs. [...]
Buy a cheap laptop, install Linux, install Perl, and carry it to the
bathroom with you. :-)
: [...] However, given the 'love' many here express towards their
: perlfaqs i'm surprised they haven't been binded in leather and sold on
: amazon under the 'religious titles'.
You can't grep dead trees.
Greg
--
Santa: Stan, remember the choo-choo when you were three?
Jesus: I died for your sins, boys, don't forget that..
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3966
**************************************