I lost my server connection for some reason and so I tested this on my laptop and I do see a very good improvement with the your modification.
update: corrected <> with $_ per pijll post
this finishes in about 14 seconds.... corrected timingC:\>perl -lne "BEGIN{$,=','} print+(split',',$_)[0..14] " > junk
this takes about 18 secondsC:\>perl -lanF, -e "BEGIN{ $,=\",\"} print @F[0..14];" numbers.csv > j +unk
I don't have a timing utility in Windows so the times are just wallclock times.
I guess windows is faster because the process run at 100% CPU (or whatever is required i guess?). On the UNIX servers the process might be more time-shared?
My laptop is 1.6G Centrino/1GB Ram/perl, v5.6.1
cheers
SK Update: Thanks pijll, the time it takes to run your version of the code is almost same as the one that uses -n.
In reply to Re^4: cut vs split (suggestions)
by sk
in thread cut vs split (suggestions)
by sk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |