Skip to content

Instantly share code, notes, and snippets.

@andrewsolomon
Created May 21, 2017 20:21
Show Gist options
  • Save andrewsolomon/846b83370c3c315858a069cce07313f9 to your computer and use it in GitHub Desktop.
Save andrewsolomon/846b83370c3c315858a069cce07313f9 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use feature 'say';
sub modify_string_exclaim {
my ($r_str) = @_;
$$r_str .= '!';
return 1;
}
my $sc = 'Hello';
say $sc; # Output: Hello
modify_string_exclaim(\$sc);
say $sc; # Output: Hello!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment