Solved

string operation II

Posted on 2007-04-09
4
184 Views
Last Modified: 2010-03-05
I am using :
@string =  ('0x01');
$string[2] = ('0x03');
$string[3] = ('0x04');

local $"=",";
$string_value = "{0x05,0x06,@string}";
print $string_value;

Output :
{0x05,0x060x01,,0x03,0x04}  # I am getting 2 single quotes
           
With Warning :
use of uninitialize value in join or string
0
Comment
Question by:gauravflame
  • 2
  • 2
4 Comments
 

Author Comment

by:gauravflame
ID: 18880656
any comments
0
 
LVL 84

Accepted Solution

by:
ozo earned 125 total points
ID: 18880665
You did not define $string[1] so there is an empty string where it would go
0
 

Author Comment

by:gauravflame
ID: 18880691
That's right ...
0
 
LVL 84

Expert Comment

by:ozo
ID: 18880699
and since it is undefined, trying to use it in join$",@string gives a warning
splain                                            
/usr/bin/splain: Reading from STDIN
Use of uninitialized value in join or string
Use of uninitialized value in join or string (#1)
    (W uninitialized) An undefined value was used as if it were already
    defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.
   
    To help you figure out what was undefined, perl tells you what operation
    you used the undefined value in.  Note, however, that perl optimizes your
    program and the operation displayed in the warning may not necessarily
    appear literally in your program.  For example, "that $foo" is
    usually optimized into "that " . $foo, and the warning will refer to
    the concatenation (.) operator, even though there is no . in your
    program.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question