RE: LDAP query giving no results

2006-03-17 Thread Gavin Henry
>> Have you tried the search with ldapsearch on the commandline first? >> Always best to do it that way. >> >> Gavin. >> > Sorry, but I attempted just ldapsearch ( very new to the ldap arena and > no real knowledge ( to say the least ) ) from a kornshell and cmd, but no > such exe found ( un

Re: LDAP query giving no results

2006-03-16 Thread Gavin Henry
> I attempting to pull some data, but get no errors and NO data. I am > following Graham Barr's examples with minor mods since it did seem to be > just right. Here is what I have leaving out the display of the data: > > #!perl > > use strict; > use warnings; > > use Net::LDAP; > > #INITIALI

Re: How to implement Sudoku Solver/Generator by using Perl

2006-03-02 Thread Gavin Henry
> Hi, > > Is this possible to build "application" which solves Sudokus puzzles and > also generates these ? I quess that I'm not only person on this planet who > is thinging this question ;) See this quarters The Perl Review: www.theperlreview.com > > - hannhirv - > > > -- > To unsubscribe, e-m

Re: New Website for Perl Beginners: perlmeme.org

2005-10-02 Thread Gavin Henry
Randal L. Schwartz said the following on 02/10/05 13:17: >>"Shlomi" == Shlomi Fish <[EMAIL PROTECTED]> writes: > > > Shlomi> Hi good people, > Shlomi> there's a new web-site for Perl beginners - perlmeme.org - > > Shlomi> http://perlmeme.org/ > > Unless it's hidden, I'm not finding any obv

Re: String Length for password length testing?

2005-08-24 Thread Gavin Henry
> On Wed, Aug 24, 2005 at 11:49:14AM +0100, Gavin Henry wrote: > >> Would someone be so kind as to offer a simple reason my test doesn't >> work? >> >> Should the le '6', I think so, but it never catches it? > > } elsif (length $newp

Re: String Length for password length testing?

2005-08-24 Thread Gavin Henry
> Ok first of all, if you are working with numbers you use < == <= >= !and > since you want to check the length of the password, you are > working with numbers. > Another thing, you must get the lenght of the string, using length(); > > So you need to do it this way: > if(length($newpasswd)<6) { >

String Length for password length testing?

2005-08-24 Thread Gavin Henry
Dear Guys, I am stuck at something really fundamental. I am coding a wee cgi page to change a OpenLDAP password, for Windows users on a Samba Server/LDAP backend. I haven't added any Net::LDAP stuff yet, just testing the basic password form. Would someone be so kind as to offer a simple reason m

Re: Ebay Sell Module

2005-06-02 Thread Gavin Henry
> Dear List, > > I know there is a EBay Search module on CPAN, but do you think there would > be any interest in a EBay Sell module. > > Something that gives us a way to resize your photos, put them on EBay or a > site of your choice and can fill out the sell form using WWW::Mechanize > > Thoughts

Ebay Sell Module

2005-06-02 Thread Gavin Henry
Dear List, I know there is a EBay Search module on CPAN, but do you think there would be any interest in a EBay Sell module. Something that gives us a way to resize your photos, put them on EBay or a site of your choice and can fill out the sell form using WWW::Mechanize Thoughts? Thanks. --

Re: The last element

2005-05-07 Thread Gavin Henry
On Saturday 07 May 2005 23:05, Peter Rabbitson wrote: > On Sat, May 07, 2005 at 04:13:12PM -0700, amr wrote: > > How can I call the last element in the array? > > > > I try the pop and it does the job but I think there is another way? > > If > my @a = (1, 2, 3, 4); > then: > > my $last

Re: The last element

2005-05-07 Thread Gavin Henry
On Saturday 07 May 2005 20:56, John W. Krahn wrote: > Gavin Henry wrote: > > On Sunday 08 May 2005 00:13, amr wrote: > >>How can I call the last element in the array? > >> > >>I try the pop and it does the job but I think there is another way? > > >

Re: The last element

2005-05-07 Thread Gavin Henry
On Sunday 08 May 2005 00:13, amr wrote: > How can I call the last element in the array? > > I try the pop and it does the job but I think there is another way? Of course, TMTOWTDI (http://catb.org/~esr/jargon/html/T/TMTOWTDI.html) $ARRAY[$#ARRAY--] See: http://perldoc.perl.org/functions/pop.ht

Re: Script critique?

2005-05-06 Thread Gavin Henry
On Friday 06 May 2005 22:41, Jason Balicki wrote: > Hello, > > I have several locations with a hardware VPN device and > I've set them up to log to a central logging server. > > Some of the managers of these facilities would like to > have a report showing who's using the VPN and when. > > I've wri

Re: Writing my first perl script

2005-05-06 Thread Gavin Henry
e ($line = <$path*.txt>) { > open (FILE, $line) or die "cannot open $line: $!\n"; > while () { > if ($line =~ /$num/ { > print $line; > } > } > close FILE; > } > Looks good. Does it work? > > -Original M

Re: Where will I find perl scripts

2005-05-06 Thread Gavin Henry
> Tielman Koekemoer (TNE) wrote: >> Hi All, >> >> I think I'm like most people learn Perl easier when examining other >> "guru's" scripts. Where is the best place on the net to find Perl >> scripts that do everything, from doing pattern matching in arrays to >> making coffee? >> >> Right now, howe

Re: Writing my first perl script

2005-05-06 Thread Gavin Henry
> > Hello, > > I'm not sure about the login or how I should approach what I want to > achieve. I require a script that does the following. Here are the quick answer, which provide you some reading material: > > 1. Search a directory and all sub-directories for a certain file > extension. (Ex. .t

Re: perl module to create pdf reports

2005-04-28 Thread Gavin Henry
On Thursday 28 Apr 2005 20:42, radhika wrote: > Hi, > I need to create some customized pdf reports and was wondering if there > are any perl modules out there to help. > I already have my perl script getting data from the db and creating a csv > file. I understand that there is an html2ps module wh

Re: First time Parsing XML

2005-04-02 Thread Gavin Henry
On Saturday 02 Apr 2005 04:29, Johnstone, Colin wrote: > Gidday All, > > I would like to use xml Parser to parse this chunk of xml (below) and > return the business unit name and id attributes for each of the elements > where division id = '221' > > I have tried Why not try: http://search.cpan.or

Re: Determining standard perl modules

2005-03-18 Thread Gavin Henry
> On Thu, 17 Mar 2005 10:48:30 -0500, Chris Charley wrote: >> >> > Dear all, >> > >> > How/where do I find out the standard bundled perl modules >> >> Hello Gavin, >> >> perldoc perlmodlib >> >> and then scroll to Standard Modules >> >> Chris Thanks. >> > > Or on the web, see: "http://search.cpa

Determining standard perl modules

2005-03-17 Thread Gavin Henry
Dear all, How/where do I find out the standard bundled perl modules, like: use DirHandle; use Cwd; use Getopt::Std; use File::Path; use File::stat; use POSIX I am building some RPMS, and need to know if I have to explicitly define the module requirements, as they might already come with a stand

Re: filehandle into a hash?

2005-03-10 Thread Gavin Henry
On Thursday 10 Mar 2005 20:28, Wiggins d'Anconia wrote: > Gavin Henry wrote: > > Dear all, > > > > I have the following: > > > > #!/usr/bin/perl > > use strict; > > use warnings; > > use Mail::Sendmail; > > > > my $from = '&

Re: filehandle into a hash?

2005-03-10 Thread Gavin Henry
On Thursday 10 Mar 2005 20:29, Gavin Henry wrote: > I should have searched cpan!! > > http://search.cpan.org/~jimt/Mail-Bulkmail-3.12/ Nevermind, overkill. So my question still stands. > > -- > Just getting into the best language ever... > Fancy a [EMAIL PROTECTED] o

Re: filehandle into a hash?

2005-03-10 Thread Gavin Henry
I should have searched cpan!! http://search.cpan.org/~jimt/Mail-Bulkmail-3.12/ -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] or something on http://www.perl.me.uk Just ask!!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTEC

filehandle into a hash?

2005-03-10 Thread Gavin Henry
Dear all, I have the following: #!/usr/bin/perl use strict; use warnings; use Mail::Sendmail; my $from = '"Test e-mails" <[EMAIL PROTECTED]>'; my $subject = 'Testing for survey e-mail'; open LIST, "; foreach () { my %mails = ( To => "$_", From=> "$from", Subject => "$sub

Re: code on stonehenge.com for adding line numbers to code

2005-03-02 Thread Gavin Henry
>>>>>> "Gavin" == Gavin Henry <[EMAIL PROTECTED]> writes: > >>> perl -pe 's/^/=$.= /' test.pl > > Gavin> That looks familiar > > Yup. > > From emacs: > step 1 - highlight Perl code as region > step 2 - ^U ESC ! e

Re: code on stonehenge.com for adding line numbers to code

2005-03-01 Thread Gavin Henry
-- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! > On Tue, Mar 01, 2005 at 08:51:58AM -0500, Wiggins d'Anconia wrote: > >>and I figure you can remove the assignment in the >> below, but I am not sure how >> >> perl -p -e '$_ = "=$.

Re: code on stonehenge.com for adding line numbers to code

2005-03-01 Thread Gavin Henry
> is this what you are looking for? > $count=1; > while() { > print OUTFILE "=$count++= $_"; > } It was more like perl -pi -e blah > > On Tue, 1 Mar 2005 11:23:44 - (GMT), Gavin Henry <[EMAIL PROTECTED]> > wrote: >> Dear all, >> >>

code on stonehenge.com for adding line numbers to code

2005-03-01 Thread Gavin Henry
Dear all, I remember reading how Randal puts the =1= =2= in front of each line of code on his site, but I can't find it again. Anyone remember? Thanks. -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

Re: setpwent

2005-03-01 Thread Gavin Henry
On Tuesday 01 Mar 2005 01:08, John W. Krahn wrote: > Gavin Henry wrote: > > Dear all, > > Hello, > > > How come if I: > > > > perldoc -f setpwent > > > > I don't get the same as shown here: > > > > http://www.perl.com/doc/manual/ht

setpwent

2005-02-28 Thread Gavin Henry
Dear all, How come if I: perldoc -f setpwent I don't get the same as shown here: http://www.perl.com/doc/manual/html/pod/perlfunc/setpwent.html the perldoc way didn't even say: setpwent - prepare passwd file for use -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] or

Re: Understanding split in a while loop

2005-02-28 Thread Gavin Henry
On Monday 28 Feb 2005 18:34, John W. Krahn wrote: > Gavin Henry wrote: > > Hi all, > > Hello, > > > Just a quickie. I think the answer is that th while loop is going through > > the file twice? > > > > -- > > Codes that does what I e

www.perldoc.com

2005-02-28 Thread Gavin Henry
Is anyone having trouble getting to this domain? I can never get a connection. -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Understanding split in a while loop

2005-02-28 Thread Gavin Henry
-- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! >> >> >>I am not sure why? It misses the odd ones. >> >>while () { >>my @passwds = split /:/, ; >> > You are reading the file twice in each while loop. Whenever you access > , it returns a line and moves to the

Understanding split in a while loop

2005-02-28 Thread Gavin Henry
Hi all, Just a quickie. I think the answer is that th while loop is going through the file twice? -- Codes that does what I expect, i.e. prints out the 42 lines of my passwd file, with the array spaces, due to the array in "", swapped for and runs on $_: #!/usr/bin/perl use strict;

Re: PDF Generation with PDF::API2 or similar

2005-02-22 Thread Gavin Henry
> Gavin Henry wrote: >> Dear Gurus, >> >> What is the preferred way to generate PDF file? >> >> I have never done this before and PDF::API2 seems to look good on cpan, >> but I can't find any tutorials. >> >> Anyone got any tips? >> &

Re: Perl waits for while to finish before printing if on the same line, why?(countdown prog)

2005-02-20 Thread Gavin Henry
On Monday 21 Feb 2005 04:08, Mark Jayson Alvarez wrote: > Hi, > I'm new to perl and i'm trying to create a simple > program that will act like a time bomb but will print > a dot(something like a progress bar every second until > the specified time arrives. Here's my code. > > my $countdown = 5; >

Re: Challenge (for me, at least)

2005-02-18 Thread Gavin Henry
On Friday 18 Feb 2005 23:16, Tyson Sommer wrote: > Is there any way to squeeze the following into one line? (assume using > CGI.pm and that my $q = new CGI;): Don't hijack threads. Please start another. -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] or something on htt

PDF Generation with PDF::API2 or similar

2005-02-17 Thread Gavin Henry
Dear Gurus, What is the preferred way to generate PDF file? I have never done this before and PDF::API2 seems to look good on cpan, but I can't find any tutorials. Anyone got any tips? -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! -- To unsubscribe, e-

Re: Effective Perl Programming - Still valid, dated 1998?

2005-02-16 Thread Gavin Henry
>>>>>> "Gavin" == Gavin Henry <[EMAIL PROTECTED]> writes: > > Gavin> I suppose certain parts of Perl, i.e. the fundamentals don't > Gavin> change, so it is probably worth it. > > There are definitely some timeless parts, but there are

Effective Perl Programming - Still valid, dated 1998?

2005-02-15 Thread Gavin Henry
y worth it. Mr Randal L. Schwartz? I know you read this list/group ;-) Should I buy this? -- Kind Regards, Gavin Henry. Managing Director. T +44 (0) 1467 624141 M +44 (0) 7930 323266 F +44 (0) 1224 742001 E [EMAIL PROTECTED] Open Source. Open Solutions(tm). http://www.suretecsystems.com/

Re: Subroutine for a scripts progress

2005-02-02 Thread Gavin Henry
> Dear all, > > I haven't coded anything yet, but I was wondering if it has been done, or > can be done to write a small sub that can be called to show how a script > is progressing? > > Like an on the sopt 1% 2% kind of thing or a hash progress? > > A small pointer to the correct feature/doc

RE: Subroutine for a scripts progress

2005-02-02 Thread Gavin Henry
> > you can use the perl debugger for that. > see > perldoc perldebug > Sorry, I should have been clearer, this is to show the end user how things are progressing. > > -Original Message- > From: Gavin Henry [mailto:[EMAIL PROTECTED] > Sent: Wednesday, Feb

Subroutine for a scripts progress

2005-02-02 Thread Gavin Henry
Dear all, I haven't coded anything yet, but I was wondering if it has been done, or can be done to write a small sub that can be called to show how a script is progressing? Like an on the sopt 1% 2% kind of thing or a hash progress? A small pointer to the correct feature/doc is all I am ask

Re: [OT - maybe] cgi-bin script being run three times?

2005-01-27 Thread Gavin Henry
-- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! > On Thu, 27 Jan 2005, Gavin Henry wrote: > >> my rsync.cgi script that I was taking about earlier, when run via >> cgi-bin, >> ps- aux soshow three copies of the same command. >>

[OT - maybe] cgi-bin script being run three times?

2005-01-27 Thread Gavin Henry
Dear all, my rsync.cgi script that I was taking about earlier, when run via cgi-bin, ps- aux soshow three copies of the same command. Does a cgi process fork 3 times, or is this an apache feature? A bit OT I know. -- Kind Regards, Gavin Henry. Managing Director. T +44 (0) 1467 624141 M +44

Re: CGI Rsync script to show backup in realtime for end user

2005-01-27 Thread Gavin Henry
g File::Rsync. Not sure how to grab it. Oh, I still need to put more checks in this: #!/usr/bin/perl # # program: rsync.cgi # # license: GPL # # author: Gavin Henry # # c

Re: CGI Rsync script to show backup in realtime for end user

2005-01-27 Thread Gavin Henry
On Thursday 27 Jan 2005 02:01, JupiterHost.Net wrote: > >> Is it possible for me to write a perl cgi script that will echo the > >> output from an rsync backup? > > > > Sure, why not :) > > > > Sorry, had to be done ;p > > > > More info needed, code you've tried, how you're doing rsync, etc > > > >

CGI Rsync script to show backup in realtime for end user

2005-01-26 Thread Gavin Henry
Dear all, Is it possible for me to write a perl cgi script that will echo the output from an rsync backup? Thanks. -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] or something on http://www.perl.me.uk Just ask!!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addi

Re: Can perl produce a huge-sized file for download testing?

2005-01-17 Thread Gavin Henry
> On Sun, 16 Jan 2005 22:53:29 -0800 (PST), [EMAIL PROTECTED] (Harold > Castro) wrote: > >>Hi, >> Our company is involved in internet service >>providing, and as such, troubleshooting our partner's >>links is one of our day to day activities. We have our >>own network monitoring system using mrt

Re: Formating a list into one line. Regex or Substition?

2004-11-22 Thread Gavin Henry
daggerquill said: > On Mon, 22 Nov 2004 08:56:59 +0000, Gavin Henry <[EMAIL PROTECTED]> wrote: >> Hi all, >> >> I have a log file a like this: >> >> The following packages were available in this version but NOT upgraded: >> Canna-devel-3.7p3-6.i386.

Re: Formating a list into one line. Regex or Substition?

2004-11-22 Thread Gavin Henry
Chris Devers said: > On Mon, 22 Nov 2004, Gavin Henry wrote: > >> I have a log file a like this: >> >> The following packages were available in this version but NOT upgraded: >> Canna-devel-3.7p3-6.i386.rpm >> GConf-devel-1.0.9-15.i386.rpm >> Guppi-dev

Formating a list into one line. Regex or Substition?

2004-11-22 Thread Gavin Henry
Hi all, I have a log file a like this: The following packages were available in this version but NOT upgraded: Canna-devel-3.7p3-6.i386.rpm GConf-devel-1.0.9-15.i386.rpm Guppi-devel-0.40.3-21.i386.rpm HelixPlayer-1.0.1.gold-6.i386.rpm Maelstrom-3.0.6-6.i386.rpm MagicPoint-1.11b-1.i386.rpm Network

Re: Searching tecknical documentation

2004-11-16 Thread Gavin Henry
Randal L. Schwartz said: >> "K-sPecial" == K-sPecial <[EMAIL PROTECTED]> writes: > > K-sPecial> Damn (if I may say so), nice link. > > Die, pirate scum. > > You insult me personally by pirating my words. How do you expect > me to have the means to write future books? Well said. > > -- > Ra

Re: Searching tecknical documentation

2004-11-16 Thread Gavin Henry
Stephen Liu said: > Hi folks, > > Please advise where can I find similar free > documentation on Internet, like; > > programming perl (O'reilly) > Learning Perl (Llama) > Programming Perl (Camel) > Perl Cookbook (Ram) You can't that's why they charge for it ;-) > Google search brought me tons

Re: Sourcing Configuration files

2004-11-03 Thread Gavin Henry
Chris Devers said: > On Tue, 2 Nov 2004, Gavin Henry wrote: > >> What is the easiest way to move variable declarations out into a file >> in /etc/ and requiring a perl program to read them in at startup. If >> they are not there, then the program must complain. > >

Re: Sourcing Configuration files

2004-11-02 Thread Gavin Henry
Wiggins d Anconia said: >> Ramprasad A Padmanabhan said: >> > On Tue, 2004-11-02 at 13:41, Gavin Henry wrote: >> >> Hi all, >> >> >> >> What is the easiest way to move variable declarations out into a > file in >> >> /etc/ a

Re: Sourcing Configuration files

2004-11-02 Thread Gavin Henry
Ramprasad A Padmanabhan said: > On Tue, 2004-11-02 at 13:41, Gavin Henry wrote: >> Hi all, >> >> What is the easiest way to move variable declarations out into a file in >> /etc/ and requiring a perl program to read them in at startup. If they >> are >> no

Sourcing Configuration files

2004-11-02 Thread Gavin Henry
Hi all, What is the easiest way to move variable declarations out into a file in /etc/ and requiring a perl program to read them in at startup. If they are not there, then the program must complain. Thanks. P.S> I can't seem to find it in my O'reilly books. -- Just getting into the best langua

Monitoring a mount through a ssh tunnel

2004-11-01 Thread Gavin Henry
Dear all, I hope everyone has been busy ;-) Got another wee program that I would like to try and write. Problem: We have a ssh tunnel with a samba mount across it from one city to the other, if one city is unreachable, the tunnel needs to be brought back up and the mount remounted. Methodol

Re: Matching repeated lines.

2004-10-06 Thread Gavin Henry
Paul Johnson said: > On Wed, Oct 06, 2004 at 01:42:43PM +0100, Gavin Henry wrote: > >> I want to read in a file and print repeated lines like: >> >> yum >> yum >> >> or >> >> xorg-x11 >> xorg-x11 >> >> >> What's the

Matching repeated lines.

2004-10-06 Thread Gavin Henry
Sorry to post again on a new thread, but I think I need to clear my basci problem up. I want to read in a file and print repeated lines like: yum yum or xorg-x11 xorg-x11 What's the best way to do this? A RE or a module from CPAN? -- Just getting into the best language ever... Fancy a [EMA

Re: Matching two seperate lines that begin with the same word

2004-10-06 Thread Gavin Henry
Gavin Henry said: > My brain is broken today. > > I have a file with a list of installed rpm packages, some of them are > duplicated and I want to sort the file/llist and print ones that have the > same name, like: > > yum-2.0.7 > yum-2.0.8 > > Then I am going to c

Matching two seperate lines that begin with the same word

2004-10-06 Thread Gavin Henry
My brain is broken today. I have a file with a list of installed rpm packages, some of them are duplicated and I want to sort the file/llist and print ones that have the same name, like: yum-2.0.7 yum-2.0.8 Then I am going to clean up the rpmdb Any tips, apart from reading my llama book ;-) -

Re: perl regex to array

2004-10-05 Thread Gavin Henry
Ramprasad A Padmanabhan said: > Hi, > > I have slightly a tricky situation, in my large program. I am trying the > best to reproduce it > > > I have a string like this > $x='a{1}b{21}c{5}d'; > # The numbers in the {} are random and are not of interest > > I want to access all elements from the st

Re: Becoming Disenheartened - Everyone talks about Python and saysPerl is old news.

2004-10-01 Thread Gavin Henry
Randal L. Schwartz said: >>>>>> "Gavin" == Gavin Henry <[EMAIL PROTECTED]> writes: > > Gavin> I have just read this famous peice: > > Gavin> > http://www.linuxjournal.com/article.php?sid=3882&mode=&order=&thold= > > I'

RE: Becoming Disenheartened - Everyone talks about Python and saysPerl is old news.

2004-10-01 Thread Gavin Henry
> Could you guys keep this thread constructive or STOP it ... Please ? > It's been very constructive for me :-) I have just read this famous peice: http://www.linuxjournal.com/article.php?sid=3882&mode=&order=&thold= I am going to learn both and make up my own mind. I think that's the best for

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-30 Thread Gavin Henry
On Thursday 30 Sep 2004 13:19, Randal L. Schwartz wrote: > > "John" == John W Krahn <[EMAIL PROTECTED]> writes: > > John> You might hurt his feelings, he didn't contribute to the third > edition John> of Programming Perl. > > Actually, it's worse than that. I contributed to it, but wasn't cred

Re: How Can I rename File using Perl?..

2004-09-30 Thread Gavin Henry
> Moreover, rename() is a basic part of Perl, so even on Linux there is no > need to do this with a system call to the `mv` command. Of course, doh. -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: How Can I rename File using Perl?..

2004-09-30 Thread Gavin Henry
Roime bin Puniran said: > How can i rename any file using PERL?...Where should i start?..Where i can find any tutorial? using linux: man mv you can use a system() call or backticks `` > > This e-mail and any attachments may contain confidential and > privileged information. If you are not the i

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-29 Thread Gavin Henry
JupiterHost.Net said: > My what long lines you have :) > >> It may not be commercial grade but, who of us writes commerical >> applications all the time. > > I do mostly, private corporate backends mostly among other things :) > I use it for the quick tasks and simple scripts also of course. (the >

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-29 Thread Gavin Henry
John W. Krahn said: > Gavin Henry wrote: >> Randal L. Schwartz said: >>> >>>Remember "new coke", and how long we had that. (If you're old enough >>>to remember that fiasco.) >> >> Again, thanks for this. My morale is now completel

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-29 Thread Gavin Henry
Randal L. Schwartz said: >>>>>> "Gavin" == Gavin Henry <[EMAIL PROTECTED]> writes: Wow I didn't know that you read this list. I am learning from your book and I am catching up with all the columns you have ever published on your site. I am actuall

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-28 Thread Gavin Henry
utes that > takes others days. It may not be commercial grade but, who of us writes > commerical applications all the time. 90% of the time, I'm trying to > accomplish a simple task or test a theory. You can't beat Perl for that. Agreed. Thanks for this. My morale is up, but it&#

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-28 Thread Gavin Henry
On Tuesday 28 Sep 2004 22:11, John W. Krahn wrote: > Gavin Henry wrote: > > By the way, my program now works great thanks to your sub advice. I still > > have some cleaning to do, like my resize sub abd incorporating file tests > > etc. > > > > You can see how b

Re: Problem iterating over diamond (while)

2004-09-28 Thread Gavin Henry
Gavin Henry said: >> Can we actually loop over the 'while diamond'? >> Please kindly advice how can I overcome this problem. > > I don't know if I'm skilled enough to answer this yet, but shouldn't you > be using: Nope, sorry. It helps if I *actually*

Re: Problem iterating over diamond (while)

2004-09-28 Thread Gavin Henry
> Can we actually loop over the 'while diamond'? > Please kindly advice how can I overcome this problem. I don't know if I'm skilled enough to answer this yet, but shouldn't you be using: my @myarray = ; foreach (@myarray) { do stuff } > Thanks so much for your time. > > Regards, > Edward WIJA

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-28 Thread Gavin Henry
David Garamond said: > Gavin Henry wrote: >> I really like Perl, but lately everywhere I seem to go and talk to say I >> shouldn't be learning Perl as it's old and Python is better. > > My Good Lord, where have you been? Python is _already_ old news. Ruby, > bab

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-28 Thread Gavin Henry
Wiggins d Anconia said: >> I really like Perl, but lately everywhere I seem to go and talk to say I >> shouldn't be learning Perl as it's old and Python is better. >> > > I'm impressed, come to the Midwest in the US, around here they have only > heard of M$ and Cobol. Ironically, Python is showing

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-28 Thread Gavin Henry
Paul Kraus said: >> I really like Perl, but lately everywhere I seem to go and talk to say I >> shouldn't be learning Perl as it's old and Python is better. > Lets pretend we are mechanics we have this one tool that was passed on > down from generation to generation. It is our very very very favori

Re: Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-28 Thread Gavin Henry
JupiterHost.Net said: > > > Gavin Henry wrote: >> I really like Perl, but lately everywhere I seem to go and talk to say I > > Me too :) > >> shouldn't be learning Perl as it's old and Python is better. > > Python is different not necessarily better. &

Becoming Disenheartened - Everyone talks about Python and says Perl is old news.

2004-09-28 Thread Gavin Henry
I really like Perl, but lately everywhere I seem to go and talk to say I shouldn't be learning Perl as it's old and Python is better. Since starting to learn Perl though, every other language I started to learn/t, C, PHP etc. seem to make more sense now, as Perl has cleared things up. When I look

Re: Help with putting a subroutine into a variable?

2004-09-26 Thread Gavin Henry
> # send an email with @email_list > > # store to a database with @db_list > > Now your sub is generic, it doesn't rely on the specific names, @pics > and $website, and doesn't cause data to be printed when you might not > want it to. Obviously this is a contrived example but as things get > more

Re: Help with putting a subroutine into a variable?

2004-09-24 Thread Gavin Henry
Wiggins d Anconia said: >> Hi all, >> >> I have this: >> >> - >> #!/usr/bin/perl >> >> use warnings; >> use strict; >> > > Good start. Courtesy of the Lama :-) >> my @pics = <*.jpg>; >> my $website = 'http://www.website.com/uploads'; >> >> sub links { >> foreach (@pics) {

Re: Help with putting a subroutine into a variable?

2004-09-24 Thread Gavin Henry
> Your sub breaks encapsulation because it relies on the fact that @pics > and $website are available in the sub but have not been passed into it. > Generally we want our subs to take arguments and return values. If you > were to move this sub to the top of the file or to another file (such as > a

Help with putting a subroutine into a variable?

2004-09-24 Thread Gavin Henry
Hi all, I have this: - #!/usr/bin/perl use warnings; use strict; my @pics = <*.jpg>; my $website = 'http://www.website.com/uploads'; sub links { foreach (@pics) { print "$website/$_\n"; } } - I would normally call the subroutine like

Re: Optimize Problem

2004-09-23 Thread Gavin Henry
Millhost said: > Dear All > > I am using this script to get my maillog information > > ## > %IP_LOG=(); > open (LOG,/var/log/maillog); > foreach () { > if (/Sep 20/) { > $IP_LOG{$_}++; > } > } > ## > I found this script will take 3-4 second when my log file in 40MB > But I try using gerp "Sep 20" /

Re: Optimize Problem

2004-09-23 Thread Gavin Henry
Millhost said: > Dear All > > I am using this script to get my maillog information > > ## > %IP_LOG=(); > open (LOG,/var/log/maillog); > foreach () { > if (/Sep 20/) { > $IP_LOG{$_}++; > } > } > ## > I found this script will take 3-4 second when my log file in 40MB > But I try using gerp "Sep 20" /

Encrypting an in script password and wxperl

2004-09-22 Thread Gavin Henry
Dear all, My next program is to help out my wife. It will resize some jpg's, upload them via ftp to a website and email her the links of where they are. She will use these for ebay listings. I also want a wee pop up box to ask for the file or directory of the pictures. I might have two version of

Re: System or Backticks? - Don't reply, searched archives :-)

2004-09-02 Thread Gavin Henry
Sorry, this has been asked a million times, as I just foun din the archives and perlmonk. Don't bother replying :-) Gavin. -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

System or Backticks?

2004-09-02 Thread Gavin Henry
Hi all, Still thinking about this one. I have: my $backup = system($rdiff, @args); # Send e-mail with a few details for success and failures # Success if ($backup == 0) { blah } I want to be able to stick the ouput of the $rdiff command into a strong, as well as get an exit code for it? Is th

grabbing prpgrams output for logfile

2004-08-31 Thread Gavin Henry
Hi again, I thought I would make a new one for this: my $backup = system( $rdiff, @args); Could I write $backup to my logfile? Gavin. -- Kind Regards, Gavin Henry. Managing Director. T +44 (0) 1467 624141 M +44 (0) 7930 323266 F +44 (0) 1224 742001 E [EMAIL PROTECTED] Open Source. Open

RE: grabbing programs output for logfile

2004-08-31 Thread Gavin Henry
Jim said: > >> -Original Message- >> From: Gavin Henry [mailto:[EMAIL PROTECTED] >> Sent: Tuesday, August 31, 2004 10:11 AM >> To: [EMAIL PROTECTED] >> Subject: grabbing programs output for logfile >> >> Hi all, >> >> I thought I

Re: Could this be made shorter and cleaner?

2004-08-31 Thread Gavin Henry
Daniel Staal said: > --As of Tuesday, August 31, 2004 10:07 AM +0100, Gavin Henry is alleged to > have said: > >> P.S. I am now a programmer or a scripter, I am not sure is perl is >> programming or scripting? I think programming. > > --As for the rest, it is mine. >

RE: Could this be made shorter and cleaner?

2004-08-31 Thread Gavin Henry
stat is a new one for me, am only on Chapter 7 in Learning Perl. I will have to come back to this script when I get a bit further. All good though :-) -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addi

RE: Could this be made shorter and cleaner?

2004-08-31 Thread Gavin Henry
Thanks for your time Chris. I will do the same when I get a bit better for others. Let me digest this and get back to you. Gavin. Chris Devers said: > On Tue, 31 Aug 2004, Gavin Henry wrote: > >> I have split the options up tp $option1 and $option2: >> >> http://www.pe

grabbing programs output for logfile

2004-08-31 Thread Gavin Henry
Hi all, I thought I'd start a new thread for this one: my $backup = system( $rdiff, @args); Could I use $backup to write to my logfile? Gavin. -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

RE: Could this be made shorter and cleaner?

2004-08-31 Thread Gavin Henry
> Since there's more than one argument to system(), the shell is bypassed, > and > execve(2) sees a single file name "/etc/services /etc/protocols" instead > of > two separate file names. Hence, the error message. > I have split the options up tp $option1 and $option2: http://www.perl.me.uk/downl

RE: Could this be made shorter and cleaner?

2004-08-31 Thread Gavin Henry
Bob Showalter said: > Gavin Henry wrote: >> On Tuesday 31 Aug 2004 01:51, you wrote: >> > 2. The way you're calling system() looks odd. You're using more >> > than one arg, which is a signal to bypass the shell. But your >> > second arg looks like

Re: Could this be made shorter and cleaner?

2004-08-31 Thread Gavin Henry
John W. Krahn said: > Gavin Henry wrote: >>>It looks like 99% of the code in both blocks is exactly the same. You >>>should >>>factor out duplicated code. >>> >>>my $msg = $backup ? 'failed' : 'completed'; >>> >&

Re: Could this be made shorter and cleaner?

2004-08-31 Thread Gavin Henry
> It looks like 99% of the code in both blocks is exactly the same. You > should > factor out duplicated code. > > my $msg = $backup ? 'failed' : 'completed'; > > my %mails = ( > To => $to, > From=> $from, > Subject => "Remote backup $msg from $ENV{HOSTNAME} on $time", >

  1   2   >