T tim85a New member Jun 12, 2009 #1 I want to get perl to make the file using $input as the name so if 'name' was saved as $input the file would be called 'name.txt' I've got it like this at the mo: open FILE, ">'$input'.txt" or die $!; but its not working anyone got any ideas?
I want to get perl to make the file using $input as the name so if 'name' was saved as $input the file would be called 'name.txt' I've got it like this at the mo: open FILE, ">'$input'.txt" or die $!; but its not working anyone got any ideas?
M martinthurn New member Jun 12, 2009 #2 1. Use the three-argument version of open. 2. Use double-quotes to interpolate variables into strings. open FILE, q{>}, qq{$input.txt} or die $!;
1. Use the three-argument version of open. 2. Use double-quotes to interpolate variables into strings. open FILE, q{>}, qq{$input.txt} or die $!;