develooper Front page | perl.vmsperl | Postings from February 2002

Re: Confused about open/append failure

Thread Previous | Thread Next
Dan Sugalski
February 1, 2002 00:30
Re: Confused about open/append failure
Message ID:
On Thu, 31 Jan 2002, Alan Winston - SSRL Central Computing wrote:

> VMS Perl people --
> I can open a file for append from DCL but can't open it from Perl.  
> I'd like to know both "how come" and how I can get a more useful status from
> Perl about why.  No doubt this is a baby question, but it seems like a
> VMS-related one. 
> $ perl
> open LOG, ">> $9$dka0:[reqs_log]reqs.log" or die "couldn't open it";

Perl, does scalar and array variable interpolation inside of double-quoted
strings. The $9 and $dka are getting replaced before the file's
opened. Either single-quote the filename, or backwhack the dollar signs.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About