Re: using a CONSTANT as a pathname

2003-06-02 Thread Tassilo von Parseval
On Sun, Jun 01, 2003 at 08:36:34PM -0400 Todd Wade wrote: > "Tassilo Von Parseval" <[EMAIL PROTECTED]> wrote in > message news:[EMAIL PROTECTED] > > On Sun, Jun 01, 2003 at 11:22:32AM +0200 Kevin Pfeiffer wrote: > > > > > > > open DATA, ">@{[ CFG ]}" or die ...; > > > > The part between @{[ ]

Re: using a CONSTANT as a pathname

2003-06-02 Thread Todd Wade
"Tassilo Von Parseval" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sun, Jun 01, 2003 at 11:22:32AM +0200 Kevin Pfeiffer wrote: > > > open DATA, ">@{[ CFG ]}" or die ...; > > The part between @{[ ]} is arbitry Perl-code that is executed in list > context and the last expre

Re: using a CONSTANT as a pathname

2003-06-02 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Wc -Sx- Jones wrote: > > On Sunday, June 1, 2003, at 05:22 AM, Kevin Pfeiffer wrote: > >> use constant CFG => qq|$ENV{'HOME'}/.get_quiz|; > > > Well, you could convert it back to a variable prior to use: [...] I would have been happy to have used a variable i

Re: using a CONSTANT as a pathname

2003-06-01 Thread WC -Sx- Jones
On Sunday, June 1, 2003, at 05:22 AM, Kevin Pfeiffer wrote: use constant CFG => qq|$ENV{'HOME'}/.get_quiz|; Well, you could convert it back to a variable prior to use: #!perl -w use strict; use diagnostics; use constant CFG => qq|$ENV{'HOME'}/.get_quiz|; my $whichfile = CFG; open OFILE, ">$

Re: using a CONSTANT as a pathname

2003-06-01 Thread Rob Dixon
Tassilo Von Parseval wrote: > On Sun, Jun 01, 2003 at 01:13:31PM +0200 Kevin Pfeiffer wrote: > > > > I almost asked about this earlier - if a script can also write to > > itself. I wrote something to test it, but haven't had time to > > look up the seek functions, etc. I suppose this only makes sen

Re: using a CONSTANT as a pathname

2003-06-01 Thread Tassilo von Parseval
On Sun, Jun 01, 2003 at 01:13:31PM +0200 Kevin Pfeiffer wrote: > Hi Tassilo, Hi there, > In article <[EMAIL PROTECTED]>, Tassilo Von Parseval wrote: > > if your Perl is recent enough (>= 5.6.0). Or you use the > > interpolate-anything trick: > > > > open DATA, ">@{[ CFG ]}" or die ...; > >

Re: using a CONSTANT as a pathname

2003-06-01 Thread Kevin Pfeiffer
Hi Tassilo, In article <[EMAIL PROTECTED]>, Tassilo Von Parseval wrote: > On Sun, Jun 01, 2003 at 11:22:32AM +0200 Kevin Pfeiffer wrote: > >> More problems trying to use constants... >> >> I have: >> >> use constant CFG => qq|$ENV{'HOME'}/.get_quiz|; >> >> >> But I can't see how to make this

Re: using a CONSTANT as a pathname

2003-06-01 Thread Tassilo von Parseval
On Sun, Jun 01, 2003 at 11:22:32AM +0200 Kevin Pfeiffer wrote: > More problems trying to use constants... > > I have: > > use constant CFG => qq|$ENV{'HOME'}/.get_quiz|; > > > But I can't see how to make this work: > > open DATA, "> CFG" or die "Couldn't open ", CFG, " for writing: $!\n"; >