Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

string operation II

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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…
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…

828 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