[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

open statement help needed

Posted on 2007-11-20
4
Medium Priority
?
190 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
ID: 20320896
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
 
LVL 1

Author Comment

by:naseeam
ID: 20320978
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 2000 total points
ID: 20321086
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
 
LVL 1

Author Closing Comment

by:naseeam
ID: 31410143
Quick Response.  Almost Immediate.  
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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 …
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…
Six Sigma Control Plans
Suggested Courses

872 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