Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Skeeve's scratchpad

by Skeeve (Vicar)
on Aug 27, 2004 at 21:39 UTC ( #386500=scratchpad: print w/ replies, xml ) Need Help??

for bart
<!-- xslt 2.0 --> <xsl:choose> <xsl:variable name="output"> <img src="{@src}"/> </xsl:variable> <xsl:when test="@popup"> <a href="{@popup}"> <xsl:copy-of select="$output"/> </a> </xwl:when> <xsl:otherwise> <xsl:copy-of select="$output"/> </xsl:otherwise> </xsl:choose> <!-- xslt 1.0 --> <xsl:choose> <xsl:when test="@popup"> <a href="{@popup}"> <xsl:call-template name="img"/> </a> </xwl:when> <xsl:otherwise> <xsl:call-template name="img"/> </xsl:otherwise> </xsl:choose> <xsl:template name="img"> <img src="{@src}"/> </xsl:template>
xd -- Hexdump
#!/usr/bin/perl @fill= qw( .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ); if (scalar(@ARGV)) { foreach $file(@ARGV) { $size= -s $file; $form= length(sprintf("%x",$size))-1; ++$form unless $form; print "File: ",$file,"\n"; open (IN,$file); &dump(*IN, $form); close (IN) } } else { &dump(*STDIN, 4); } sub dump { local(*IN, $form)= @_; my ($buf, $i); while ($rb= read(IN, $buf, 16)) { @x= unpack("H2" x $rb, $buf); $buf=~ s/[\x00-\x1f\x7f-\xff]/./g; $buf.= ' ' x (16-length($buf)); printf ("%0${form}x0: %s [%s]\n" ,$i++, ,sprintf ("%s %s %s %s %s %s %s %s - %s %s %s %s %s %s %s %s +", @x, @fill) ,$buf ); } }
dx -- undump
#!/usr/bin/perl if (scalar(@ARGV)) { foreach $file(@ARGV) { open (IN,$file); &undump(*IN); close (IN) } } else { &undump(*STDIN); } sub undump { local(*IN)= @_; local($_); while (<IN>) { # next unless s/^([0-9a-f]+)://; s/^([0-9a-f]+)://i; s/[^\-\s0-9a-f].*$//i; @match= /(\b[0-9a-f][0-9a-f]\b)/ig; print pack("H2" x scalar(@match), @match); } }
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 making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2016-08-27 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (380 votes). Check out past polls.