> c:\>perl -wE "say $^V,$^O;$_='123456789';s§3(456)7§$1§;say"
> v5.12.1MSWin32
> 1245689
My equivalent that works is:
perl -wE "use utf8;my \$_='123456789';s§3(456)7§§\$1§;say;"
1245689
If I stop treating this section-sign delimiter as a bracketing delimiter, it
fails:
perl -wE "use utf8;m
> Hm, what platform and perl version?
5.8.8 and 5.12.2 on RHEL, and 5.10.0 on OS X 10.6.
> c:\>perl -Mutf8 -wE
>"say $^V,$^O;$_='123456789';s§3(456)7§$1§;say"
> Malformed UTF-8 character (unexpected continuation byte 0xa7,
> with no preceding start byte) at -e line 1.
Not the same err
>> I don't understand where a window could appear.
>
> On whatever workstation you designate through the DISPLAY environment
> variable.
Aha. Thanks.
> if you can come up with a test for whatever
> bug you are experiencing, it will be invaluable for saving time later.
Given the ease with whic
Thanks much for your various suggestions.
> recommend removing the ampersand from the function call: it is bad practice
> in anything but very old Perl.
Thanks. That deprecation hasn't made it into "man perlsub" yet, except for when
one is using prototyping.
> I would also prefer to lose a few
> Well, I have no idea why it does what it does, but I can tell you how to make
> it work:
> s¶3(456)7¶¶$1¶x;
> s§3(456)7§§$1§x;
Amazing. Thanks very much.
This seems to contradict the documentation. The perlop man page clearly says
that there are exactly 4 bracketing delimiters: "()", "[]", "{
> Are you familiar with the perl debugger?
Thanks much for your reply. I haven't used the debugger, partly because its
documentation describes it as an interactive tool and it's not clear to me how
that works in my context. The script is executed by httpd in response to a
browser form submissio
The perlop document under "s/PATTERN/REPLACEMENT/msixpogce" says "Any
non-whitespace delimiter may replace the slashes."
I take this to mean that any non-whitespace character may be used instead of a
slash.
However, I am finding that some non-whitespace characters cause errors. For
example, us
I'm seeking a strategy for diagnosing a bug that seems difficult to reduce to a
simple reproducible case.
The bug is that a hash element apparently becomes undef. When used as an
argument to "split" or "index", it generates a "Use of uninitialized value"
error.
The mysterious thing about this