Perl メモ

このまま更新するとまたズレルダロウナ
おpreは上手くいったっぽいけど一行Perlが変だ。。。
適当に改行してみる。

$ perl -ne "\$/=\"),(\"; while(<>){ 
if( /'([0-9a-z]+)','(http[^']+)','([^']+)','([^']+)',([0-9]*),([0-9]+),'([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}:[0-9]{2}:[0-9]{2})'/ ){
 print \"\$1 \$2 \$5\\n\";
}exit;
}" 3

動いたので test.phpを
<?php
var_dump( $argv );

$ perl -ne "\$/=\"),(\";
 while(<>){
 if( /'([0-9a-z]+)','(http[^']+)','([^']+)','([^']+)',([0-9]*),([0-9]+),'([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}:[0-9]{2}:[0-9]{2})'/ ){
 exec(\"php -f test.php \$1 \$2 \$5\");}exit;}" <3

array(4) {
  [0]=>
  string(8) "test.php"
  [1]=>
  string(9) "128274767"
  [2]=>
  string(53) "http://example.com/128274767"
  [3]=>
  string(1) "2"
}

とやりたいことが出来た。。。

This entry was posted on 月曜日, 5月 24th, 2010 at 12:48 AM and is filed under Perl. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Unityによるゲームを公開しております iOS/Android
https://itunes.apple.com/jp/app/lost-knight-3d-action/id900917032
https://play.google.com/store/apps/details?id=com.groundroad.runknight

各種開発支援・機能開発等小さいお仕事などもお請けしております。
unity開発支援, PHPシステム開発, javascript/html5 フロント開発, titanium mobileアプリ開発
お気軽にお問い合わせください
大崎・五反田近郊での対面でのお打ち合わせはいつでも可能です。