From: Noah Garrett Wallach <noah-l...@enabled.com>
> 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;

There's no point in making it a one liner. Plus anything may be 
writen as a oneliner in Perl ... it would just be a long line in some 
cases.

In this case I'd write this as:

my $filename_cmd = $cmd[-1];
for ($filename_cmd) {
  s/\|//g;
  s/\s+/\./g;
  s/save.*//g;
}

Jenda
===== je...@krynicky.cz === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to