[25515] in Perl-Users-Digest
Perl-Users Digest, Issue: 7759 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 9 11:06:09 2005
Date: Wed, 9 Feb 2005 08:05:30 -0800 (PST)
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, 9 Feb 2005 Volume: 10 Number: 7759
Today's topics:
Re: back references <bogus@nowhere.net>
Re: back references (Anno Siegel)
Re: CGI - web content into variable <andy@aaelectron.co.uk>
Re: fields pragma (Anno Siegel)
Have issues trying to compile Math::Pari on AIX......Pl <btna@terra.com>
Re: Help!!! Newbee to win32-programming! <scobloke2@infotop.co.uk>
How to resolve parameter read from text file in perl sc <ganesh_tiwari@hotmail.com>
Re: ptk_steal <zentara@highstream.net>
Re: Q: Why does this match not work? <cooljake@gmail.com>
regexp question <bart@NOSPAM.tvreclames.nl>
Re: regexp question <do-not-use@invalid.net>
Re: regexp question <bart@NOSPAM.tvreclames.nl>
Re: regexp question (replace z with h, spam protection)
Regexp::Common question related to URI query <info4l@info-for-life.com>
Re: Regexp::Common question related to URI query <mritty@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 9 Feb 2005 10:07:16 -0500
From: "REH" <bogus@nowhere.net>
Subject: Re: back references
Message-Id: <cud8v4$igo2@cui1.lmms.lmco.com>
"Jim Gibson" <jgibson@mail.arc.nasa.gov> wrote in message
news:080220051432021454%jgibson@mail.arc.nasa.gov...
> In article <cubce4$huf1@cui1.lmms.lmco.com>, REH <bogus@nowhere.net>
> wrote:
>
> > How to a specify a back reference immediately followed by a number
without
> > Perl thinking its part of the back reference?
>
> I am guessing you mean backreferences within a regular expression, such
> as the \1 in m/(.)\1/ to match any doubled character. (It would have
> been nice to have posted a program demonstrating the problem.)
>
> Surround the backreference in parentheses, either capturing or
> non-capturing:
>
> m/(.)(\1)2/
> or
> m/(.)(?:\1)2/
>
> to match any doubled-character followed by a 2.
>
>
I'm sorry for being vague. I mean using backreferences in the replacement
part of a regular expression. I need to have a "\1" immediately followed by
a number, such as "\11" but the last one is not part of the backreference.
Thanks
------------------------------
Date: 9 Feb 2005 15:58:04 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: back references
Message-Id: <cudbuc$n1g$2@mamenchi.zrz.TU-Berlin.DE>
REH <bogus@nowhere.net> wrote in comp.lang.perl.misc:
> "Jim Gibson" <jgibson@mail.arc.nasa.gov> wrote in message
> news:080220051432021454%jgibson@mail.arc.nasa.gov...
> > In article <cubce4$huf1@cui1.lmms.lmco.com>, REH <bogus@nowhere.net>
> > wrote:
> >
> > > How to a specify a back reference immediately followed by a number
> without
> > > Perl thinking its part of the back reference?
[proposed solution]
> I'm sorry for being vague. I mean using backreferences in the replacement
> part of a regular expression. I need to have a "\1" immediately followed by
> a number, such as "\11" but the last one is not part of the backreference.
You don't use that kind of backreference in the replacement part, you
use the capturing variables $1, $2, etc. This is simple string
interpolation: "${1}2".
Anno
------------------------------
Date: Wed, 09 Feb 2005 15:22:51 +0000
From: Andrew Armstrong <andy@aaelectron.co.uk>
Subject: Re: CGI - web content into variable
Message-Id: <t39k01tcm692a2jhrpofiqa1vj4bijpvmn@4ax.com>
>
>In the study of software engineering, I recommend that you start from
>the beginning.
>
>In C, that would be:
>
>#include <stdio.h>
>int main()
>{
> printf("Hello, World!");
> return 0;
>}
>
>in Perl,
>
>print 'Hello, World!';
>
>Once you have a solid understanding of these basic concepts, take it
>one step at a time. For several thousand US dollars, you can have a
>famous Perl book author come to your home and tutor you.
You are of course right - but I have to make things work without the time for a
proper course of study first. Normally there is a little more chance to learn
beforehand, but here I searched inefficiently and failed to find the right
explanations. Then deadlines loomed.
I didn't find the excelent Perl FAQ using Google and searching for what I wanted
to do, rather than for FAQ.
I don't need to become much of a software engineer at present. Normally I work
on analogue electronics - where I know what the questions are, and where to find
most of the answers. My switched mode power supplies are more efficient than the
industry standard, which can't be said for my code.
When cheap microcontrollers are fast enough to control quasiresonant power
factor correctors, (and its getting close) I shall probably have to program in
assembler to keep the speed up. Until then I will learn as much as time permits.
If I had the dollars, coming to my home might be an excessive commitment on
account of the air fares. I assume we are on opposite sides of the wet bit (I am
in UK).
------------------------------
Date: 9 Feb 2005 15:50:11 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: fields pragma
Message-Id: <cudbfj$n1g$1@mamenchi.zrz.TU-Berlin.DE>
Lee Goddard <leegee@gmail.com> wrote in comp.lang.perl.misc:
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message
> news:<cubhmp$i1o$1@mamenchi.zrz.TU-Berlin.DE>...
> > Lee Goddard <leegee@gmail.com> wrote in comp.lang.perl.misc:
> > > Is it possible to use the fields pragma to specify the type of each
> > > object member/field?
> >
> > What does the documentation say? "perldoc fields".
>
> From what I understand, it impliments object fields using arrays, so
> could never support what I'm after, as below:
>
>
> > I'm not sure what you mean with "type of field". Do you want to distinguish
> > strings, integers, floats? Or want to allow only certain kinds of refs
> > (hash, array, code)? Or only objects of certain classes? Something else?
> >
> > > If not, is there a modulelist module which allows this to be done?
> >
> > Define "this". If with "types" you mean numeric types, check out PDL.
>
> Thanks, Anno: that's the only thing I'm not after, which is basic
> implimentation instantiating the fields with given perl types, either
^^^^^^^^^^
"Perl types" is not a recognized part of Perl terminology. My question
is what you mean by it, but instead of explaining you use it as if it
*was* an explanation.
> scalars or references. Instances of objects would be nice, too, but
> not something I need today.
Oh man... Now which is what you want and which is what you don't want?
> I tried declaring my own global fields hash and instantiating objects
> from it, but of course, setting a field to instantiate to an anonymous
> hash/array is setting the field in every instance of the object to
> refer to the same anonymous hash/array.
Again you're using undefined terms as if they had a definite meaning.
What is "setting a field to instantiate to (something)"? I don't have
the slightest idea what you might have done. Show some code instead
of using undefined terms to explain another undefined terms.
Same hash/array: That would depend on how you do it. If you create a
new hash each time, you'll have different hashes. If you take a
reference to the same hash each time, they'll all point to the same one.
> So I wrote the necessary code to get around this (check type of ref,
> create new anon thingy), but it seems so necessary that I thought
> there might be a pragma for it.
Why do you think this so necessary? I have rarely felt the need to
check object fields for their content. If I do, I put a check in the
accessor for that field and that's it. Nor is it necessary to preset
a field that is going to hold an array (say) to an arrayref. Leave the
field unspecified, then autovivification will initialize it to the
right thing on first access.
I don't think we're getting anywhere this way. Show some code that
demonstrates what you want to do. If there's a popular module or
pragma that does something similar, people will know and tell you.
Anno
------------------------------
Date: 9 Feb 2005 07:16:16 -0800
From: "btna" <btna@terra.com>
Subject: Have issues trying to compile Math::Pari on AIX......Please help!
Message-Id: <1107962176.947005.276960@l41g2000cwc.googlegroups.com>
Hello all,
I am a newbie at installing these Perl modules and I am having trouble
getting to install the Math::Pari which is a pre-requisite for
Net::SSH. THis is what I have done so far:
- Downloaded pari-2.1.6 and compiled it. I think it was ok since I did
not get anyy errors: I did : ./Configure, make gp, make install and I
got the following in /usr/local/lib/libpari.a
-Next, I tried the Math::Pari and I get "Undefined Sysmbols" and the
end: (NOTE that I am leaving out som eof the "cc" lines to make the
post shorter)
$ >perl Makefile.PL
Setting up Math::Pari with Perl 5.006 on aix version 5.0.0.0;
cc=cc, gccversion=, ccflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE
-D_POSIX_SOURCE -
qmaxmem=16384 -q32 -D_LARGE_FILES -qlonglong',
ld=ld, ldflags='-b32', optimize='-O'.
Found GP/PARI build directory in ./pari-2.1.6
(integer-formatted version 2001006).
...Generating libPARI/paricfg.h ...
Scanning header files...
...ulong
...getrusage
...CLK_TCK not defined
Creating libPARI/paricfg.h...
...Processor of family `aix' detected
Problems with numeric interface codes noted:
May be harmless: non-unique string interfaces for numeric interfaces:
29 meaning "GGp GG GGD0,L,p"
(appears for agm, besseljh, bnrconductorofchar, ellheightmatrix,
ellordina
te, ellpointtoz, ellztopoint, idealprimedec, ideleprincipal, incgamc,
qfbprimefo
rm, rnfconductor, rnfinit, rnfpolred, theta)
Possible problems with Math::Pari interface to GP/PARI:
unexpected value of string interfaces for numeric interfaces:
29 meaning "GGp GG GGD0,L,p" (was meaning "GGp" in 2.1.3)
(may affect functions idealprimedec, rnfconductor)
Checking if your kit is complete...
Looks good
...Processor of family `aix' detected
#### Do not know how to build for assembler `aix'. ####
#### Reversing to assembler-less type `port'. ####
#### ####
#### If you think your processor's assembler is supported ####
#### by PARI, edit libPARI/Makefile.PL and report. ####
#### ####
#### Alternatively, specify machine=YOURTYPE on the ####
#### perl Makefile.PL line ####
#### Recognized types: ####
#### alpha hppa m86k none sparcv7 sparcv8 sparcv8_micro ####
#### sparcv8_super ix86 ####
...I will use portable assembler-less build
Writing Makefile for Math::PARI::libPARI
Writing Makefile for Math::Pari
$ >make
mkdir blib
mkdir blib/lib
mkdir blib/lib/Math
cp libPARI.pod blib/lib/Math/libPARI.pod
cp PariInit.pm blib/lib/Math/PariInit.pm
cp Pari.pm blib/lib/Math/Pari.pm
cp libPARI.dumb.pod blib/lib/Math/libPARI.dumb.pod
cd libPARI && make LIB="" LIBPERL_A="libperl.a"
LINKTYPE="dynamic" PREFI
X="/usr/opt/perl5" OPTIMIZE="-O"
/usr/bin/perl -pe1 .././pari-2.1.6/src/kernel/none/level0.h
.././pari-2.
1.6/src/kernel/none/level1.h > pariinl.h
cc -c -I.././pari-2.1.6/src/headers -I.././pari-2.1.6/src/graph
-I. -D_A
LL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -q32
-D_LARGE_FILES -q
longlong -O -DVERSION=\"0.10\" -DXS_VERSION=\"0.10\"
-Derr=pari_err -DDYN
AMIC_PLOTTING -o alglin2.o .././pari-2.1.6/src/basemath/alglin2.c
cc -c -I.././pari-2.1.6/src/headers -I.././pari-2.1.6/src/graph
-I. -D_A
LL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -q32
-D_LARGE_FILES -q
longlong -O -DVERSION=\"0.10\" -DXS_VERSION=\"0.10\"
-Derr=pari_err -DDYN
AMIC_PLOTTING -o gen1.o .././pari-2.1.6/src/basemath/gen1.c
cc -c -I.././pari-2.1.6/src/headers -I.././pari-2.1.6/src/graph
-I. -D_A
LL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -q32
-D_LARGE_FILES -q
longlong -O -DVERSION=\"0.10\" -DXS_VERSION=\"0.10\"
-Derr=pari_err -DDYN
AMIC_PLOTTING -o thue.o .././pari-2.1.6/src/modules/thue
.....
..... MORE CC LINES
.....
cc -c -I.././pari-2.1.6/src/headers -I.././pari-2.1.6/src/graph -I.
-D_A
LL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -q32
-D_LARGE_FILES -q
longlong -O -DVERSION=\"0.10\" -DXS_VERSION=\"0.10\"
-Derr=pari_err -DDYN
AMIC_PLOTTING -o mpinl.o .././pari-2.1.6/src/kernel/none/level1.c
rm -f libPARI.a
ar cr libPARI.a alglin2.o gen1.o thue.o galois.o highlvl.o
subgroup.o g
en2.o gen3.o mpqs.o galconj.o trans1.o trans2.o compat.o trans3.o
base1.o ifacto
r1.o base2.o base3.o plotport.o base4.o base5.o buch1.o buch2.o buch3.o
bibli1.o
buch4.o bibli2.o helpmsg.o init.o es.o rootpol.o anal.o errmsg.o
polarit1.o pol
arit2.o polarit3.o stark.o arith1.o arith2.o nffactor.o kummer.o
sumiter.o plotg
nuplot.o elliptic.o subfield.o alglin1.o kernel.o mp.o mpinl.o
: libPARI.a
Target "makemakerdflt" is up to date.
/usr/bin/perl "-I/usr/opt/perl5/lib/5.6.0/aix"
"-I/usr/opt/perl5/lib/5.6
.0" -e 'use ExtUtils::Mksymlists; Mksymlists("NAME" => "Math::Pari",
"DL_FUNCS"
=> { }, "FUNCLIST" => [], "DL_VARS" => []);'
/usr/bin/perl -I/usr/opt/perl5/lib/5.6.0/aix
-I/usr/opt/perl5/lib/5.6.0
/usr/opt/perl5/lib/5.6.0/ExtUtils/xsubpp -typemap
/usr/opt/perl5/lib/5.6.0/ExtU
tils/typemap -typemap typemap Pari.xs > Pari.xsc && mv Pari.xsc Pari.c
cc -c -I./pari-2.1.6/src/headers -I./pari-2.1.6/src -I./libPARI
-D_ALL_S
OURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -q32
-D_LARGE_FILES -qlong
long -O -DVERSION=\"2.010603\" -DXS_VERSION=\"2.010603\"
-I/usr/opt/perl5
/lib/5.6.0/aix/CORE -DPARI_VERSION_EXP=2001006 -DDEBUG_PARI
-DLSB_in_U32=3 -Derr
=pari_err Pari.c
"Pari.xs", line 911.5: 1506-010 (W) Macro setSVpari_or_do invoked with
a null ar
gument for parameter action.
"Pari.xs", line 911.5: 1506-010 (W) Macro morphSVpari invoked with a
null argume
nt for parameter action.
"Pari.xs", line 952.3: 1506-010 (W) Macro setSVpari_or_do invoked with
a null ar
gument for parameter action.
"Pari.xs", line 952.3: 1506-010 (W) Macro morphSVpari invoked with a
null argume
nt for parameter action.
mkdir blib/arch
mkdir blib/arch/auto
mkdir blib/arch/auto/Math
mkdir blib/arch/auto/Math/Pari
Running Mkbootstrap for Math::Pari ()
chmod 644 Pari.bs
LD_RUN_PATH="/lib" ld -o blib/arch/auto/Math/Pari/Pari.so
-bhalt:4 -bM:
SRE -bI:/usr/opt/perl5/lib/5.6.0/aix/CORE/perl.exp -bE:Pari.exp -b
noentry -lC -
lc Pari.o libPARI/libPARI.a -L/usr/local/lib -lm
ld: 0711-317 ERROR: Undefined symbol: .PERL_UNUSED_VAR
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
make: 1254-004 The error code from the last command is 8.
Stop.
$>
Does anyone know what I may be missing? is it a library?
Thanks in advance,
BTNA
------------------------------
Date: Wed, 9 Feb 2005 13:24:24 +0000 (UTC)
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: Help!!! Newbee to win32-programming!
Message-Id: <cud2u8$5n7$1@sparta.btinternet.com>
Anne-Marte wrote:
> I've written a simple perl-script which is supposed to run on a
> win32-platform. What exactly do I need to do to make this script run?
> I get an error message saying that my script is not a valid win32
> application. I'm also trying to connect to an Oracle database using
> DBI. What am I doing wrong?
>
> Anne-Marte Krogsrud
You don't say whether you installed a Perl interpreter, or if so, which one.
I use the free download from http://www.activestate.com/. Once this is
installed, all perl scripts are directly executable, so long as you use
the expected filename extension ".pl".
------------------------------
Date: 9 Feb 2005 07:16:07 -0800
From: "Gancy" <ganesh_tiwari@hotmail.com>
Subject: How to resolve parameter read from text file in perl script
Message-Id: <1107962167.836864.51270@c13g2000cwb.googlegroups.com>
Hi All,
I have a perl script which reads parameters from text file and builds
the command line string for another perl script. and i intend to
execute the same with systm command.
parameter file would look Something like this
Parameter file:
description=1
log=0
outputdir=~gancy/testsource
scandir=pwd
perl script reads this and builds commnad line and calls the system
command.
if i print the string would look like
print $CmdLine;
perl BinaryParser.pl -d ~gancy/testsource pwd
system("$CmdLine");
but the problem is system command does not resolve ~ and pwd.
I have tried same in C, it works exactly as i want. Even i tried to
fork antoher process.
any suggestions
Thanks
Ganesh Tiwari
------------------------------
Date: Wed, 09 Feb 2005 07:06:11 -0500
From: zentara <zentara@highstream.net>
Subject: Re: ptk_steal
Message-Id: <l0vj01lo9c92svgam1getk5s2fvh4v8g0g@4ax.com>
On Tue, 08 Feb 2005 10:23:51 -0500, JiggaHertz <JiggaHertz@nospam.com>
wrote:
>
>The xterm on my system doesn't allow a -into command line switch. Also
>I was hoping to generalize this to embed other application windows.
>
>Thanks for your help,
>JH
You need a relatively recent version of xterm.
It would be nice if you are successful in generalizing embedding,
but others have tried and given up on this approach. There are too
many complications.
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
------------------------------
Date: 9 Feb 2005 08:04:19 -0800
From: "jake1138" <cooljake@gmail.com>
Subject: Re: Q: Why does this match not work?
Message-Id: <1107965059.511063.128510@l41g2000cwc.googlegroups.com>
Doh! The problem was elsewhere. Below is the full corrected code.
Before, I was opening the file once outside the "for my" loop and
closing it within the "for my" loop, thus <FILE> was empty when I got
to the second string.
for my $func_def ("int config_read", "int config_write") {
$str_protos .= "$func_def(struct x_config *config);\n";
open FILE, "$fname" or die "ERROR: Cannot open file '$fname'";
while(<FILE>) {
chop;
if ((/^$func_def\s*\(.*\)\s*[^;]?\s*$/i) || ($found == 1)) {
$found = 1;
$str_funcs .= "$_\n";
}
if ((/^\}$/i) && ($found == 1)) {
$str_funcs .= "\n";
last;
}
close FILE;
if ($found == 0) {
# generate the function code
}
found = 0;
}
}
------------------------------
Date: Wed, 9 Feb 2005 14:20:51 +0100
From: "Bart van den Burg" <bart@NOSPAM.tvreclames.nl>
Subject: regexp question
Message-Id: <cud3e4$fg4$1@reader11.wxs.nl>
Hi
Say i have this code:
perl -we 'my $string = "abc help cba abc help cba"; $string =~
/abc(.*)cba/s; print "$1\n";';
this prints about: " help cba abc help ".
However, i wish for it to only match (the first) " help "...
What do i need to change in order for this to work?
Thanks
Bart
------------------------------
Date: 09 Feb 2005 14:47:13 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: regexp question
Message-Id: <yzdsm453kwu.fsf@invalid.net>
"Bart van den Burg" <bart@NOSPAM.tvreclames.nl> writes:
>
> Say i have this code:
>
> perl -we 'my $string = "abc help cba abc help cba"; $string =~
> /abc(.*)cba/s; print "$1\n";';
>
> this prints about: " help cba abc help ".
> However, i wish for it to only match (the first) " help "...
>
> What do i need to change in order for this to work?
Use "*?" for matching:
perl -we 'my $string = "abc help cba abc help cba"; $string =~
/abc(.*?)cba/s; print "$1\n";';
See
perldoc -q greedy.
------------------------------
Date: Wed, 9 Feb 2005 14:52:47 +0100
From: "Bart van den Burg" <bart@NOSPAM.tvreclames.nl>
Subject: Re: regexp question
Message-Id: <cud59s$geb$1@reader11.wxs.nl>
Great! Thanks! :D
------------------------------
Date: Wed, 9 Feb 2005 15:04:34 +0100
From: "D. Marxsen" <detlef.marxsen@tdds-gmbz.de (replace z with h, spam protection)>
Subject: Re: regexp question
Message-Id: <cud59t$gd1$1@domitilla.aioe.org>
"Bart van den Burg" <bart@NOSPAM.tvreclames.nl> schrieb im Newsbeitrag
news:cud3e4$fg4$1@reader11.wxs.nl...
> perl -we 'my $string = "abc help cba abc help cba"; $string =~
> /abc(.*)cba/s; print "$1\n";';
>
> this prints about: " help cba abc help ".
> However, i wish for it to only match (the first) " help "...
>
> What do i need to change in order for this to work?
You fell into the "greedy"-trap. Try this:
my $string = "abc help cba abc help cba";
$string =~/abc(.*)cba/s; # Your version
print "$1\n";
$string =~/abc(.*?)cba/s; # Try this
print "$1\n";
Cheers,
Detlef.
--
D. Marxsen, TD&DS GmbH
detlef.marxsen@tdds-gmbz.de (replace z with h, spam protection)
------------------------------
Date: Wed, 9 Feb 2005 09:16:08 -0600
From: "news.socket.net" <info4l@info-for-life.com>
Subject: Regexp::Common question related to URI query
Message-Id: <110ka9pppjh6i83@corp.supernews.com>
I'm using:
use Regexp::Common qw /!delimited/;
and then trying to figure out how to modify this line:
$line =~ s!$RE{URI}{HTTP}{-keep}!<a href="$1">$1</a>!g;
such that it will convert any line that contains a valid URL
to a hyperlinked URL, i.e.
http://www.mysite.com becomes: <a
href="http://www.mysite.com">http://www.mysite.com</a>
Currently, this line of code works, but not if $line contains a query after
the URL, i.e.
http://www.mysite.com?ref=1234
which is erroneously being replaced as:
<a href="http://www.mysite.com">http://www.mysite.com</a>?ref=1234
Any suggestions on how to alter my code (above) would be greatly
appreciated.
Thank you.
Joe Halbrook
------------------------------
Date: Wed, 09 Feb 2005 15:57:40 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Regexp::Common question related to URI query
Message-Id: <UpqOd.13411$ya6.2537@trndny01>
"news.socket.net" <info4l@info-for-life.com> wrote in message
news:110ka9pppjh6i83@corp.supernews.com...
> I'm using:
>
> use Regexp::Common qw /!delimited/;
>
> and then trying to figure out how to modify this line:
>
> $line =~ s!$RE{URI}{HTTP}{-keep}!<a href="$1">$1</a>!g;
>
> such that it will convert any line that contains a valid URL
> to a hyperlinked URL, i.e.
>
> http://www.mysite.com becomes: <a
> href="http://www.mysite.com">http://www.mysite.com</a>
>
> Currently, this line of code works, but not if $line contains a query
after
> the URL, i.e.
>
> http://www.mysite.com?ref=1234
>
> which is erroneously being replaced as:
>
> <a href="http://www.mysite.com">http://www.mysite.com</a>?ref=1234
>
No, it's being correctly replaced. The url you listed is not valid.
The querystring comes after the path part of a URL. You did not give a
path.
http://www.example.com/?ref=1234
is valid
http://www.example.com?ref=1234
is not valid, even if it 'works' in some browser(s). For more
information, see the RFCs mentioned in
http://search.cpan.org/~abigail/Regexp-Common-2.119/lib/Regexp/Common/URI/http.pm#$RE{URI}{HTTP}{-scheme}
> Any suggestions on how to alter my code (above) would be greatly
> appreciated.
I would suggest fixing your data, if at all possible.
Paul Lalli
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 7759
***************************************