ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* wrong patch
@ 2004-06-01 19:19 Hans Hagen
  2004-06-01 21:33 ` Nikolai Weibull
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2004-06-01 19:19 UTC (permalink / raw)


Hi,

The previous post was wrong; I was playing with write tests recently and 
send an old fragment; the right one is:

sub RunFiles {
my $currentpath = cwd() ;
# test if current path is writable
if (! -w "$currentpath") {
     print " current path readonly : $currentpath\n";
     if ($ENV["TEMP"] && -e $ENV["TEMP"]) {
         $RunPath = $ENV["TEMP"] ;
     } elsif ($ENV["TMP"] && -e $ENV["TMP"]) {
         $RunPath = $ENV["TMP"] ;
     }
}
# test if we need to change paths
if (($RunPath ne "") && (-w "$RunPath")) {
     print "      changing to path : $RunPath\n";
     $InpPath = $currentpath ;
     chdir ($RunPath) ;
}
# start working
     if ($PdfArrange) {


Hans


-------------------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE/POD/CTS
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: wrong patch
  2004-06-01 19:19 wrong patch Hans Hagen
@ 2004-06-01 21:33 ` Nikolai Weibull
  2004-06-02  8:09   ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Nikolai Weibull @ 2004-06-01 21:33 UTC (permalink / raw)


* Hans Hagen <pragma@wxs.nl> [Jun 01, 2004 21:30]:
>     if ($ENV["TEMP"] && -e $ENV["TEMP"]) {
>         $RunPath = $ENV["TEMP"] ;
>     } elsif ($ENV["TMP"] && -e $ENV["TMP"]) {
>         $RunPath = $ENV["TMP"] ;
>     }

Just checking, aren't the []'s supposed to be {}'s.  $ENV is a hash and
this is Perl, so that's the proper way to do it right?  I know you use
Ruby as well, so my guess is that you transposed Rubyisms onto Perl?
	nikolai

--
::: name: Nikolai Weibull    :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA    :: loc atm: Gothenburg, Sweden    :::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re: wrong patch
  2004-06-01 21:33 ` Nikolai Weibull
@ 2004-06-02  8:09   ` Hans Hagen
  2004-06-02 17:50     ` Henning Hraban Ramm
  2004-08-12  8:44     ` Christopher Creutzig
  0 siblings, 2 replies; 5+ messages in thread
From: Hans Hagen @ 2004-06-02  8:09 UTC (permalink / raw)


At 23:33 01/06/2004, you wrote:
>* Hans Hagen <pragma@wxs.nl> [Jun 01, 2004 21:30]:
> >     if ($ENV["TEMP"] && -e $ENV["TEMP"]) {
> >         $RunPath = $ENV["TEMP"] ;
> >     } elsif ($ENV["TMP"] && -e $ENV["TMP"]) {
> >         $RunPath = $ENV["TMP"] ;
> >     }
>
>Just checking, aren't the []'s supposed to be {}'s.  $ENV is a hash and
>this is Perl, so that's the proper way to do it right?  I know you use
>Ruby as well, so my guess is that you transposed Rubyisms onto Perl?

indeed -)

interestingly perl does not complain, which is one more reason to go ruby

thanks

Hans

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: wrong patch
  2004-06-02  8:09   ` Hans Hagen
@ 2004-06-02 17:50     ` Henning Hraban Ramm
  2004-08-12  8:44     ` Christopher Creutzig
  1 sibling, 0 replies; 5+ messages in thread
From: Henning Hraban Ramm @ 2004-06-02 17:50 UTC (permalink / raw)



Am Mittwoch, 02.06.04, um 10:09 Uhr (Europe/Zurich) schrieb Hans Hagen:
>> >     if ($ENV["TEMP"] && -e $ENV["TEMP"]) {
>> >         $RunPath = $ENV["TEMP"] ;
>> >     } elsif ($ENV["TMP"] && -e $ENV["TMP"]) {
>> >         $RunPath = $ENV["TMP"] ;
>> >     }
> interestingly perl does not complain, which is one more reason to go 
> ruby

Do you
use warnings;
use strict;
?



Grüßlis vom Hraban!
-- 
http://www.fiee.net/texnique/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re: wrong patch
  2004-06-02  8:09   ` Hans Hagen
  2004-06-02 17:50     ` Henning Hraban Ramm
@ 2004-08-12  8:44     ` Christopher Creutzig
  1 sibling, 0 replies; 5+ messages in thread
From: Christopher Creutzig @ 2004-08-12  8:44 UTC (permalink / raw)


Hans Hagen wrote:

>> >         $RunPath = $ENV["TEMP"] ;

> interestingly perl does not complain, which is one more reason to go ruby

  Why should it complain?  Just because you hadn't set @ENV? :-)

  (Having $ENV, %ENV, and @ENV be three unrelated variables is a good 
reason to go from Perl to $otherlanguage, indeed.)

regards,
	Christopher

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-08-12  8:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-01 19:19 wrong patch Hans Hagen
2004-06-01 21:33 ` Nikolai Weibull
2004-06-02  8:09   ` Hans Hagen
2004-06-02 17:50     ` Henning Hraban Ramm
2004-08-12  8:44     ` Christopher Creutzig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).