Solved

string operation II

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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 …
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…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

919 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

16 Experts available now in Live!

Get 1:1 Help Now