Skip to content

Instantly share code, notes, and snippets.

@msztolcman
Created February 5, 2013 18:09
Show Gist options
  • Save msztolcman/4716388 to your computer and use it in GitHub Desktop.
Save msztolcman/4716388 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use 5.016;
# via: http://www.linuxquestions.org/questions/programming-9/perl-vs-python-which-is-easier-to-learn-857758/#post4233698
# s="a string"
# s = s[1:-1].replace("s","S")[0:-2]
# print ('>{0}<'.format (s))
my $s = 'a string';
$s = substr ($s =~ s/.(.*)./$1/r =~ y/s/S/r, 0, -2);
say ">$s<";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment