Skip to content

Instantly share code, notes, and snippets.

View drbaggy's full-sized avatar
🎯
Focusing

James Smith drbaggy

🎯
Focusing
View GitHub Profile
@drbaggy
drbaggy / get_ids.pl
Last active August 29, 2015 14:04
Get all "id" attributes from a data structure!
use strict;
use warnings;
use feature qw(say);
my $data = {
'top' => {
'window' => {
'elements' => [
{ id => 44, name => 'link', value => 'xyz' },
{ id => 48, name => 'title', value => 'Home Page' },
@drbaggy
drbaggy / txt-to-xml.pl
Last active August 29, 2015 14:04
Converting contacts text file to XML...
#!/usr/local/bin/perl
## Purpose:
## Some "library routines" to parse the supplied input file, and
## additional functions to render data as XML.
## As the XML and data file is simple we will just use standard
## perl features.
##
## In this case parses the content at the end of the file
## and streams data out using a lambda function.