목록개발이야기 (512)
준호씨의 블로그
push 함수를 이용하면 간단히 배열을 합칠 수 있다. my @array1 = (1,2); my @array2 = (3,4); my @array3 = (); push(@array3, @array1); push(@array3, @array2); print "@array3\n"; # 1 2 3 4 이렇게 해도 같음. 그런데 push 가 좀 더 효과적이고 한다. my @array4 = (@array1, @array2); print "@array4\\n"; # 1 2 3 4 참고 https://docstore.mik.ua/orelly/perl3/cookbook/ch04_10.htm
Requests http://docs.python-requests.org/en/master/user/quickstart/ 사용자 편의성은 이게 제일 좋은 것 같다. 설치 $ pip install reuqests 사용 $ python >>> import requests >>> r = requests.get('https://api.github.com/events') >>> print(r.url) https://api.github.com/events >>> print(r.content) [{"id":"7687592113","type":"PushE... post, put, delete, head, options... >>> r = requests.post('http://httpbin.org/post', data..
라인수가 많지 않으면 cat 결과를 array 에 넣어서 읽으면 됩니다. my @lines = `cat file.txt`; for my $line (@lines) { print $line; } 라인수가 많으면 file open 을 이용합니다. #!/usr/bin/env perl use strict; use warnings; my $file = "file.txt"; open my $info, $file or die "Could not open $file: $!"; while (my $line = ) { print $line; } close $info;
import PlaygroundSupport PlaygroundPage.current.needsIndefiniteExecution = true 참고 http://www.thomashanning.com/concurrent-code-in-playgrounds/
dig 커맨드 $ dig mx daum.net +short 10 mx3.hanmail.net. 10 mx4.hanmail.net. 10 mx1.hanmail.net. 10 mx2.hanmail.net. host 커맨드 $ host -t MX daum.net daum.net mail is handled by 10 mx3.hanmail.net. daum.net mail is handled by 10 mx1.hanmail.net. daum.net mail is handled by 10 mx4.hanmail.net. daum.net mail is handled by 10 mx2.hanmail.net. nslookup 커맨드 처음에 server 8.8.8.8 은 안넣어도 상관 없음. DNS 서버 지정하는 부분임...