Please advise on the small amount of code b/c I am
getting the message as below, but the code is working
and output how I want it, just trying to rid of
messages.
thank you!
Use of uninitialized value in concatenation (.) or
string at
JFS_version_parser.pl line 20, line 952 (#1)
Use of uniniti
On 4/30/07, oryann9 <[EMAIL PROTECTED]> wrote:
Use of uninitialized value in concatenation (.) or
string at
JFS_version_parser.pl line 20, line 952 (#1)
This message happens because some value was undef instead of a string.
From the message, it seems likely that it's a variable being
interp
On 4/30/07, oryann9 <[EMAIL PROTECTED]> wrote:
snip
my $regexp =
qr/(host:\w+)|(onlinejfs.*)|(jfs\sversion.*)/is;
snip
Why are you creating this regex so far from where it is being used?
Why are you using three captures when this expression can only return one?
snip
if (/$regexp/) {
oryann9 wrote:
> Please advise on the small amount of code b/c I am
> getting the message as below, but the code is working
> and output how I want it, just trying to rid of
> messages.
>
> thank you!
>
>
> Use of uninitialized value in concatenation (.) or
> string at
> JFS_version_parser.pl li
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> my @a = qw(abc def ghi);
>
> for my $s (@a) {
> $s =~ /(b)|(e)|(h)/;
> print "1 => [$1] 2 => [$2] 3 => [$3]\n";
> }
>
Thank you for the kind replies. I understand now and
have modified the code to:
use strict;
use warnings
On 5/1/07, oryann9 <[EMAIL PROTECTED]> wrote:
snip
my $regexp = qr/(host:\w+)/is;
my $regexp1 = qr/(onlinejfs.*)/is;
my $regexp2 = qr/(jfs\sversion.*)/is;
snip
Why are you creating these regexes so far from where they are used?
If you are going to do this at least give them meaningful names.
> > Why are you creating these regexes so far from
> where
> > they are used?
> > If you are going to do this at least give them
> > meaningful names.
I dont have a good reason Chas other than I like the
ability to easily change the variable in one spot in
case of future use.
If this is not a goo