in reply to How come I cannot delete file with unlink
my $FileName = "jimbo"; my $t = ".tm"; print $FileName$t; # this just wont work - what you REALLY want is my $fullFileName = $FileName . $t; # the . joins them together - calle +d "concatenation" - do a PM search on this keyword print $fullFileName; # prints 'jimbo.tm'
unlink ($fullFileName) or die "Error! : $!\n"; # die statements will kill the program if an error is encountered. # the error msg is contained in $! special variable and is printed # on exit
|
|---|