Jim Gibson wrote:
At 7:22 PM -0700 9/2/09, Noah Garrett Wallach wrote:
Hi there,
what is the way to collapse this search/replace to one line?
my $filename_cmd = $cmd[-1];
my $filename_cmd =~ s/\s/\./;
(my $filename_cmd = $cmd[-1]) =~ s/\s/\./;
thanks,
okay a step further - is there a way to make the following a one liner?
(my $filename_cmd = $cmd[-1]) =~ s/\|//g;
$filename_cmd =~ s/\s+/\./g;
$filename_cmd =~ s/save.*//g;
Cheers,
Noha
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/