Problem using some delimiters in s///x

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am using Perl 5.8.5 in which there seems to be problem w/ some
delimiters in s///.  If not_ok* subs are uncommented (or equivalent
statements are used elsewhere), perl quits w/ the following error

  Substitution replacement not terminated at \
  <file name> line <line number>.

Below is small test program...

  #  'polka' should be transformed to 'PeeOLCa' if not_ok* subs & their
  #  usage are not commented
  use warnings;
  use strict;
  my $p = 'polka';



  print $p;

  sub ok_bra { $p =~ s /C/x; }
  sub ok_par { $p =~ s(p) /Pee/x; }

  #sub not_ok_ex  { $p =~ s!o! /O/x; }
  #sub not_ok_com { $p =~ s,l, /L/x; }

Perl version...

  Summary of my perl5 (revision 5 version 8 subversion 5) configuration:
      osname=freebsd, osvers=4.9-release-p11, archname=i386-freebsd-64int
      uname='freebsd moo.holy.cow 4.9-release-p11 freebsd 4.9-release-p11 #4:
thu jul 1 23:37:18 edt 2004 root@moo.holy.cow:miscsrc-4.9sysbovine i386 '
      config_args='-sde -Dprefix=/misc/local
-Darchlib=/misc/local/lib/perl5/5.8.5/mach -Dprivlib=/misc/local/lib/perl5/5.8.5
-Dsitelib=/misc/local/lib/perl5/site_perl/5.8.5 -Dscriptdir=/misc/local/bin
-Dsiteman1dir=/misc/local/man/man1 -DDEBUGGING -Ui_malloc -Ui_iconv
-Uinstallusrbinperl -Dcc=cc -Doptimize=-O -pipe -g -march=pentiumpro
-Duseshrplib -Dccflags=-DAPPLLIB_EXP="/misc/local/lib/perl5/5.8.5/BSDPAN"
-Ud_dosuid -Di_gdbm -Dusethreads=n -Dusemymalloc=y -Duse64bitint'
      hint=recommended, useposix=true, d_sigaction=define
      usethreads=undef use5005threads=undef useithreads=undef
      useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
      use64bitint=define use64bitall=undef uselongdouble=undef
      usemymalloc=y, bincompat5005=undef
      cc='cc', ccflags ='-DAPPLLIB_EXP="/misc/local/lib/perl5/5.8.5/BSDPAN"
      optimize='-O -pipe -g -march=pentiumpro',
      ccversion='', gccversion='2.95.4 20020320 [FreeBSD]', gccosandvers=''
      intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
      d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
      ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
      alignbytes=4, prototype=define
    Linker and Libraries:
      ld='cc', ldflags ='-Wl,-E  -L/usr/local/lib'
      libpth=/usr/lib /usr/local/lib
      libs=-lgdbm -lm -lcrypt -lutil -lc
      perllibs=-lm -lcrypt -lutil -lc
      libc=, so=so, useshrplib=true,
    Dynamic Linking:
      dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='
      cccdlflags='-DPIC -fPIC', lddlflags='-shared  -L/usr/local/lib'

  Characteristics of this binary (from libperl):
    Compile-time options: DEBUGGING USE_64_BIT_INT USE_LARGE_FILES
    Built under freebsd
    Compiled at Aug 14 2004 20:35:57

Re: Problem using some delimiters in s///x

NNTP-Posting-Date: Tue, 07 Sep 2004 00:32:29 -0500
Newsgroups: comp.lang.perl.misc
Subject: Re: Problem using some delimiters in s///x
User-Agent: slrn/ (FreeBSD)
Date: Tue, 07 Sep 2004 00:32:29 -0500
Lines: 55
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint
X-Postfilter: 1.3.13
Xref: core-easynews comp.lang.perl.misc:421278

Site Timeline