Solved

string operation II

Posted on 2007-04-09
4
166 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now