- or download this
PerlModule HTML::Mason::ApacheHandler
<Location /~jeff/mason>
...
SetHandler perl-script
PerlHandler HTML::Mason::ApacheHandler
</Location>
- or download this
my %uri = (
dl => 'http://www.plkr.org/download',
...
);
exit;
}
- or download this
#!/usr/bin/perl
use warnings;
...
");
$dbh->disconnect;
__END__
- or download this
# PREPARE ONLY ONCE, NOT EVERYTIME THROUGH THE LOOP
my $word = $dbh->prepare(qq{SELECT term from dream_terms where term=?}
+);
...
return $linked_word;
}
- or download this
#!/usr/bin/perl
use warnings;
...
</body>
</html>
}
- or download this
<script>
var foo = { a:1
...
};
alert( foo['b'] );
</script>
- or download this
<style>
#foo #bar { color:red; }
...
<div id="foo">
<div id="bar">bar</div>
</div>
- or download this
#!/usr/bin/perl
use warnings;
...
? 1
: 0;
}
- or download this
#!/usr/bin/perl
use strict;
...
print $cgi->header();
$interpreter->exec($component,%args);
- or download this
my $in_file = "bill";
my $out_file = "far2";
...
print "Done\n";
close(IF);
close(OF);
- or download this
#!/usr/bin/perl -w
use strict;
...
, $q->end_form
;
print "You entered :" . $q->param('foo') if $q->param;
- or download this
<script src="/js/prototype.js"></script>
<script src="/js/extend.js"></script>
...
myInheritedInstance = new myInheritedClass(6);
myInheritedInstance.show(); // result = 11
</script>
- or download this
$dbh->do("CREATE FUNCTION MyAdd");
sub MyAdd {
...
my $sth = $dbh->prepare("
SELECT myAdd(id,9) AS foo FROM test
");
- or download this
#!perl -w
use strict;
...
my $sql = "CREATE TABLE foo (id INT PRIMARY KEY,bar VARCHAR(30)";
my $translator = SQL::Translator->new;
SQL::Translator::Parser::PostgreSQL::parse($translator,$sql);
- or download this
#!perl -w
use strict;
...
last unless @$cols;
printf "%s\n", join ':',@$cols;
}
- or download this
#!perl -w
use strict;
...
ok($old =~ /\Q$new/,'$old =~ /\Q$new/');
ok($new =~ /$old/,'$new =~ /$old/');
ok($new =~ /\Q$old/,'$new =~ /\Q$old/');
- or download this
SELECT foo, bar
FROM baz JOIN qux
WHERE quimble = ?
AND bop = ?
- or download this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
...
<a href="http://www.perlmonks.org/?displaytype=raw;xmlstyle=clean;node
+=XP XML Ticker">XP</a><br />
</body>
</html>
- or download this
% cat > dbish.txt
...
INSERT INTO x VALUES (2,'b');
SELECT * FROM x;
% perl -MDBI::Shell -e 'DBI::Shell->new("--batch","dbi:DBM:")->run' <
+dbish.txt;
- or download this
#!/usr/bin/perl -w
use strict;
...
open STDIN, '<', \$str;
DBI::Shell->new('--batch','dbi:DBM:')->run;
- or download this
use Text::CSV_XS;
$c = Text::CSV_XS->new; # use default separator,delimite
+r,escape
...
}
There are two interfaces to this module, the new interface (shown abov
+e) has convenient shortcuts, the older interface is for backwards com
+patibility for previous users. B<Please note>: in the new interface
+binary mode defaults to true, whereas in the older interface it defau
+lts to false. This means that the new interface methods will, by def
+ault, handle embedded newlines and binary characters, whereas if you
+want that behaviour with the old methods, you must manually set binar
+y=>1 in the call to new().
- or download this
The char used for escaping certain characters inside quoted fields,
by default the same character as the quote_char. (C<">).
...
$csv = Text::CSV_XS->new({ escape_char => q[\\] });
$csv->parse(q["Joe \"the giant\" Jackson"]) or die $csv->error_input;
- or download this
#!perl -w
use strict;
...
print "Done!";
}
__END__
- or download this
#!/usr/bin/perl -w
use strict;
...
# print "$lookingfor required at line $line of [$modfile] $filenam
+e\n";
};
1;
- or download this
#!perl -w
use strict;
...
print join ' ', @{ $dbh->selectcol_arrayref("
SELECT phrase FROM t WHERE phrase <> 'junk' ORDER BY id DESC
")};
- or download this
use DBM::Deep;
my $file ='foo.db';
...
untie %h;
tie %h, 'DBM::Deep', {file=>$file,autoflush=>1};
print $h{key};
- or download this
#!perl -w
use strict;
...
__END__