Help for this page
#!/usr/bin/perl ... my(@array1) = (1, 2, 3, 4); my(@array2) = ('a', 'b', 'c', 'd', 'e', 'f');
push my @array3, @array1, @array2;
Parentheses missing around "my" list at try.pl line 12.
push (my @array3, @array1, @array2);
#!/usr/bin/perl ... foreach my $enum_type ( eval $enum_types ) { print qq[<option value="$enum_type">$enum_type</option>\n]; }
my $enum_types = "'On Order','Waiting, Pending Payment','Dispatched',' +Cancelled','Renewal','Amend\'ed'"; # NB: one value has a , in it and another a ' just to make this challe +nging... ;-) ... foreach my $enum_type ( eval $enum_types ) { print qq[<option value="$enum_type">$enum_type</option>\n]; }
while ( $enum_types =~ m/('(.*?)'|([^']*?))($|,\s*)/g ) { my $match = $3 || $2; print qq[<option value="$match">$match</option>\n] if $match; }
#!/usr/bin/perl ... foreach my $enum_type ( split /(?:^'|','|'$)/, $enum_types ) { print qq[<option value="$enum_type">$enum_type</option>\n]; }
$ ./try.pl <option value=""></option> ... <option value="Cancelled">Cancelled</option> <option value="Renewal">Renewal</option> <option value="Amen'ded">Amen'ded</option>
my $command = '/usr/local/bin/program_with_multiline_output'; chomp(my(@output) = `$command`); ... my $returned = $? >> 8; print "Returned: [$returned]\n"; print "Message: [$output]\n";
and all is quiet...
www.com | www.net | www.org
There is too much technical debt in my codebase The stability of the system Perl suits me better I have to support users of some ancient version I'm stuck with ActiveState/TinyPerl/microperl/Strawberry ... Letting the early adopters trip over the bugs is fine Some other reason
Results (31 votes). Check out past polls.