Solved

string operation II

Posted on 2007-04-09
4
194 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…

713 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