Question: I have an ASCII-art box and I need a program to open it.

Examples
--------

Input:

```
-------
|     |
|_____|

```

Output:

```
      /
     /
    /
   /
  /
 /
/
|     |
|_____|

```

Specification
=============

* The first line will only consist of `-`, at least 3 of them
* The middle rows will start with `|` have spaces, and end with `|`
	+ All the middle rows will be the same
* The last row will start with `|` have `_` and end with a `|`
* All rows will be the same length

Opening the box:

* Each `-` should be replaced by a `/` in ascending lines and position.

Answer: 
**Perl, 61 54 33 + 3 = 36 characters**
--------------------------------------

```
s^-^" "x(length$')."/\n"^ge&chomp

```

Run it as

```
perl -ple 's^-^" "x(length${chr 39})."/\n"^ge&chomp' closed_box_file

```

Each `-` in first line is replaced by a string that is a result of concatenation of some number of , `/` and `\n`. `${chr 39}` evaluates to perl's (in)famous `$'` aka `$POSTMATCH` special variable. Lastly, chomp gets rid of the trailing newline character that was added for the last `-` character.

Thanks to @manatwork for saving 7 + more characters.

**Bonus** - `s^-^" "x$i++."\\\n"^ge&&chop` opens the box from the right edge in 29 + 3 characters :). Run it as:

```
gowtham@ubuntu:~$ cat a
----
|  |
|__|
gowtham@ubuntu:~$ perl -plE 's^-^" "x$i++."\\\n"^ge&&chop' closed_box_file
\
 \
  \
   \
|  |
|__|

```
[Vyxal](https://github.com/Lyxal/Vyxal), 16 bytes
=================================================

```
L:£(&‹¥\/꘍,)□Ḣ⁋,

```

[Try it Online!](http://lyxal.pythonanywhere.com?flags=&code=L%3A%C2%A3%28%26%E2%80%B9%C2%A5%5C%2F%EA%98%8D%2C%29%E2%96%A1%E1%B8%A2%E2%81%8B%2C&inputs=----%0A%7C%20%20%7C%0A%7C__%7C&header=&footer=)