#3 The /assign_in_one FAQ is incomplete

open
nobody
None
5
2005-06-28
2005-06-28
No

The FAQ entry at:
http://www.perlmeme.org/faqs/regexp/assign_in_one.html
is incompete.

The first code sample does not declare $string1 and
$string2
as lexical variables, and the solution code should be a
complete
working example. Perhaps something like:

#!/usr/bin/perl
use strict;
use warnings;

my $string1;
my $string2 = ' some text';

($string1 = $string2) =~ s/\s+//g;
print "$string1\n";

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks