Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8508707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:14:02+00:00 2026-06-11T03:14:02+00:00

The following code: #!/usr/bin/env perl use utf8; use strict; use warnings; use 5.012; #

  • 0

The following code:

#!/usr/bin/env perl
use utf8;
use strict;
use warnings;
use 5.012; # implicitly turn on feature unicode_strings
my $test = "some string";
$test =~ m/.+\x{2013}/x;

Yields:

Use of uninitialized value $test in pattern match (m//) at test.pl line 9.

This seems to happen with any 2-byte character inside \x{}. The following regexes work fine:

/a+\x{2013}/
/.*\x{2013}/
/.+\x{20}/

Also, the error goes away with use bytes, but using that pragma is discouraged. What’s going on here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T03:14:04+00:00Added an answer on June 11, 2026 at 3:14 am

    It is singular that you should ask this question. I looks related to a bug that I just reported yesterday

    https://rt.perl.org/rt3/Ticket/Display.html?id=114808

    where this code also produces "Use of uninitialized value $_ in split ..." warnings, and causes split to unexpectedly return an empty list:

    use warnings;
    binmode *STDOUT, ":encoding(UTF-8)";
    my $pattern = "\x{abc}\x{def}ghi";
    for ( "\x{444}", "norm\x{a0}l", "\x{445}", "ab\x{ccc}de\x{fff}gh" ) {
      print "--------------------\ntext is $_, pattern is /$pattern/\n";
    
      # expect  split  to return  ($_) , but when $pattern and $_ both
      # have wide chars, it returns  ()
      print 'split output is [', split /$pattern/, $_;
    
      print "]\n";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: #!/usr/bin/env perl use strict; use warnings; use feature 'say';
the following code #!/usr/bin/env perl use strict; use warnings; my @foo = (0,1,2,3,4); foreach
I have a question with the following Code: #!/usr/bin/perl use strict; use warnings; my
Consider the following code and its output: Code #!/usr/bin/perl -w use strict; use Data::Dumper;
I have the following code #!/usr/bin/perl use Tie::File; tie my @last_id, 'Tie::File', 'last_id.txt' or
Given the following code #!/usr/bin/perl use Data::Dumper; my %hash; my @colos = qw(ac4 ch1
I have the following code: #!/usr/bin/env perl for ($str = <>; $str != '`';
I am getting this error when I run the following code: #!/usr/bin/env ruby -rubygems
I have the following code: #!/usr/bin/env python import sys from PyQt4 import QtGui, QtCore
The following code: #!/usr/bin/env python import mechanize class MechanizeSubclass(mechanize.Browser): def __init__(self, factory=None, history=None, request_class=None,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.