Skip to main content
edited body
Source Link
Ton Hospel
  • 15k
  • 1
  • 24
  • 45

Perl, 24 23 bytes

Includes +1 for -p

Give string on STDIN without newline (or add a -pl option to the program)

echo -n Hello | nest.pl

nest.pl:

#!/usr/bin/perl -p
$\=")"x s/.(?=.)/$&(/g

Perl, 24 23 bytes

Includes +1 for -p

Give string on STDIN without newline (or add a -p option to the program)

echo -n Hello | nest.pl

nest.pl:

#!/usr/bin/perl -p
$\=")"x s/.(?=.)/$&(/g

Perl, 24 23 bytes

Includes +1 for -p

Give string on STDIN without newline (or add a -l option to the program)

echo -n Hello | nest.pl

nest.pl:

#!/usr/bin/perl -p
$\=")"x s/.(?=.)/$&(/g
added 73 characters in body
Source Link
Ton Hospel
  • 15k
  • 1
  • 24
  • 45

Perl, 2424 23 bytes

Includes +2+1 for -lpp

Give string on STDIN: without newline (or add a -p option to the program)

nest.plecho <<<-n Hello | nest.pl

nest.pl:

#!/usr/bin/perl -lpp
$\=")"x s/.(?=.)/$&(/g

Perl, 24 bytes

Includes +2 for -lp

Give string on STDIN:

nest.pl <<< Hello

nest.pl:

#!/usr/bin/perl -lp
$\=")"x s/.(?=.)/$&(/g

Perl, 24 23 bytes

Includes +1 for -p

Give string on STDIN without newline (or add a -p option to the program)

echo -n Hello | nest.pl

nest.pl:

#!/usr/bin/perl -p
$\=")"x s/.(?=.)/$&(/g
Source Link
Ton Hospel
  • 15k
  • 1
  • 24
  • 45

Perl, 24 bytes

Includes +2 for -lp

Give string on STDIN:

nest.pl <<< Hello

nest.pl:

#!/usr/bin/perl -lp
$\=")"x s/.(?=.)/$&(/g