Solved

open statement help needed

Posted on 2007-11-20
4
170 Views
Last Modified: 2010-04-21
In the following code, what does open TEMP do?  Is TEMP a file.  ddump dumps the debugging information.  Is it dumped in the TEMP file.  If TEMP is created, in which directory can I find it?

open TEMP, "$ddump -D $elf|" or die("\nError dumping file!\n");
0
Comment
Question by:naseeam
  • 2
  • 2
4 Comments
 
LVL 39

Expert Comment

by:Adam314
Comment Utility
In this case, open will run the command "$ddump -D $elf", and create a filehandle named TEMP as a pipe from that program.
When your program reads from TEMP, it will be reading the output from the $ddump program.
0
 

Author Comment

by:naseeam
Comment Utility
I thought there is a file coupled with every file handle.  Which file goes with TEMP filehandle.  
It looks like the output of ddump program are stored in TEMP filehandle, instead of a file.
Am I understanding this correctly?

Thanks.
0
 
LVL 39

Accepted Solution

by:
Adam314 earned 500 total points
Comment Utility
From the documentation for open:
    http://perldoc.perl.org/functions/open.html
"if the filename ends with a '|' , the filename is interpreted as a command which pipes output to us"

So, in this case there is no actual file.
The output from ddump is stored in the TEMP filehandle - you are correct on this part.
0
 

Author Closing Comment

by:naseeam
Comment Utility
Quick Response.  Almost Immediate.  
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

772 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

14 Experts available now in Live!

Get 1:1 Help Now