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

  • SEARCH
  • Home
  • 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 8662469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:44:33+00:00 2026-06-12T16:44:33+00:00

Under use strict; use warnings; my $foo = undef; the expressions $foo . ”

  • 0

Under

use strict;
use warnings;
my $foo = undef;

the expressions

$foo . ''

and

"$foo"

both produce

Use of uninitialized value $foo in ... at ...

but the following expression gives the empty string without warning:

$foo x 1

Anyone knows why? I mean, it’s cool to have a nice stringification idiom ($_ x 1 is quite much shorter than defined ? "$_" : ''), but it feels a bit weird.

  • 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-12T16:44:33+00:00Added an answer on June 12, 2026 at 4:44 pm

    I once saw a show with a scene in a law school class. The instructor presented two similar cases to his students and asked why did they result in different rulings. It’s because the rulings were made by judges, and judges are people, he eventually explained.

    That should warn. The developers that work on Perl are people. Run perlbug to send a bug report if you wish.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

use strict; use warnings; use Data::Dumper; my %h; my $undef = undef; $h{''}='test2'; $h{$undef}
Given this code: #!/usr/bin/perl -w use strict; use warnings; sub foo { return wantarray
The following code #!/usr/bin/perl use strict; use warnings; my $s1 = 'aaa2000@yahoo.com'; my $s2
I have the following code: #!/usr/bin/env perl use strict; use warnings; use feature 'say';
My first Role is the following one: package AccBack::RTransaction; use strict; use warnings; use
I use the following XPATH Query to list the object under a site. ListObject[@Title='SomeValue']
Under Mac OS, i could use GetCurrentProcess and GetNextProcessInfo to get process infos. But
I have this piece of script : #!/usr/bin/perl use strict; use warnings; use Data::Dumper;
I am using Perl library HTTP::Async as follows: use strict; use warnings; use HTTP::Async;
I'm trying to use PHP in the terminal under MAMP but I got an

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.