#!perl -w use strict; # Always! # Call method foo like this: # my @results = foo( $arg1, \%hash ); # foo in array context sub foo { my ( $arg, $hashref ) @_; $arg =~ m/some regex # with true embedded comments on multiple lines/x; $arg =~ m/some regex with a # sign in it./; $arg =~ m/some regex with a ; # combo in it./; my $result1 = "a string with; # in it"; my $result2 = q; # nasty!;; # this comment has ' ' as the first char. return ( $result1, $result2 ) # no semi-colon! }