#!/usr/bin/perl

$Roses = "are red,";
$Violets = "are blue,";
$Perl = "is pink,";
$And = "so are you :-)";

Replies are listed 'Best First'.
Re: Belated Perl Valentines Day Love Poem
by yakko (Friar) on Feb 20, 2001 at 09:33 UTC
    #!/usr/bin/perl -w use strict; my @nouns=qw(Roses Violets Perl And); my @assoc=qw(red blue pink you); my $i=0; foreach my $item (@nouns) { print $item, (($item=~/s$/) ? " are " : (($item=~/and/i) ? " so are " : " is ")), $assoc[$i], (($item=~/and/i) ? " :-)\n" : ",\n"); $i++; }
    Messy, and my first attempt, but it's cheaper than a Hallmark card. :o)

    --
    Me spell chucker work grate. Need grandma chicken.

(crazyinsomniac) Re: Belated Perl Valentines Day Love Poem
by crazyinsomniac (Prior) on Feb 20, 2001 at 15:05 UTC
    Granted a few days late, but hey.
    #!perl -w use strict; my @valentine = <DATA>; $; #.=\\//=. = #\\ .. // 0 # \\__// ; # \ / # \/ for(0..$#valentine) { print map{$;++; $_ = ($;!=5)?(($;%2!=0)?"$_ are ":$_):qq;$_ is at ;; } split / /, $valentine[$_]; } __END__ Roses Red Violets Blue Perl $^X Where You?

     
    ___crazyinsomniac_______________________________________
    Disclaimer: Don't blame. It came from inside the void

    perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"