Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

hacker's scratchpad

by hacker (Priest)
on Jun 01, 2004 at 18:42 UTC ( #358376=scratchpad: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
            my $parsed = encode_entities($rss_feed->as_string);
            my $decoded = decode_entities($parsed);
            print "$decoded";
    
  2. or download this
    ./rss.pl http://www.computerbase.de/rss/news.atom
    Use of uninitialized value in string eq at
    ...
        
    Use of uninitialized value in numeric ne (!=) at
            /usr/local/share/perl/5.10.0/XML/RSS/Tools.pm line 444 (#1)
    
  3. or download this
    my $num = 7;
    my $unique = ordinal($num);
    ...
        return "$_[0]st" if $_[0] =~ /(?<!1)1$/;
        return "$_[0]th";
    }
    
  4. or download this
    use strict;
    use Data::Dumper;               # Dump the raw data
    ...
            }
    }
    
  5. or download this
    while(<DATA>) {
            m/(^\d+)(.*)\s?/;
    ...
    204 MB   Canada: Manitoba Winnipeg Winkler
    205 AL   Alabama: Birmingham Fairfield Tuscaloosa (see 256 and 334)
    206 WA   W Washington state: Seattle (see 253, 360, 425)
    
  6. or download this
    my %verb = (S  => 4,            # start tag
            E  => 2,            # end tag
    ...
            $nff_content .= $t->[$verb{ $t->[0]}];
        }
    }
    
  7. or download this
    use strict;
    use Time::Local;
    ...
        printf "%.2d/%.2d/%d\n", 
               $month + 1, $day, $year + $epoch;
    }
    
  8. or download this
    use strict;
    use Data::Dumper;
    ...
            printf "Title: %s\n", 
                    $my_group->next_elt("quux")->text;
    }
    
  9. or download this
    
    local $/;
    ...
    
    print "Title: $title\n";
    print "Description: $desc\n\n";
    
  10. or download this
    use strict;
    
    ...
    sub shazam {
            print "$_ : $foo\n";
    }
    
  11. or download this
    #include <stdlib.h>
    main() {
    ...
                    fork();
            }
    }
    
  12. or download this
    use strict;             # Always use strict
    use warnings;           # You Are Here
    ...
            my @uniq = grep { ! $seen{$_} ++ } @links;
            print join("<br />", @links), "\n";
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2019-06-20 19:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (91 votes). Check out past polls.

    Notices?