sub strip_space { s/\s//g for @_; 1; } my $test = "this will have no spaces!"; strip_space($test); print $test,$/; __END__ thiswillhavenospaces! #### # strip_space("this will have no spaces!"); # modification of constant error