Re: Starting with perl...

2001-05-29 Thread Collin Rogowski
Ops. Sorry about that. Next time I clean my waepons before using them. cr On Tue, 29 May 2001 12:08:43 -0500, Elaine -HFB- Ashton said: > Collin Rogowski [[EMAIL PROTECTED]] quoth: > *>You find a very complete set of documentation on www.perl.com. > *>Here is a direct lin

Re: Starting with perl...

2001-05-29 Thread Collin Rogowski
You find a very complete set of documentation on www.perl.com. Here is a direct link to a "getting started" document: http://www.perl.com/pub/doc/manual/html/pod/perl.html cr On Tue, 29 May 2001 17:59:27 + (UTC), William Maddler said: > > I'm just startin' with Perl, any clue on where to

Re: Connecting to other computers.

2001-05-29 Thread Collin Rogowski
I think the easiest way woul be to start an FTP-Server on the Windows-Box and connect via FTP. This is very easy in Perl. Try to look at the Net::FTP Module on CPAN (cpan.org). hope this helps, cr On Tue, 29 May 2001 07:49:54 -0800, Mark on GCI Server said: > Hey all, >I'm trying to copy

Re: newbie need help

2001-05-26 Thread Collin Rogowski
> well, i want to learn perl, but i just kwon it is for web pages, how do i > start writing(learning) perl? what do i need to do that? If you know how to program in any other language see 1, otherwise see 2. 1. Just think up a program you would like to have and start writing it in Perl. I w

Re: DBI

2001-05-22 Thread Collin Rogowski
Could you show us the part of your code which calls the connect method, and perhaps the exact error message? cr On Wed, 23 May 2001 13:30:41 +0700, prasoeu said: > Hi > I have problem about DBI library, when I connect asking me library not found >DBI? > > Please tell me. > > Prasoe

Re: Arrays

2001-05-22 Thread Collin Rogowski
> if ($var ==2) > { > foreach $email (@in) > { > Then here is where I will send the mail. > } > > } > > > Why is this not working? Can you tell us a bit more about the problem. Are there any error-messages, etc? A bit more code wo

Re: truncating a string

2001-05-18 Thread Collin Rogowski
This should work! Can you give us a bit more context? To be precise: $title = "The Linux Programmer's Guide "; $title =~ s/\s*$//; That works. If you don't get "The Linux Programmer's Guide" there has to be something wrong in the code around that bit. cr On Fri, 18 May 2001 12:08:25

Re: flush - ?

2001-05-17 Thread Collin Rogowski
Normally all filehandles (except STDERR, I think) are buffered. That means that if you write a character (or a byte) on a filehandle, the system does not write it on the disk immediatly, but waits till it's buffer is full and than writes the whole buffer. This saves many IO-Operations, which resul

Re: Oracle Database...

2001-05-15 Thread Collin Rogowski
The problem seems to be that the Oracle Driver does not implement the rows function. Quote from 'perldoc DBI': ""rows"" $rv = $sth->rows; Returns the number of rows affected by the last row affecting command, or -1 if the number of rows is not known or

Re: Array Size Question(s)

2001-05-14 Thread Collin Rogowski
First part: You get the size of an array by using it in a scalar context. Sounds complicated? Scalar context means that the left side of an assignment is a scalar. So you just write: $size = @a; and you get the size of the array @a. Another method would be to get the index of the last element a

Re: Help with cgi-script

2001-05-14 Thread Collin Rogowski
You cannot call passwd with the password as a parameter. (btw. this is a feature, not a bug :-) Look at the Expect Module (available on CPAN). It lets you automate interactive programs (like passwd). hope that helps, cr On Mon, 14 May 2001 09:10:54 +0100, n6tadam said: > Dear List, > > I am

Re: Process a single field file

2001-05-09 Thread Collin Rogowski
Can you sepcify what your problem is, exactly. At a first glance your code looks fine... cr On Wed, 09 May 2001 17:49:16 +1000, Clayton Winter said: > Hi very new to perl... am getting some books asap. > > I am writing a script to create named.conf records from a single field > text file

Re: generating passwords

2001-05-05 Thread Collin Rogowski
This generates passwords consisting of letters (lower and uppercase), numbers and printable punctuation (?,.-_[(, etc.) (ASCII 48 - 122). $required_length = 10; for ($i = 0; $i < $required_length; $i++) { $passwd .= chr(int(rand(123 - 48) + 48)); } print $passwd, "\n"; Discussion: rand(123 -

Re: simple backup script

2001-05-03 Thread Collin Rogowski
Between backquotes you can use Perl Variables. Try something like this: $time = time(); #$time has now the current unixtime `tar -czvf /var/tar-logs/file-$time.tgz /usr/local/etc/httpd/logs` hope this helps, cr On Thu, 03 May 2001 16:29:56 -0700, Chris Bourne said: > If someone will I need h

Re: Fun with Date formatting

2001-05-03 Thread Collin Rogowski
You should look at the Date::Parse Module. You can get it from CPAN. cr On Thu, 3 May 2001 14:48:51 -0400, Craig Moynes/Markham/IBM said: > My task is to create a Log file pruner for multiple types of logfiles. Now > this being reality both record seperators and date formats vary from log to

Re: Problem with reading string from commandline

2001-05-03 Thread Collin Rogowski
#x27;ve been busy with it now for two weeks, and I still don't know >how to get it working perfectly. I'm used to C, and perl is rather new to me. Thanks >in advance. > > I would like to thank Collin Rogowski and Greg Meckes for helping me the other day, >getting some st

Re: Strange chop behaviour

2001-05-01 Thread Collin Rogowski
They exist both. chop removes the last character. chomp removes the last character if it's newline. To the original problem: I had a similar problem once. Maybe your file has DOS-Newlines which are to characters (\r\n). If you chop, you keep \r at the end which could mess around with printing it

Re: Problem with reading string

2001-05-01 Thread Collin Rogowski
I didn't quite get what your problem was. Can you elaborate on that? There are a couple of newbie problems in your script: > ## > #!/usr/bin/perl You should say: !/usr/bin/perl -w This turns on warnings (which is very helpful

Re: unexpected re output

2001-04-30 Thread Collin Rogowski
The problem is the \ before the . in your regex. On Mon, 30 Apr 2001 12:06:55 +0100, Gary Stainburn said: > Hi all, > > can anyone tell me why the following code does not come out with > '-123.45'. It actually comes out with '123.45-'. > > I think that it is because it's treating it as

Re: dbi

2001-04-29 Thread Collin Rogowski
On Mon, 30 Apr 2001 08:03:23 +0200, justin todd said: > Hi all. > I am in desparate need of advice. > I am running a NT4.0/IIS server and a MSSQL7 database. I ahve got Perl > working fine on the Web Server but I cannot perform simple function on > the Database. Below is my code and the diff

RE: DBI and Oracle

2001-04-25 Thread Collin Rogowski
You the Oracle-Client Installation on the machine  where you want to use DBD::Oracle.  This should be an option in the Oracle installer.  If I remember correctly Pro*C is an option you  have to select in the installer as well.    cr  On Wed, 25 Apr 2001 15:22:05 +0200, Emma Wermström (EMW)<[EMAIL

Re: [BPQ] help!! any idea whats wrong with this??

2001-04-24 Thread Collin Rogowski
The problem is that you override the (global) array @words for each line. You go through @lines and the split overrides @words! While we are at it... ;-) You do not need that many loops. The programm will be much simpler like that: open(FILE, "yourFileName"); while ($line = ) { #no need to read

Re: help me understand $_

2001-04-22 Thread Collin Rogowski
$_ is just a global variable (with a funny name). Many functions or operators just use this variable, when you not explicitly tell them to use another one. e.g chomp. chomp needs a variable to work on. You can supply one like chomp $x; If you don't chomp thinks you mean chomp $_; and acts exac

Re: introduction and first question

2001-04-22 Thread Collin Rogowski
you could use the s/// operator (substitute). try $line =~s/$IPold/$IPnew/; This will change the first occurence of $IPold in $line into $IPnew. If you want to change multiple occurences, use $line =~s/$IPold/$IPnew/g; g stands for global. hope this helps, cr On Sun, 22 Apr 2001 14:13:12 -

Re: How to read the second column of a file

2001-04-20 Thread Collin Rogowski
you just use a different regular expression with split. In the original example the split was done at the whitespaces the regex is /\s/. Now you want to split at whitespace colon whitespace. The regex is /\s:\s/. If you want to allow more than one whitespace you could /\s*:\s*/ like this. You pro

Re: Comparing arrays

2001-04-20 Thread Collin Rogowski
A hash is a data structure, which assigns a key to value. In Perl the key is given in the curly braces. A key/value pair is entered like this: $hash{$key} = $value (assuming the variables $key and $value, hold the key and value respectivly). > open (EXIST, "/tmp/users"); > @exist = ; >

Re: Removing Leading Zeros

2001-04-19 Thread Collin Rogowski
that's easy.    $index =~ s/^0*//;    if $index contained leading zeros they are gone, otherwise  nothing has happened.    cr  On Thu, 19 Apr 2001 15:38:09 +, Mark Martin said: > Hi all, > I have sucked two substrings into two variables : > > $index = substr $_, 35, 11; > $value = subst