Thread: Hi
View Single Post
  #2 (permalink)  
Old September 2nd, 2009, 12:03 PM
om_prakash om_prakash is offline
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please check the following URL:
http://perldoc.perl.org/functions/open.html

Code:
  1. # process argument list of files along with any includes
  2. foreach $file (@ARGV) {
  3. process($file, 'fh00');
  4. }
  5. sub process {
  6. my($filename, $input) = @_;
  7. $input++; # this is a string increment
  8. unless (open($input, $filename)) {
  9. print STDERR "Can't open $filename: $!\n";
  10. return;
  11. }
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.