Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

serf's scratchpad

by serf (Chaplain)
on Mar 03, 2005 at 20:08 UTC ( #436355=scratchpad: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    my(@array1) = (1, 2, 3, 4);
    my(@array2) = ('a', 'b', 'c', 'd', 'e', 'f');
  2. or download this
    push my @array3, @array1, @array2;
  3. or download this
    Parentheses missing around "my" list at line 12.
  4. or download this
    push (my @array3, @array1, @array2);
  5. or download this
    push (my @array3, @array1, @array2);
  6. or download this
    push my @array3, @array1, @array2;
  7. or download this
    foreach my $enum_type ( eval $enum_types ) {
        print qq[<option value="$enum_type">$enum_type</option>\n];
  8. or download this
    my $enum_types = "'On Order','Waiting, Pending Payment','Dispatched','
    # 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];
  9. or download this
    while ( $enum_types =~ m/('(.*?)'|([^']*?))($|,\s*)/g ) {
        my $match = $3 || $2;
        print qq[<option value="$match">$match</option>\n] if $match;
  10. or download this
    foreach my $enum_type ( split /(?:^'|','|'$)/, $enum_types ) {
        print qq[<option value="$enum_type">$enum_type</option>\n];
  11. or download this
    $ ./
    <option value=""></option>
    <option value="Cancelled">Cancelled</option>
    <option value="Renewal">Renewal</option>
    <option value="Amen'ded">Amen'ded</option>
  12. or download this
    my $command = '/usr/local/bin/program_with_multiline_output';
    chomp(my(@output) = `$command`);
    my $returned = $? >> 8;
    print "Returned: [$returned]\n";
    print "Message: [$output]\n";
  13. or download this
    and all is quiet...

Log In?

What's my password?
Create A New User
[Lady_Aleena]: Corion, I knew that, I was just giving Discipulus a hard time.
choroba likes the story at the end of the node
[choroba]: reminds me of the days at the bank
[Corion]: Lady_Aleena: Hehe ;-D
[Lady_Aleena]: Corion, it was PerlMonks who kept pushing me to get Linux, so now I know some of the commands to use in word play.
[Corion]: Lady_Aleena: :-D
[Lady_Aleena]: Corion, so do you think the gods would be open to taking over Cookies should I disappear for too long a time?

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2017-04-26 08:30 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (471 votes). Check out past polls.