This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% prove --exec 'perl -Iblib/lib -Iblib/arch -MTest::Valgrind' leak.t | |
# Using valgrind 3.7.0 located at /usr/local/bin/valgrind | |
# Using suppression file /Users/syohei/.perl/Test-Valgrind/suppressions/1.13/memcheck-3.7.0-aa5062912afa3d247a5c755d0683818d.supp | |
# Failed test 'Leak_StillReachable' | |
# at /Users/syohei/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/darwin-2level/Test/Valgrind/Session.pm line 451. | |
# got: 1 | |
# expected: 0 | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'cl) | |
(defun fizzbuzz (n) | |
(let ((i 1) lst) | |
(while (<= i n) | |
(progn | |
(cond ((= (mod i 15) 0) (push "fizzbuzz" lst)) | |
((= (mod i 5) 0) (push "buzz" lst)) | |
((= (mod i 3) 0) (push "fizz" lst)) | |
(t | |
(push i lst))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% ./runtest.pl c89.2- | |
[Using PIPE] | |
------------------------------------------ | |
Total : 4162 | |
Passed Compile : 4162 (100.0 %) | |
Failed Compile : 0 ( 0.0 %) | |
Passed Execute : 4162 (100.0 %) | |
Failed Execute : 0 ( 0.0 %) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode:shell-script -*- | |
# * cdd | |
# $ cdd WINDOW番号 でその screen の WINDOW 番号へ移動 | |
# するための zsh function | |
# 他にも cdadd でショートカットの作成、cddel でショートカットの削除とか | |
# | |
# * 使い方 | |
# 1. | |
# .zshrc でなにはともあれ | |
# autoload -U compinit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/home/syohei/perl5/perlbrew/perls/perl-5.14.1/bin/perl | |
use strict; | |
use warnings; | |
use File::Which qw/which/; | |
use utf8; | |
use Encode qw(encode_utf8); | |
local $SIG{__DIE__} = sub { | |
exec qw/zenity --error --text/, encode_utf8(shift); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; -*- coding: utf-8; mode:emacs-lisp -*- | |
;;; set-perl5lib.el --- set path into PERL5LIB if its file path includes 'lib' directory | |
;; Copyright (C) 2008 Taiyoh Tanaka | |
;; Author: Taiyoh Tanaka <[email protected]> | |
;; This file is free software; you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published | |
;; by the Free Software Foundation; either version 2, or (at your | |
;; option) any later version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use warnings; | |
my $to_column = shift; | |
die "first argument is '0' or '1'" unless $to_column == 0 or $to_column == 1; | |
my $arg = shift or die "Usage: $0 to_column value"; | |
$arg = uc $arg; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun my/imported-modules () | |
(interactive) | |
(let (imported-modules) | |
(save-excursion | |
(goto-char (point-min)) | |
(while (re-search-forward "\\(use\\|require\\) +\\([^;]+\\);" nil t) | |
(push (list (buffer-substring-no-properties (match-beginning 2) (match-end 2))) | |
imported-modules) | |
(setq tms imported-modules)) | |
(completing-read "what module? : " imported-modules)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; IMAKADOさんの plcmp-cmd-show-docの方がすごいのでそちらを使うべき。 | |
(defun cperl-perldoc+ () | |
(interactive) | |
(let* ((imported-module-alist '()) | |
(word-at-point (cperl-word-at-point)) | |
(word-at-point-str (if word-at-point | |
(substring-no-properties word-at-point))) | |
(module-regex "\\(use\\|require\\)\\s +\\([^ ;]+\\)")) | |
(save-excursion | |
(goto-char (point-min)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
とほほのwww入門 管理人 杜甫々様 | |
吉田 昌平と申します。 | |
貴殿のホームページにある「とほほのperl入門」の内容が | |
とても古いものになってしまっており, 現代的な Perlとはずいぶん | |
かけ離れたものとなっています。それらの多くは現在推奨されない | |
書き方になっています。 | |
具体的には以下のような点が上げられます。 | |
- use strict, use warningsが使われていない |