Re: How to revinent wget?

2007-03-15 Thread Alan
On Wednesday 14 March 2007 09:10, siegfried wrote: > I'm downloading a lot of debian images using wget these days. Can anyone > suggest where I might look to find a little perl script that will download > a web page, look for all the links containing ".iso" and then reinvent wget > to download them

Sys::Gamin install error

2007-03-15 Thread Beginner
Hi, OS: FC4 With gamin-0.1.1-3.FC4 and gamin-devel-0.1.1-3.FC4 installed I have hit an error while trying to install Sys::Gamin. I can can run make but the `make test` is failing. The test file for Sys::Gamin reads: use Test; use SGI::FAM; plan tests => 1; ok (SGI::FAM::FAMChanged != SGI::FA

Re: using perl ot connect to a database

2007-03-15 Thread Chas Owens
On 3/15/07, FamiLink Admin <[EMAIL PROTECTED]> wrote: I am trying to connect to a database using a small script but get this error: failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' perl snip Am I doing something wrong? snip Try the following instead of

Re: How to revinent wget?

2007-03-15 Thread Peter Scott
On Wed, 14 Mar 2007 10:10:56 -0600, siegfried wrote: > I'm downloading a lot of debian images using wget these days. Can anyone > suggest where I might look to find a little perl script that will download a > web page, look for all the links containing ".iso" and then reinvent wget to > download th

sprintf - Rounding down

2007-03-15 Thread Beginner
Hi, For some reason my sprintf usage is not returning the numbers I had expected and appears to be rounding down. Is there something wrong with my formatting below. === code snip == my ($x,$y) = imgsize($fqn); my $size = $x*$y*3; my $ksiz

Re: sprintf - Rounding down

2007-03-15 Thread Tom Phoenix
On 3/15/07, Beginner <[EMAIL PROTECTED]> wrote: For some reason my sprintf usage is not returning the numbers I had expected and appears to be rounding down. Is there something wrong with my formatting below. my $ksize = sprintf("%.2f",$size/1024); my $mbsize =

about creating an array

2007-03-15 Thread Jm lists
hello lists, please see the codes below: use strict; use warnings; my @arr = (); open HD,"itemid.txt" or die $!; while(){ chomp; push @arr,$_; } close HD; print "@arr"; the itemid.txt has 470 lines data,looks like: 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 But

Re: Sys::Gamin install error

2007-03-15 Thread Tom Phoenix
On 3/15/07, Beginner <[EMAIL PROTECTED]> wrote: I have hit an error while trying to install Sys::Gamin. I can can run make but the `make test` is failing. BEGIN failed--compilation aborted at t/gamin.t line 2. t/gamindubious Test returned status 2 (wstat 512, 0x200) FAILED--1 test

Re: sprintf - Rounding down

2007-03-15 Thread Beginner
On 15 Mar 2007 at 8:05, Tom Phoenix wrote: > On 3/15/07, Beginner <[EMAIL PROTECTED]> wrote: > > > For some reason my sprintf usage is not returning the numbers I had > > expected and appears to be rounding down. Is there something wrong > > with my formatting below. > > > my $ks

Re: about creating an array

2007-03-15 Thread Rob Dixon
Jm lists wrote: hello lists, please see the codes below: use strict; use warnings; my @arr = (); open HD,"itemid.txt" or die $!; while(){ chomp; push @arr,$_; } close HD; print "@arr"; the itemid.txt has 470 lines data,looks like: 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 122

Re: about creating an array

2007-03-15 Thread yitzle
Not yet familiar with push, but just do this: use warnings; open HD,"< itemid.txt" or die $!; @arr = ; close HD; print join @arr, ", "; # Not sure I used join right. On 3/15/07, Jm lists <[EMAIL PROTECTED]> wrote: hello lists, please see the codes below: use strict; use warnings; my @arr =

Re: about creating an array

2007-03-15 Thread Jm lists
These are copied from the screen: $ cat test.pl use strict; use warnings; my @arr = (); open HD,"itemid.txt" or die $!; while(){ chomp; push @arr,$_; } close HD; print "@arr"; $ tail -20 itemid.txt 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1

Re: about creating an array

2007-03-15 Thread Jm lists
Also I use RH Linux and Perl 5.8.5.Here is the info: $ perl -v This is perl, v5.8.5 built for i386-linux-thread-multi Copyright 1987-2004, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 sourc

Re: about creating an array

2007-03-15 Thread John W. Krahn
Jm lists wrote: > hello lists, Hello, > please see the codes below: > > use strict; > use warnings; > my @arr = (); > open HD,"itemid.txt" or die $!; > while(){ >chomp; >push @arr,$_; > } > close HD; > > print "@arr"; > > > the itemid.txt has 470 lines data,looks like: > > 1210 > 121

Re: about creating an array

2007-03-15 Thread Will Martell
I believe this is a matter of list context versus scalar context. I think that 1693 should be the last itemid in the textfile. Double check that. Remove the quotes on the print @arr line and you should get what you want. HTH Will Martell Programmer - Dallas Tx. [EMAIL PROTECTED] [EMAIL PROTECTE

Re: about creating an array

2007-03-15 Thread Tom Phoenix
On 3/15/07, Jm lists <[EMAIL PROTECTED]> wrote: $ tail -20 itemid.txt 1674 1675 1676 Could itemid.txt have both CR and LF as line end characters? If you moved the file from Windows to Unix, that could be the problem. Hope this helps! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe,

Re: Sys::Gamin install error

2007-03-15 Thread Beginner
On 15 Mar 2007 at 8:20, Tom Phoenix wrote: > On 3/15/07, Beginner <[EMAIL PROTECTED]> wrote: > > > I have hit an error while trying to install Sys::Gamin. I can can run > > make but the `make test` is failing. > > > BEGIN failed--compilation aborted at t/gamin.t line 2. > > t/gamindubious > >

Re: using perl ot connect to a database

2007-03-15 Thread FamiLink Admin
Thank you! I am not sure why this did it but now I get the error: Client does not support authentication protocol requested by server. consider upgrading MySQL client. I researched this and found the "old_password" needed to be "on" for this to work. Any idea why I need the old_password set

Re: about creating an array

2007-03-15 Thread John W. Krahn
Will Martell wrote: > I believe this is a matter of list context versus scalar context. Really? Where in the code does this apply? > I think that 1693 should be the last itemid in the textfile. > > Double check that. > > Remove the quotes on the print @arr line and you should get what you > wa

Re: Sys::Gamin install error

2007-03-15 Thread Tom Phoenix
On 3/15/07, Beginner <[EMAIL PROTECTED]> wrote: done is, first edit the t/fam.t and added use diagnostics, then I wouldn't do that. The 'diagnostics' pragma isn't really intended to be used in test files. edited the Makefile/test section and made TEST_VERBOSE=1 Then run `make test` and saw:

Re: about creating an array

2007-03-15 Thread Rob Dixon
Jm lists wrote: 2007/3/16, Rob Dixon <[EMAIL PROTECTED]>: Jm lists wrote: hello lists, please see the codes below: [snip code, repeated below] the itemid.txt has 470 lines data,looks like: 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 But when I run that script I got

Re: Matching the domain of a URL

2007-03-15 Thread Jenda Krynicky
From: Igor Sutton Lopes <[EMAIL PROTECTED]> > On 2007/03/14, at 16:00, yitzle wrote: > > > regex. > > if ( m/^https?\/\/:blah\.com/) > > > my @possible_values = qw{ >http://www.google.com >https://my.domain. >http://some.other.domain.net > }; > > my @urls = qw{ >http://www.googl

Module for pulling actual queries from search engine URLs?

2007-03-15 Thread Grant
Does anyone know of a perl module for pulling the actual search queries from search engine URLs? It seems like writing a good regexp for that would be pretty tough. The URLs vary a lot. - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http

Re: Matching the domain of a URL

2007-03-15 Thread Grant
> > regex. > > if ( m/^https?\/\/:blah\.com/) > > > my @possible_values = qw{ >http://www.google.com >https://my.domain. >http://some.other.domain.net > }; > > my @urls = qw{ >http://www.google.com/?some_bizarre_args >https://my.domain.com >https://my.domain.net >http:

Re: using perl ot connect to a database

2007-03-15 Thread Chas Owens
On 3/15/07, FamiLink Admin <[EMAIL PROTECTED]> wrote: Thank you! I am not sure why this did it but now I get the error: Client does not support authentication protocol requested by server. consider upgrading MySQL client. I researched this and found the "old_password" needed to be "on" for thi

Dealing with ar archives

2007-03-15 Thread Ana Saiz García
Hello everybody I have to make a little program that deals with the contents of some ar archives. Do you know any alternative way to do this without using Archive::Ar module? Many thanks in advance regards Ana -- "El más baldío de todos los días es aquél en que no hemos reído"

Re: Dealing with ar archives

2007-03-15 Thread Chas Owens
On 3/15/07, Ana Saiz García <[EMAIL PROTECTED]> wrote: Hello everybody I have to make a little program that deals with the contents of some ar archives. Do you know any alternative way to do this without using Archive::Ar module? Do you have access to the ar command? If so then you can use it

Re: Matching the domain of a URL

2007-03-15 Thread Dr.Ruud
Grant schreef: > I ended up going with this: > if ($Scratch->{url} =~ /^https?:\/\/images\.google\./) { > Does that look OK? Variant of your code: if ( $scratch->{url} =~ m#^https?://images\.google\.# ) { But you'd better go with Randal's "use URI;" advice. -- Affijn, Ruud "Gewoon is

Re: Module for pulling actual queries from search engine URLs?

2007-03-15 Thread Dr.Ruud
Grant schreef: > Does anyone know of a perl module for pulling the actual search > queries from search engine URLs? It seems like writing a good regexp > for that would be pretty tough. The URLs vary a lot. Don't use a regexp for this, or at least look at Regexp::Common::URI, but first try URI,

Re: Matching the domain of a URL

2007-03-15 Thread Grant
> I ended up going with this: > if ($Scratch->{url} =~ /^https?:\/\/images\.google\./) { > Does that look OK? Variant of your code: if ( $scratch->{url} =~ m#^https?://images\.google\.# ) { But you'd better go with Randal's "use URI;" advice. You're right, I hadn't grasped what URI was

Re: Module for pulling actual queries from search engine URLs?

2007-03-15 Thread Grant
> Does anyone know of a perl module for pulling the actual search > queries from search engine URLs? It seems like writing a good regexp > for that would be pretty tough. The URLs vary a lot. Don't use a regexp for this, or at least look at Regexp::Common::URI, but first try URI, as Randal did

Re: Matching the domain of a URL

2007-03-15 Thread Igor Sutton Lopes
On 2007/03/15, at 18:29, Jenda Krynicky wrote: From: Igor Sutton Lopes <[EMAIL PROTECTED]> my @possible_values = qw{ http://www.google.com https://my.domain. http://some.other.domain.net }; my @urls = qw{ http://www.google.com/?some_bizarre_args https://my.domain.com https:

Re: Module for pulling actual queries from search engine URLs?

2007-03-15 Thread Jeff Pang
>Don't use a regexp for this, or at least look at Regexp::Common::URI, >but first try URI, as Randal did suggest. Also you may need the module of "URI::Escape". -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: How to revinent wget?

2007-03-15 Thread Alan
Hi. The orig post of this code did not come to my email -- but the post is on Google Groups. (I'm emailing). I got the code (as enclosed below) working when the url is http. But, ftp://slackware.mirrors.tds.net/pub/slackware/slackware-11.0-iso (ftp), however, does not work which I'd guess is

Re: using perl ot connect to a database

2007-03-15 Thread FamiLink Admin
It looks old! 2.1021 Thanks for your help. Now I will go to work on updating this. Thanks for your help! Ryan - Original Message - From: "Chas Owens" <[EMAIL PROTECTED]> To: "FamiLink Admin" <[EMAIL PROTECTED]> Cc: "Perl Beginners List" Sent: Thursday, March 15, 2007 11:37 AM Subjec

GUI with Perl

2007-03-15 Thread yitzle
Can I make a GUI program with Perl? How? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: about creating an array

2007-03-15 Thread Jm lists
Thanks John.That's the right way. Another question,what's the regex of "\s+\z" ? 2007/3/16, John W. Krahn <[EMAIL PROTECTED]>: Jm lists wrote: > hello lists, Hello, > please see the codes below: > > use strict; > use warnings; > my @arr = (); > open HD,"itemid.txt" or die $!; > while(){ >c

Re: GUI with Perl

2007-03-15 Thread Jeff Pang
> >Can I make a GUI program with Perl? You can. >How? > Search CPAN for keyword "TK". -- http://home.arcor.de/jeffpang/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Module for pulling actual queries from search engine URLs?

2007-03-15 Thread Grant
> Does anyone know of a perl module for pulling the actual search > queries from search engine URLs? It seems like writing a good regexp > for that would be pretty tough. The URLs vary a lot. Don't use a regexp for this, or at least look at Regexp::Common::URI, but first try URI, as Randal did

Re: about creating an array

2007-03-15 Thread yitzle
What do you mean? \s+\z will match 0 to all whitespace at end of the buffer. You can see if your variable has this with m/\s+\z/ or you can replace it with FOO: s/\s+\z/FOO/ On 3/15/07, Jm lists <[EMAIL PROTECTED]> wrote: Thanks John.That's the right way. Another question,what's the regex of "\s

Re: about creating an array

2007-03-15 Thread John W. Krahn
Jm lists wrote: > > 2007/3/16, John W. Krahn <[EMAIL PROTECTED]>: >> >> Or you could remove all trailing whitespace: >> >> while ( ) { >>s/\s+\z//; >>push @arr, $_; >> } > > Thanks John.That's the right way. > Another question,what's the regex of "\s+\z" ? \s+ matches one or more whites

Re: GUI with Perl

2007-03-15 Thread Chas Owens
On 3/15/07, yitzle <[EMAIL PROTECTED]> wrote: Can I make a GUI program with Perl? How? There are several options. Which one is best for depends on what you need it to do and what platforms you want it to run on. I would suggest the Gtk2 or Tk modules (install them through your package manager

Re: about creating an array

2007-03-15 Thread Chas Owens
On 3/15/07, yitzle <[EMAIL PROTECTED]> wrote: What do you mean? \s+\z will match 0 to all whitespace at end of the buffer. snip Just a quick correction: \s+ matches one or more whitespace characters \s* matches zero or more whitespace characters -- To unsubscribe, e-mail: [EMAIL PROTECTED] Fo

Re: GUI with Perl

2007-03-15 Thread yitzle
TIme for a quick factoid about me: I'm running Perl off Cygwin. No Gnome installed here. On 3/15/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 3/15/07, yitzle <[EMAIL PROTECTED]> wrote: > Can I make a GUI program with Perl? > How? There are several options. Which one is best for depends on what

Re: GUI with Perl

2007-03-15 Thread Chas Owens
On 3/15/07, yitzle <[EMAIL PROTECTED]> wrote: TIme for a quick factoid about me: I'm running Perl off Cygwin. No Gnome installed here. Then Tk is your best bet, although you may need to setup X. You may consider using ActiveState Perl instead. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: about creating an array

2007-03-15 Thread Rob Dixon
Jm lists wrote: 2007/3/16, John W. Krahn <[EMAIL PROTECTED]>: My guess is that the file 'itemid.txt' was created on DOS/Windows and you are running the program on some form of Unix. man dos2unix Or you could remove all trailing whitespace: while ( ) { s/\s+\z//; push @arr, $_; }

Re: GUI with Perl

2007-03-15 Thread yitzle
X is set up. Will look into ActiveState Perl, I guess. I noticed TK has Win32 stuff... On 3/15/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 3/15/07, yitzle <[EMAIL PROTECTED]> wrote: > TIme for a quick factoid about me: I'm running Perl off Cygwin. No > Gnome installed here. Then Tk is your bes

Sysadmin script for POP3

2007-03-15 Thread Craig Schneider
Hi Guys I am very new to perl. This is what I need to do: I need to parse text files in the /etc/mail folder for account names. The contents of the text file looks like this: # # Springbok Trucking # sean: [EMAIL PROTECTED] seanm:[EMAIL PROTECTED] bruce:

Re: Sysadmin script for POP3

2007-03-15 Thread Jeff Pang
># Springbok Trucking ># >sean: [EMAIL PROTECTED] >seanm:[EMAIL PROTECTED] >bruce:[EMAIL PROTECTED] >postmaster: stc >aubrey: stc >dicky:stc >claire: stc >daddy:stc >lorna:

Re: GUI with Perl

2007-03-15 Thread Octavian Rasnita
Yes you can. You can use Win32::GUI. It has a more simple interface than other libraries for creating GUIs and the programs are accessible for screen readers used by the blind also. The programs created with it will run only under Windows. If you want to create a portable program, also access

Re: How to revinent wget?

2007-03-15 Thread Alan
I wrote: > (ftp), however, does not work which I'd guess is due to difference in > communication method. Doh! (Net::FTP struck me upside the head!). (It works). Just give it a full url, either http:// or ftp:// The -c switch for continue in wget is probably not implemented in this Perl code (