RE: using perl ot connect to a database

2007-03-14 Thread Thomas Bätzler
Hi, FamiLink Admin <[EMAIL PROTECTED]> asked: > 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 Try mysql> show variables like 'socket'; +---+-

Re: How to revinent wget?

2007-03-14 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

using perl ot connect to a database

2007-03-14 Thread FamiLink Admin
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 #!/usr/bin/perl use strict; use warnings; use DBI; $ENV{MYSQL_UNIX_PORT} = "/var/lib/mysql/mysql.sock"; my $dsn = "DBI:mysq

Re: Wanted: perl script to download iso files from web page

2007-03-14 Thread Bill Jones
On 3/14/07, siegfried <[EMAIL PROTECTED]> wrote: I'm looking at http://cpan.org/scripts/Networking/index.html and I don't see any obvious scripts that would meet my need. I'm looking for a script that would scrape a web page for all the downloadable iso files and download them. I would sugges

Re: What are the brackets used for

2007-03-14 Thread Mathew Snyder
Thanks. That's what I thought it was doing but wasn't sure. Mathew John W. Krahn wrote: > Mathew Snyder wrote: >> my $timeworked = {}; > > In this context they represent an anonymous hash, the reference of which is > assigned to the scalar variable. It is usually not necessary because of > aut

Re: What are the brackets used for

2007-03-14 Thread John W. Krahn
Mathew Snyder wrote: > my $timeworked = {}; In this context they represent an anonymous hash, the reference of which is assigned to the scalar variable. It is usually not necessary because of autovivification. John -- Perl isn't a toolbox, but a small machine shop where you can special-order c

Re: Matching the domain of a URL

2007-03-14 Thread Randal L. Schwartz
> "Grant" == Grant <[EMAIL PROTECTED]> writes: Grant> Hello, I need to do some special processing if the domain of a URL Grant> string matches a set of possible values. I'd like to catch http and Grant> https. What is the best way to do that? Keep in mind that www.stonehenge.com can be wri

What are the brackets used for

2007-03-14 Thread Mathew Snyder
my $timeworked = {}; Mathew -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Matching the domain of a URL

2007-03-14 Thread Grant
My fault. The reason it does not match is the colon placement. It will match http//:images.google. Thanks, I really should have noticed that myself. - Grant > Can you correct my syntax? I can't get this to match: > > if ($Scratch->{url} =~ /^https?\/\/:images\.google\./) { > > The value of r

RE: polling a directory

2007-03-14 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Beginner [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 14, 2007 10:56 > To: beginners@perl.org > Subject: polling a directory > > Hi, > > I am trying to find a means of monitoring a directory for activity. I > would like a perl process to aware if a fil

Re: How to revinent wget?

2007-03-14 Thread Yitzchok Good
I did something similar... What I would do it wget the webpage, go through the page with RegEx and look for ] "[^"].iso" and stick the URLs into a text file. Then feed the textfile to wget (-i switch) and you're done ;) On 3/14/07, siegfried <[EMAIL PROTECTED]> wrote: I'm downloading a lot of de

Re: Matching the domain of a URL

2007-03-14 Thread yitzle
My fault. The reason it does not match is the colon placement. It will match http//:images.google. Can you correct my syntax? I can't get this to match: if ($Scratch->{url} =~ /^https?\/\/:images\.google\./) { The value of referrer is exactly: http://images.google. -- To unsubscribe, e-mai

Re: polling a directory

2007-03-14 Thread Igor Sutton Lopes
On 2007/03/14, at 17:55, Beginner wrote: Hi, I am trying to find a means of monitoring a directory for activity. I would like a perl process to aware if a file has been dropped into a specific folder and then take some action. In the past I have used cron for this but I was thinking this isn'

Re: Matching the domain of a URL

2007-03-14 Thread Igor Sutton Lopes
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.google.com/?some_bizarre_args https://my.domain.com https://my.domain.net h

polling a directory

2007-03-14 Thread Beginner
Hi, I am trying to find a means of monitoring a directory for activity. I would like a perl process to aware if a file has been dropped into a specific folder and then take some action. In the past I have used cron for this but I was thinking this isn't the best choice because 1) You have to s

Re: Perl-based content managers

2007-03-14 Thread Igor Sutton Lopes
On 2007/03/14, at 17:43, Tom Smith wrote: Thank for the reply... I actually use Twiki internally, for our Corporate Intranet. I have looked at Bricolage, but I don't think it suites my needs (though it looks like an awesome piece of software). The bottom line is that I'm not very profici

Re: Perl-based content managers

2007-03-14 Thread Tom Smith
Igor Sutton Lopes wrote: On 2007/03/14, at 17:13, Tom Smith wrote: I've been trying to find a good Perl-based content manager. There are a myriad of PHP ones available, complete with site design templates and such (like phpWebSite and Joomla)--but Perl-based ones seem to be pretty sparse.

Re: Matching the domain of a URL

2007-03-14 Thread Grant
regex. if ( m/^https?\/\/:blah\.com/) Can you correct my syntax? I can't get this to match: if ($Scratch->{url} =~ /^https?\/\/:images\.google\./) { The value of referrer is exactly: http://images.google. - Grant > Hello, I need to do some special processing if the domain of a URL > strin

Re: Perl-based content managers

2007-03-14 Thread Igor Sutton Lopes
On 2007/03/14, at 17:13, Tom Smith wrote: I've been trying to find a good Perl-based content manager. There are a myriad of PHP ones available, complete with site design templates and such (like phpWebSite and Joomla)--but Perl-based ones seem to be pretty sparse. I was really hoping to

Perl-based content managers

2007-03-14 Thread Tom Smith
I've been trying to find a good Perl-based content manager. There are a myriad of PHP ones available, complete with site design templates and such (like phpWebSite and Joomla)--but Perl-based ones seem to be pretty sparse. I was really hoping to go Perl-based with the CMS, but if I can't... I

Re: [SPAM] Re: Accessing packed data structures

2007-03-14 Thread Vincent Li
On Wed, 14 Mar 2007, Dharshana Eswaran wrote: On 3/13/07, Tom Phoenix <[EMAIL PROTECTED]> wrote: On 3/13/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: > I was going thro the topic "Accessing packed data structures" in the Perl > Complete Reference Book. I came across this example: > >

Re: precision

2007-03-14 Thread Tom Phoenix
On 3/14/07, louis fridkis <[EMAIL PROTECTED]> wrote: Why does Perl say 10.2 is 10.199 Because it is. Within the limits of precision of your floating point format, you're talking about the same number. This isn't just Perl; every programming language has _something_ like this. Some hi

Re: precision

2007-03-14 Thread Mumia W.
On 03/14/2007 11:19 AM, louis fridkis wrote: Why does Perl say 10.2 is 10.199 Here is example code and output: #!/usr/bin/perl -w $add = 10.2; print "$add\n"; printf "$add\n"; printf ("%40.35f\n", $add); perl add1.pl 10.2 10.2 10.19928945726423989981413 If you have the

Re: How to revinent wget?

2007-03-14 Thread Igor Sutton Lopes
On 2007/03/14, at 16: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 all?

Re: Matching the domain of a URL

2007-03-14 Thread Igor Sutton Lopes
On 2007/03/14, at 15:55, Jeff Pang wrote: Hello, I just think regex is the best way since you choose to use Perl doing this work. Regexp::Common::URI may be what you're looking for. -- Igor Sutton [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Wanted: perl script to download iso files from web page

2007-03-14 Thread siegfried
I'm looking at http://cpan.org/scripts/Networking/index.html and I don't see any obvious scripts that would meet my need. I'm looking for a script that would scrape a web page for all the downloadable iso files and download them. Can someone recommend such a script? Are there some other good pe

precision

2007-03-14 Thread louis fridkis
Why does Perl say 10.2 is 10.199 Here is example code and output: #!/usr/bin/perl -w $add = 10.2; print "$add\n"; printf "$add\n"; printf ("%40.35f\n", $add); perl add1.pl 10.2 10.2 10.19928945726423989981413 -- Lou Fridkis Human Genetics 57920

How to revinent wget?

2007-03-14 Thread siegfried
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 all? Assuming such a script does not exist, can someon

Re: Matching the domain of a URL

2007-03-14 Thread Grant
regex. if ( m/^https?\/\/:blah\.com/) Ok, how can I pass in the value I want evaluated? Sorry I'm such a beginner. - Grant > Hello, I need to do some special processing if the domain of a URL > string matches a set of possible values. I'd like to catch http and > https. What is the best wa

Re: Matching the domain of a URL

2007-03-14 Thread yitzle
regex. if ( m/^https?\/\/:blah\.com/) On 3/14/07, Grant <[EMAIL PROTECTED]> wrote: Hello, I need to do some special processing if the domain of a URL string matches a set of possible values. I'd like to catch http and https. What is the best way to do that? - Grant -- To unsubscribe, e-mai

Re: Matching the domain of a URL

2007-03-14 Thread Jeff Pang
> >Hello, I need to do some special processing if the domain of a URL >string matches a set of possible values. I'd like to catch http and >https. What is the best way to do that? > Hello, I just think regex is the best way since you choose to use Perl doing this work. -- To unsubscribe, e-m

Matching the domain of a URL

2007-03-14 Thread Grant
Hello, I need to do some special processing if the domain of a URL string matches a set of possible values. I'd like to catch http and https. What is the best way to do that? - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.pe

Re: Sorting an Array of Arrays

2007-03-14 Thread Randal L. Schwartz
> ""Mumia" == "Mumia W " writes: "Mumia> On 03/13/2007 07:44 PM, Hardly Armchair wrote: >> Hello List, >> I have a data structure containing a bunch of strings in different groups: >> [...] >> I want these sorted first alphabetically within the group, and then >> according to the number of me

Re: how to use require??

2007-03-14 Thread Randal L. Schwartz
> ""Mumia" == "Mumia W " writes: "Mumia> $dsn and $dbh are lexical variables that are restricted to dbcon.pl. You might "Mumia> want to consider using package variables. e.g: Or, just figure out how to break apart your program properly. Export behavior, not data. Create a package that pro

Re: Accessing packed data structures

2007-03-14 Thread Chas Owens
On 3/14/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: snip > The data which i need to pack and unpack to these elements are in hex > format(0x0B 0x1C 0x34 etc). It is a string of hex bytes. > Can i know about the format in which i need to supply the input? Coz i am unable to accept the hex st

Re: how to use require??

2007-03-14 Thread Mumia W.
On 03/14/2007 05:37 AM, Umar Draz wrote: HI dear members! I have a file called dbcon.pl into include directory. #!/usr/local/bin/perl use DBI; # Database Username, Password and Driver settings my $user="konsole"; my $pass="send"; my $host="localhost"; my $driver="mysql"; my $db="treat"; my $tn

Re: how to use require??

2007-03-14 Thread Jeff Pang
-Original Message- >From: Umar Draz <[EMAIL PROTECTED]> >Sent: Mar 14, 2007 6:37 PM >To: beginners@perl.org >Subject: how to use require?? > >HI dear members! I have a file called dbcon.pl into include directory. > >#!/usr/local/bin/perl > >use DBI; > ># Database Username, Password and Dr

how to use require??

2007-03-14 Thread Umar Draz
HI dear members! I have a file called dbcon.pl into include directory. #!/usr/local/bin/perl use DBI; # Database Username, Password and Driver settings my $user="konsole"; my $pass="send"; my $host="localhost"; my $driver="mysql"; my $db="treat"; my $tnt="xyz"; # Connect Database my $dsn = "DBI

Re: Accessing packed data structures

2007-03-14 Thread Jenda Krynicky
From: "Dharshana Eswaran" <[EMAIL PROTECTED]> > I was going thro the topic "Accessing packed data structures" in the Perl > Complete Reference Book. I came across this example: > > struct utmp { > char ut_user[8]; /* User login name */ > char ut_id[4]; /* /etc/inittab id */ > char ut_line[12]; /*