in reply to Re^2: design the open function
in thread design the open function

I'm not sure if I understand. If you have to open your files with different layers depending on an environment variable, then something like this should do the trick:

open my $in, "<:$ENV{LAYER}", $infile or die $!; open my $out, ">:$ENV{LAYER}", $outfile or die $!; # ...

Of course if you depend like that one an environment variable then you should take care of doing some validation: the above is meant as a minimal example...

PS: it's clear that English is not your mother tongue, it's not mine either: so I suggest you take a deep breath and try to find a good wording to express your questions, because I bet I'm not the only one having difficulties to understand what you mean.

Replies are listed 'Best First'.
Re^4: design the open function
by jhourcle (Prior) on May 10, 2006 at 17:11 UTC

    From my understanding of the problem, he's trying to make changes to a pre-existing script, without wanting to look through and modify the script line by line.

    Depending on the scope of what's being changed, I could see uses for this. (you could also use it for adding some logging to the open function, without having to explicitly do it each time ... useful when debugging).

    For those of us paranoid folks, we might not call the internal open directly, and have a function/method/whatever that gets called, and does whatever error checking / locking / logging / etc, that gets done universally

    (and although I'm not going to claim to know exactly what singam was asking, during my undergrad, I did tech support at a university w/ a fairly large number of non-native english speakers)