Re: regex to get version from file name

2014-02-23 Thread Wernher Eksteen
Great thank you! On Fri, Feb 21, 2014 at 6:02 PM, Jim Gibson wrote: > > On Feb 21, 2014, at 6:21 AM, Wernher Eksteen wrote: > > > Hi all, > > > > From the below file names I only need the version number 1.2.4 without > explicitly specifying it. > > > > check_mk-1.2.4.tar.gz > > check_mk-agen

Re: regex to get version from file name

2014-02-23 Thread Wernher Eksteen
Thanks, this also worked for me... foreach my $i (@fileList) { push @versions, $i =~ m/\b(\d+\.\d+\.\d+)\b/g; } my %seen; my @unique = grep { ! $seen{$_}++ } @versions; On Sun, Feb 23, 2014 at 4:27 PM, Jim Gibson wrote: > > On Feb 23, 2014, at 5:10 AM, Wernher Eksteen wrote: > > > H

Re: Calculate MD5 checksum of a remote and local file using FTP

2014-02-23 Thread Shaji Kalidasan
Dear Perlers, I made some improvements in my code (now I am checking the file size of remote file) but still can't figure out how to calculate the MD5 hash of a remote file. Any help is highly appreciated. [code] use strict; use warnings; use Digest::MD5::File qw( file_md5_hex ); use Net::FTP;

Re: regex to get version from file name

2014-02-23 Thread Jim Gibson
On Feb 23, 2014, at 5:10 AM, Wernher Eksteen wrote: > Hi, > > Thanks, but how do I assign the value found by the regex to a variable so > that the "1.2.4" from 6 file names in the array @fileList are print only > once, and if there are other versions found say 1.2.5 and 1.2.6 to print the >

Re: web scraper modules

2014-02-23 Thread Mike McClain
Hi Octavian, Thanks for the suggestions. Mike On Wed, Feb 19, 2014 at 02:22:41PM +0200, Octavian Rasnita wrote: > CSS is just a subset of XPath, so it is not as advanced, but it has a nicer > syntax, so if you have a good CSS knowledge, you may use other scrapers like: > WWW::Mechanize::Quer

Re: regex to get version from file name

2014-02-23 Thread Jim Gibson
On Feb 21, 2014, at 6:21 AM, Wernher Eksteen wrote: > Hi all, > > From the below file names I only need the version number 1.2.4 without > explicitly specifying it. > > check_mk-1.2.4.tar.gz > check_mk-agent-1.2.4-1.noarch.rpm > check_mk-agent-logwatch-1.2.4-1.noarch.rpm > check_mk-agent-

Re: regex to get version from file name

2014-02-23 Thread Wernher Eksteen
Thanks, I've changed it to use LWP. I'm not sure how to download the actual file with LWP, so I've tried File::Fetch which works, but it doesn't show download progress/status etc, just hanging blank until the download completes. Any pointers on getting download status/progress details? foreach my

Re: regex to get version from file name

2014-02-23 Thread shawn wilson
Use LWP to get web data - not lynx and the like unless you can't help it. I prefer using Web::Scraper to parse html but either way it's probably best not to use a regex (see SO and similar for discussions on the like). On Feb 23, 2014 8:13 AM, "Wernher Eksteen" wrote: > > Hi, > > Thanks, but how

Re: regex to get version from file name

2014-02-23 Thread Wernher Eksteen
Hi, Thanks, but how do I assign the value found by the regex to a variable so that the "1.2.4" from 6 file names in the array @fileList are print only once, and if there are other versions found say 1.2.5 and 1.2.6 to print the unique values from all. This is my script thus far. The aim of this s