in reply to Re: using s///g;
in thread using s///g;

Did you run the OP's code? Did you test your assumption? Obviously not because:

use strict; use warnings; my $filename = 'data.txt'; open DATA, '>', $filename or die "Can't create $filename: $!\n"; print DATA <<STUFF; Stuff written to disk using file handle DATA STUFF close DATA; open my $inFile, '<', 'data.txt' or die "Can't open $filename: $!\n"; print <$inFile>; close $inFile;

Prints:

Stuff written to disk using file handle DATA

which would fail with the OP's error message if you were right. In fact I can't see how you get your implied error of "Can't use DATA in a file open statement" from 'Can't modify constant item in scalar assignment at date.pl line 1, near "10,"'.

Premature optimization is the root of all job security