473,320 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

help required reg eval qq

Hi All,

Could you please explain the difference b/w the below codes?

when qq is used with eval and without () the o/p is different.

Expand|Select|Wrap|Line Numbers
  1.  
  2. $hex1='\xd1';
  3.  
  4. $conv = eval qq "$hex1";
  5.  
  6. print "CONV IS $conv \n";
  7.  
  8.  
o/p is as follows

CONV IS SCALAR(0x183f1c4)

Expand|Select|Wrap|Line Numbers
  1.  
  2. $hex1='\xd1';
  3.  
  4. $conv = eval qq ("$hex1");
  5.  
  6. print "CONV IS $conv \n";
  7.  
  8.  
o/p is as follows
CONV IS ╤
Jun 19 '08 #1
1 2035
KevinADC
4,059 Expert 2GB
Hi All,

Could you please explain the difference b/w the below codes?

when qq is used with eval and without () the o/p is different.

Expand|Select|Wrap|Line Numbers
  1.  
  2. $hex1='\xd1';
  3.  
  4. $conv = eval qq "$hex1";
  5.  
  6. print "CONV IS $conv \n";
  7.  
  8.  
o/p is as follows

CONV IS SCALAR(0x183f1c4)

Expand|Select|Wrap|Line Numbers
  1.  
  2. $hex1='\xd1';
  3.  
  4. $conv = eval qq ("$hex1");
  5.  
  6. print "CONV IS $conv \n";
  7.  
  8.  
o/p is as follows
CONV IS ╤
In the first example, the double-quotes are the delimiter for the qq operator, so the code is the same as:

Expand|Select|Wrap|Line Numbers
  1. $hex1='\xd1';
  2. $conv = eval $hex1;
  3. print "CONV IS $conv \n";
  4.  
In the second example the () are the delimiter for the qq operator, so the code is the same as:

Expand|Select|Wrap|Line Numbers
  1. $hex1='\xd1';
  2. $conv = eval "\"$hex1\"";
  3. print "CONV IS $conv \n";
  4.  
Jun 19 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Phil Powell | last post by:
I have this line in my code: eval('$field->' . $val . '(' . $max . ',' . $errDisplayArray . ');'); where $field is a predefined class instance, $val is a string containing the name of an...
5
by: aesahab | last post by:
Folks, I'm writing this command: form_name.elements.property_name = action; //action = true/false I want to pass the property_name as dynamic value so if the function passes "disabled" it'll...
1
by: stuart dent via .NET 247 | last post by:
XML validation error. Help required If anyone can help me, thankyou, thankyou... When I run this code code I get this error: The data at the root level is invalid. Line 1, position 39. I...
1
by: Dody Suria Wijaya | last post by:
As I'm adding XMLRPC support in my apps, I'd like to send a module in server to be executed in client. My plan in sending the file content via xmlrpc, and doing compile + eval, but eval just...
11
by: Naeem | last post by:
I have a Javascript function, which changes a text field of a form into a select field. Following is the function function changeStateField() { var myForm =...
3
by: madhumita.iyengar | last post by:
Hi all I am creating a web services application in Visual Studio Dot net which links to a MS SQL database. I need to create a form which lets the user pick his field of choice(doesnt matter...
7
by: Ciaran | last post by:
Can someone please give me a hand with this? $arr=array(2,4,5,6); $test='arr'; echo (eval("$".$test."")); I'm trying to get it to echo 2
4
by: Andrew Bailey | last post by:
Hi, Thanks for taking the time to read this. I would be very grateful if you are able to help me solve the two problems below... PROBLEM 1: I spent a lot of time finding code that would...
2
by: NIKHILUNNIKRISHNAN | last post by:
Hi, My name is Nikhil. I am new to programming.I am obfuscating a C# solution using Dotfuscator. The output of the soultion is a UI along with a setup to install the application. The setup is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.