Myoungjin Jeon
- About: JG's blog for perl (-; I'm a chef and enjoying coding for my life.
Recent Actions
-
Commented on Late Weekly challenge 67 #1 only
I don't know about python language but I tested with someone's code time python3 Task1.combination.using-lib.py > /dev/null ________________________________________________________ Executed in 213.78 secs fish external usr time 52.31 secs 0.00 millis 52.31 secs sys time 20.40 secs 4.54 millis 20.39 secs...
-
Posted Late Weekly challenge 67 #1 only to Myoungjin Jeon
I wrote some library to make combination in 2013.
I think that finding combination isn't necessarily written using recursive calling.
so this is my first "working" solution.it is possible t…
-
Commented on No semicolon after return values
I used to use the statement without explicit return for constants and subroutines which has error message as their return value. sub readOnly ( $; ) { shift->read_write } or sub validate ( $;$ ) { my $error; ... $error;...
-
Commented on Just want to know WNOHANG...
use POSIX qw(:sys_wait_h); will increase about 1MiB of memory in my system. This may be or may not be considerable. but I guess using several modules would result in 3~5MiB increase without any useful things. It's an method to avoid...
-
Commented on Just want to know WNOHANG...
I realized that an installer can do this. but sometimes I put this kind of script in a archive or USB like using a PortableApps and in that case, this ensure the correct value of constant. thank you for reply....
-
Posted Just want to know WNOHANG... to Myoungjin Jeon
package MyApp; our $WNOHANG_VALUE ||= `$^X -MPOSIX=:sys_wait_h -e "print WNOHANG;"`; sub WNOHANG () { $WNOHANG_VALUE } !!'^^';
sigh maybe useful for a long-time running program if you are…
Comment Threads
-
Gábor Szabó - גאבור סבו commented on
No semicolon after return values
Acme::ReturnValue might give you a few ideas beyond 1, not 1;
-
Uriel Lizama commented on
No semicolon after return values
Although I see the point, I believe in keeping a constant style throughout your code, so if you end all your statements with ';' this should be consistent with all statements.
This is the same problem I have with languages like JavaScript which allow you to do things like:
if( true ){
//something
}
and
if(true)
//something
If you decide in a way to do it, you should stick to it, otherwise it can generate confusion in the long term. -
Steven Haryanto commented on
No semicolon after return values
Interesting thought. I personally always add a semicolon for the last statement of the block (though I also seldom use explicit 'return'). Unless they are inline, e.g.:
for (...) { stmt; last-stmt }
Dunno. These are just habits, I guess.
-
Mohammad Sajid Anwar commented on
Late Weekly challenge 67 #1 only
Welcome on board !!!
About blogs.perl.org
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.