#!/usr/bin/perl use strict; use warnings; my $folder = $ARGV[0]; my $output = 'C:\Users\AndreyT\Desktop\tee.txt'; foreach(glob "$folder\*.nfo"){ use_contents($_); } sub use_contents{ my $filename = shift; open my $fh, '<$filename' or die "Can't open $filename: $!"; open my $dat1, '>$output' or die "\nERROR: Cannot create/open $out +put\n"; while(<$fh>){ print $dat1 $_;} close ($fh); close ($dat1); }
This code doesn't working
I'm trying to open a file from a folder and write the content into another file
What i'm doing wrong?
Thanks in advance
In reply to open file and write the content into another file by cesapun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |