Re: PERL Web search

2009-01-12 Thread Chas. Owens
On Mon, Jan 12, 2009 at 23:36, Gunnar Hjalmarsson wrote: snip > I just read Chas's reply, though, and I wasn't aware of the fact that Google > disallow *all* automated access to their search engine. snip Well, they don't disallow all automated access; they do allow automated access through the SO

need help on perl script

2009-01-12 Thread srinivasa.prasad2
Hi, Myself Srinivasa Prasad, I have a querry for the following scenario: "Take the inputs as for perl scripts and java objects and measure the resolution of the desktop image by a screen image capture through a print screen" I have to write the perl script for the above scenario. Pls help me how

How Can I read a dd image WindowsXP file using perl?

2009-01-12 Thread Armin Garcia
Hi !!! Well Does anybody knows how Can I analyze a dd image of WindowsXP using Perl? I mean, exist some module for obtain info of this dd files? Books? articles? URLS? I hope some body help me And thans so much

Re: PERL Web search

2009-01-12 Thread Gunnar Hjalmarsson
Gunnar Hjalmarsson wrote: use LWP::UserAgent; use CGI qw(:standard); print header(-type => 'text/html', -charset => 'UTF-8'); #--^^^ # Google uses UTF-8 encoding my $url = 'http://www.google.com/search?q=traducao'; my

Re: PERL Web search

2009-01-12 Thread Chas. Owens
On Mon, Jan 12, 2009 at 15:26, wrote: > Dear all, > I can not make a search using perl. > I get the error: > > Couldn't get http://www.google.com/search?q=traducao at browser.pl > line 13. > > This is the naked script: > > #!/usr/bin/perl > > use strict; > use CGI::Carp qw(fatalsToBrowser); > use

Re: PERL Web search

2009-01-12 Thread Gunnar Hjalmarsson
tt.traduto...@gmail.com wrote: Dear all, I can not make a search using perl. I get the error: Couldn't get http://www.google.com/search?q=traducao at browser.pl line 13. By default, the LWP family of modules sends a client identifier that begins with 'libwww-perl/'. Unfortunately Perl is also

Re: Passing info to a sub function

2009-01-12 Thread Mr. Shawn H. Corey
On Mon, 2009-01-12 at 18:40 -0600, Harry Putnam wrote: > I'm in the middle of some administrative type of scripting and my > skill level is pretty low. I ran up on a need to pass two different > kinds of chunks of into to a sub function. > > I'm familiar with the `func($thg1, thg2, thg3);' kind of

Passing info to a sub function

2009-01-12 Thread Harry Putnam
I'm in the middle of some administrative type of scripting and my skill level is pretty low. I ran up on a need to pass two different kinds of chunks of into to a sub function. I'm familiar with the `func($thg1, thg2, thg3);' kind of syntax that ends up as: 3 elements of `...@_' but I want to pass

Re: A simple way to detect which files are newer

2009-01-12 Thread Harry Putnam
"Chas. Owens" writes: >> Or do I have to analyze each file with stat or something? > snip > > In the end, someone has to stat each file, but you should be able to > get what you want like this: > > my @files = > map { $_->[1] } > sort { $b->[0] <=> $a->[0] } > map { -f $_ ? [-M _, $_]

Re: OO confusion

2009-01-12 Thread Jenda Krynicky
From: Mike McClain > On Sat, Jan 10, 2009 at 09:56:24PM -0800, Randal L. Schwartz wrote: > > > > I prefer the "do" form, myself. > > Is there a functional reason for your preference > or is it just a matter of taste? I can't talk for Randal, but for me there is a simple reason. In the do

PERL Web search

2009-01-12 Thread tt . tradutores
Dear all, I can not make a search using perl. I get the error: Couldn't get http://www.google.com/search?q=traducao at browser.pl line 13. This is the naked script: #!/usr/bin/perl use strict; use CGI::Carp qw(fatalsToBrowser); use CGI qw(:standard); print header; my $url = 'http://www.google.

Re: A simple way to detect which files are newer

2009-01-12 Thread Gunnar Hjalmarsson
Chas. Owens wrote: Gunnar Hjalmarsson wrote: Harry Putnam wrote: I want to do something like this but with perl: rm -f $(ls -lt|sed -n '6,$p') so that the five newest files are always left. Is there some short way to get that effect in perl? Or do I have to analyze each file with stat or so

Re: A simple way to detect which files are newer

2009-01-12 Thread Chas. Owens
On Mon, Jan 12, 2009 at 17:41, Gunnar Hjalmarsson wrote: > Harry Putnam wrote: >> >> I want to do something like this but with perl: >> >> rm -f $(ls -lt|sed -n '6,$p') >> >> so that the five newest files are always left. >> >> Is there some short way to get that effect in perl? >> >> Or do I have

Re: file::find skip subdir

2009-01-12 Thread Chas. Owens
On Mon, Jan 12, 2009 at 16:05, icarus wrote: > I'm trying to all count files in a home dir and all subdirs *except* a > subdir called 'backup'. When you run into the condition where you don't want to recurse further, set $File::Find::prune to 1 (e.g. $File::Find::prune = 1 if $_ = "./backup";).

Re: A simple way to detect which files are newer

2009-01-12 Thread Gunnar Hjalmarsson
Harry Putnam wrote: I want to do something like this but with perl: rm -f $(ls -lt|sed -n '6,$p') so that the five newest files are always left. Is there some short way to get that effect in perl? Or do I have to analyze each file with stat or something? Assuming that you are on a *nix plat

Re: A simple way to detect which files are newer

2009-01-12 Thread Chas. Owens
On Mon, Jan 12, 2009 at 16:59, Harry Putnam wrote: > I want to do something like this but with perl: > > rm -f $(ls -lt|sed -n '6,$p') > > so that the five newest files are always left. > > Is there some short way to get that effect in perl? > > Or do I have to analyze each file with stat or somet

file::find skip subdir

2009-01-12 Thread icarus
I'm trying to all count files in a home dir and all subdirs *except* a subdir called 'backup'. How do I that? thanks in advance. #!/usr/bin/perl use warnings; use strict; use File::Find; my $dir = ("/home/foo"); my $counter = 0; find( { wanted => \&process, no_chdir => 0 }, $dir ); sub proce

A simple way to detect which files are newer

2009-01-12 Thread Harry Putnam
I want to do something like this but with perl: rm -f $(ls -lt|sed -n '6,$p') so that the five newest files are always left. Is there some short way to get that effect in perl? Or do I have to analyze each file with stat or something? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org

Re: OO confusion

2009-01-12 Thread Mike McClain
On Sat, Jan 10, 2009 at 09:56:24PM -0800, Randal L. Schwartz wrote: > > I prefer the "do" form, myself. Is there a functional reason for your preference or is it just a matter of taste? Mike -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginn

Re: inverting List::Compare

2009-01-12 Thread John Refior
On Sun, Jan 4, 2009 at 7:42 PM, John W. Krahn wrote: >>> You should include the $! variable in the die string so that you know why >>> the >>> open failed. I suggest >>> >>> my @llist; >>> { >>>open my $fh, '<', $lfile or die "Unable to open '$lfile': $!"; >>>@llist = <$fh>; >>> } >> >>