Perl Net::Twitter and oAuth

2010-09-22 Thread sftriman
I downloaded the /examples in Net::Twitter, and they don't seem to work. There were 2 in that directory. I've searched tons on Google, and I've read both links on the dev.twitter.com site for perl, but can't get those to work. Maybe someone here can help? My Twitter code does only a few

Re: Regexp to remove spaces

2009-12-28 Thread sftriman
On Dec 23, 2:31 am, rvtol+use...@isolution.nl (Dr.Ruud) wrote: sftriman wrote: 1ST PLACE - THE WINNER:  5.0s average on 5 runs # Limitation - pointer sub fixsp5 { ${$_[0]}=~tr/ \t\n\r\f/ /s; ${$_[0]}=~s/\A //; ${$_[0]}=~s/ \z//; } Just decide to change in-place, based

Re: Regexp to remove spaces

2009-12-22 Thread sftriman
Thanks to everyone for their input! So I've tried out many of the methods, first making sure that each works as I intended it. Which is, I'm not concerned with multi-line text, just single line data. That said, I have noted that I should use \A and \z in general over ^ and $. I wrote a 176 byte

Faster way to do a regexp using a hash

2009-12-20 Thread sftriman
I've been wondering for a long time... is there a slick (and hopefully fast!) way to do this? foreach (keys %fixhash) { $x=~s/\b$_\b/$fixhash{$_}/gi; } So if $x=this could be so cool and $fixhash{could}=would; $fixhash{COOL}=awesome; $fixhash{beso}=nope; $fixhash{his}=impossible; then it

Regexp to remove spaces

2009-12-20 Thread sftriman
I use this series of regexp all over the place to clean up lines of text: $x=~s/^\s+//g; $x=~s/\s+$//g; $x=~s/\s+/ /g; in that order, and note the final one replace \s+ with a single space. Basically, it's (1) remove all leading space, (2) remove all trailing space, and (3) replace all

Perl code shows high usage in top - why?

2008-11-22 Thread sftriman
I have this code that looks through a series of files, and for each, counts the unique number of IP addresses over the past 20 minutes, then rewrites the file contents. It seems pretty simple - each of the 5 $site files has at most 100 or so IP entries it in - many files have 0-5 rows of data at

Re: Date format search in the file

2008-11-22 Thread sftriman
On Nov 22, 6:16 am, [EMAIL PROTECTED] (Dermot) wrote: 2008/11/22 Sureshkumar M (HCL Financial Services) [EMAIL PROTECTED]: Hi All, Hi #!/usr/bin/perl # Always use these, particularly when things aren't working as expected. use strict; use warnings; open(DATA,i)||die Unable to

regexp - end of line question

2008-11-20 Thread sftriman
I have data such as: A|B|C|44 X|Y|Z|33,44 C|R|E|44,55,66 T|Q|I|88,33,44 I want to find all lines with 44 in the last field. I was trying: /[,\|]44[,\$]/ which logically is perfect - but the end of line \$ doesn't seem right. How do I write: comma or pipe followed by 44 followed by comma or