lightoverhead has asked for the wisdom of the Perl Monks concerning the following question:
reuslts:#!/usr/bin/perl -w use strict; my $chr; $chr = "this and that"; $chr =~ s/(this|that)|(\w+)/$1\U$2/g; #error reported print "$chr\n";
this AND that
But it reported error message:
Use of uninitialized value in concatenation (.) or string at test.pl line 5.
I don't known why it reported an error at line 5, since $chr was already declared.
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: why such an error happened?
by McDarren (Abbot) on Oct 20, 2008 at 01:08 UTC | |
by lightoverhead (Pilgrim) on Oct 20, 2008 at 01:16 UTC | |
by Lawliet (Curate) on Oct 20, 2008 at 01:21 UTC | |
by lightoverhead (Pilgrim) on Oct 20, 2008 at 01:39 UTC | |
by CountZero (Bishop) on Oct 20, 2008 at 05:23 UTC | |
by Lawliet (Curate) on Oct 20, 2008 at 01:55 UTC | |
| |
by JavaFan (Canon) on Oct 20, 2008 at 09:36 UTC | |
|
Re: why such an error happened?
by GrandFather (Saint) on Oct 20, 2008 at 01:36 UTC | |
|
Re: why such an error happened?
by krusty (Hermit) on Oct 20, 2008 at 01:44 UTC | |
|
Re: why such an error happened?
by pobocks (Chaplain) on Oct 20, 2008 at 05:37 UTC | |
|
Re: why such an error happened?
by Anonymous Monk on Oct 20, 2008 at 09:24 UTC | |
|
Re: why such an error happened?
by AnomalousMonk (Archbishop) on Oct 20, 2008 at 14:38 UTC |