Skip to main content
added 1 character in body
Source Link
Ton Hospel
  • 14.9k
  • 1
  • 22
  • 45

#Perl, 24 bytes

Perl, 24 bytes

Includes +2 for -lp

Give input on STDIN:

rev.pl <<< Hello!

rev.pl:

#!/usr/bin/perl -lp
s%.%s/.?/chop/eg;$`%eg

Surprisingly this does not use the builtin reverse operator. That name is just soooo long, all solutions I could think of with reverse are at least 1 byte longer.

#Perl, 24 bytes

Includes +2 for -lp

Give input on STDIN:

rev.pl <<< Hello!

rev.pl:

#!/usr/bin/perl -lp
s%.%s/.?/chop/eg;$`%eg

Surprisingly this does not use the builtin reverse operator. That name is just soooo long, all solutions I could think of with reverse are at least 1 byte longer.

Perl, 24 bytes

Includes +2 for -lp

Give input on STDIN:

rev.pl <<< Hello!

rev.pl:

#!/usr/bin/perl -lp
s%.%s/.?/chop/eg;$`%eg

Surprisingly this does not use the builtin reverse operator. That name is just soooo long, all solutions I could think of with reverse are at least 1 byte longer.

added 74 characters in body
Source Link
Ton Hospel
  • 14.9k
  • 1
  • 22
  • 45

#Perl, 24 bytes

Includes +2 for -lp

Give input on STDIN:

rev.pl <<< Hello!

rev.pl:

#!/usr/bin/perl -lp
s%.%s/.?/chop/eg;$`%eg

Surprisingly this does not use the builtin reverse operator (that. That name is just soooo long), all solutions I could think of with reverse are at least 1 byte longer.

#Perl, 24 bytes

Includes +2 for -lp

Give input on STDIN:

rev.pl <<< Hello!

rev.pl:

#!/usr/bin/perl -lp
s%.%s/.?/chop/eg;$`%eg

Surprisingly this does not use the builtin reverse operator (that name is just soooo long)

#Perl, 24 bytes

Includes +2 for -lp

Give input on STDIN:

rev.pl <<< Hello!

rev.pl:

#!/usr/bin/perl -lp
s%.%s/.?/chop/eg;$`%eg

Surprisingly this does not use the builtin reverse operator. That name is just soooo long, all solutions I could think of with reverse are at least 1 byte longer.

Source Link
Ton Hospel
  • 14.9k
  • 1
  • 22
  • 45

#Perl, 24 bytes

Includes +2 for -lp

Give input on STDIN:

rev.pl <<< Hello!

rev.pl:

#!/usr/bin/perl -lp
s%.%s/.?/chop/eg;$`%eg

Surprisingly this does not use the builtin reverse operator (that name is just soooo long)