Solved

filehandle explanation needed

Posted on 2007-11-14
3
174 Views
Last Modified: 2010-03-05
Please consider following perl code:

if( @ARGV ) {
    $out = shift(@ARGV);
}

open(OUT, ">$out");

The argument passed is C:\some_dir\some_file
Does OUT have any relation to $out.  Does anything get written to some_file in the "open" statement.  What is the "open" statement doing?
0
Comment
Question by:naseeam
3 Comments
 
LVL 28

Assisted Solution

by:FishMonger
FishMonger earned 200 total points
Comment Utility
The doc on the open function should answer your homework question.

perldoc -f open
0
 

Author Comment

by:naseeam
Comment Utility
BTW, it's not a homework question. I'm not in school.
0
 
LVL 48

Accepted Solution

by:
Tintin earned 300 total points
Comment Utility
Think of a filehandle as a reference to a physical file (not always the case).

FishMonger's suggestion and running your script should answer your other questions.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Perl for loop for 2000 ms 7 91
Port 80 requests 16 79
add a syntax to a csv file 8 91
How to generate square thumbnail using perl 13 68
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…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

762 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

11 Experts available now in Live!

Get 1:1 Help Now