$bib =~ s{(Location:</th><td>)\s?(wsl)}{$1 Workshop Research Library}isg;
I added the line
if ($bib =~ m{(Location:</th><td>)\s?(wsl)}is) {print STDERR "$1$2\n";}
to my script to confirm that the expression truly is matching what it's supposed to, and the output I get with that line in place looks like the expression works. Can anyone help me figure out why the substitution doesn't work?
-dingman
Have you tried it from the prompt?
Would you mind posting some more code surrounding the problematic line?
Are you sure that $bib contains the same string when you try the substitution and when you do the matching?
Since my code was working for me on my box IŽm assuming the error must be somewhere else.
What perl version are you running?
I should also have been a bit more clear that some of the occurances have a <br> after wsl in the original $bib - hence the fact that I was not matching on anything after wsl. I don't have much control over the input, so I have to just deal with that.
-dingman
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
Platform:
osname=linux, osvers=2.2.17-8smp, archname=i386-linux
uname='linux porky.devel.redhat.com 2.2.17-8smp
#1 smp fri nov 17 16:12:17 est 2000 i686 unknown '
config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686
-Dcc=gcc -Dcccdlflags=-fPIC -Dinstallprefix=/usr
-Dprefix=/usr -Darchname=i386-linux -Dd_dosuid
-Dd_semctl_semun -Di_db -Di_ndbm -Di_gdbm -Di_shadow
-Di_syslog -Dman3ext=3pm -Uuselargefiles'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=undef
use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
Compiler:
cc='gcc', optimize='-O2 -march=i386 -mcpu=i686', gccversion=2.96 20000731
(Red Hat Linux 7.1 2.96-78)
cppflags='-fno-strict-aliasing'
ccflags ='-fno-strict-aliasing'
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=4
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -ldl -lm -lc -lcrypt
libc=/lib/libc-2.2.so, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'Characteristics of this binary (from libperl):
Compile-time options:
Built under linux
Compiled at Apr 3 2001 11:27:33
@INC:
/usr/lib/perl5/5.6.0/i386-linux
/usr/lib/perl5/5.6.0
/usr/lib/perl5/site_perl/5.6.0/i386-linux
/usr/lib/perl5/site_perl/5.6.0
/usr/lib/perl5/site_perl
.
$entry = "<html>\n\t<head>\n\t\t<title> $author\t$date\t$title</title>";
$entry .= "<link rel=\"stylesheet\" type=\"text/css\" ";
$entry .= "href=\"http://www.indiana.edu/~iascp/CSS/cprbib.css\">\n\t</head>\n";
$entry .= "\t<body>\n<table>\n$bib\n</table>\n</body>\n<!-- EndLogicalDocument -->\n";
return $entry;
}
I'll hapily post the whole 9k script somewhere you can download it if you're interested.
-dingman
I just tested the substitution with perl 5.6.1 for Windows and it was working as well.
If youŽd send me the script using the address in my profile I'll gladly try to run your script either as a stand alone script or mod_perl module.
Andreas