Mailing from Windows 98

2002-10-15 Thread Rajendra Babu, Praveen
Hello All, I am to write a program which also mails the result of the execution. I am doing this in Windows 98. Can someone please guide me from where could I start knowing more about e-mailing using Perl in Windows system. Thanks in advance, Praveen IMPORTANT- (1) The contents of t

RE: Backup Program?

2002-10-15 Thread Beau E. Cox
Hi - Just curious - why not use xcopy? Do you want a GUI? Aloha => Beau. -Original Message- From: Steve Gross [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 15, 2002 7:33 PM To: [EMAIL PROTECTED] Subject: Backup Program? Does anyone out there have a program that will back up window

Backup Program?

2002-10-15 Thread Steve Gross
Does anyone out there have a program that will back up windows files from one drive to another? I would like it to work like DOS xcopy, which can copy files or directories, plus it wouldn't bother if the source file hadn't changed since the last backup. I've looked on CPAN with no results. Thank

Re: scripts run by nobody - SLIGHTLY OT

2002-10-15 Thread Todd W
Todd W wrote: > > > David Gerler wrote: > >> How do I make a script run as a specific user. >> >> When I say that it runs as nobody, I mean that the file output from >> the pipe is owned by "nobody". >> Can anyone shed any light on this? How can I make the file run as my >> user? A

Problem with redirection

2002-10-15 Thread vishal mittal
Hi, I am encountering a problem with this piece of code that I have written for forking multiple processes and making all the child processed communicating with the parent process... ** my($child_fh, $parent_fh) = (new IO::Handle, new IO::Hand

Re: passing a variable to a module

2002-10-15 Thread Jason Tiller
Hi, Jeff, :) On 15 Oct 2002, jeff wrote: > Quick question. I want to pass a variable to a non-oo module that I > created. But I how do I get the module to contain the value of the > variable that was created in the 'main' namespace. In general, this is not good style. A module should be a self

Passing a variable to a sub (WAS: passing a variable to a module)

2002-10-15 Thread Timothy Johnson
This is really more of a question of how to pass a variable to a sub. First off, check out perldoc perlsub. To avoid problems like this, 'use strict' whenever possible at the top of your scripts. Anyway, here's how to fix this: Passing a variable to a sub: All variables passed to subs are pu

Re: passing a variable to a module

2002-10-15 Thread James Edward Gray II
On Tuesday, October 15, 2002, at 06:29 PM, jeff wrote: > > Quick question. I want to pass a variable to a non-oo module that I > created. But I how do I get the module to contain the value of the > variable that was created in the 'main' namespace. I think there is > something easy that I am not

passing a variable to a module

2002-10-15 Thread jeff
Quick question. I want to pass a variable to a non-oo module that I created. But I how do I get the module to contain the value of the variable that was created in the 'main' namespace. I think there is something easy that I am not understanding. Example code below. PROGRAM BEGIN #!/usr/bin/perl

Redirecting STDOUT

2002-10-15 Thread vishal mittal
Hi, I am encountering a problem with this piece of code that I have written. ** my($child_fh, $parent_fh) = (new IO::Handle, new IO::Handle); socketpair($child_fh, $parent_fh, AF_UNIX, SOCK_STREAM, PF_UNSPEC) or die "socketpair failed

Redirecting STDOUT

2002-10-15 Thread vishal mittal
Hi, my($child_fh, $parent_fh) = (new IO::Handle, new IO::Handle); socketpair($child_fh, $parent_fh, AF_UNIX, SOCK_STREAM, PF_UNSPEC) or die "socketpair failed: $!"; $child_fh->autoflush; $parent_fh->autoflush; if (my $pid = fork) { close $parent_fh; $fh_s

Redirecting STDOUT

2002-10-15 Thread vishal mittal
Hi, my($child_fh, $parent_fh) = (new IO::Handle, new IO::Handle); socketpair($child_fh, $parent_fh, AF_UNIX, SOCK_STREAM, PF_UNSPEC) or die "socketpair failed: $!"; $child_fh->autoflush; $parent_fh->autoflush; if (my $pid = fork) { close $parent_fh; $fh_s

Re: Hash Reference Problem

2002-10-15 Thread Michael Fowler
On Tue, Oct 15, 2002 at 10:54:14AM -0400, Chris Benco wrote: > my $From = $Document->GetFirstItem('From')->{Text} or (); > > This appears to work. When I run a test the program recovers seemingly > flawlessly. My problem is that the script still dies at some point. When > I come in the next da

Re: Sendmail Problems

2002-10-15 Thread Deb
Hello! From the commandline, what is the output of % /usr/sbin/sendmail -bv [EMAIL PROTECTED] on the server which you cannot send anything? Also useful, would be any error output that was generated... Hard to say if this is a perl problem or sendmail, or...??? deb Johnstone, Colin <[EM

Sendmail Problems

2002-10-15 Thread Johnstone, Colin
Gidday from Downunder I have loaded the same script on two servers one will send to my home account and the other won't. I know sendmail path and perl path are correct in both instances while it won't send to my home account it will send to my hotmail account. Any Ideas! #!/usr/bin/perl pri

RE: creating a string on the fly

2002-10-15 Thread Vincent Lee
Rob, I've written a subroutine do the getColumns($table). The problem is that it's passing the entire column set back and appending each one. I just do a select of the columns based on the table that is sent to the subroutine. The code you sent me does the entire thing...any ideas?

Re: creating a string on the fly

2002-10-15 Thread Jeff 'japhy' Pinyan
On Oct 15, Rob said: >Suppose we needed to throw out all 'system' column names (such as the >internal table ID or the creation date) which, say, started with an >underscore. We would want to put > >next if $column =~ /^_/; > >at the start of the loop - a loop which wouldn't exist if we'd

Re: line count

2002-10-15 Thread Todd W
Folschette wrote: > hello, > is there a veriable holding the total amount of lines of a specific file ? > or do I have to count the lines in a loop? > > christophe folschette [trwww@devel_rh trwww]$ perl -e 'print($., "\n") while (<>);' < mbox 1 2 3 ... from perldoc perlvar $INPUT_L

Re: scripts run by nobody - SLIGHTLY OT

2002-10-15 Thread Todd W
David Gerler wrote: > How do I make a script run as a specific user. > > I am working on a script that uses a pipe to send information to a > program that outputs to a file. It works on win2000. I have uploaded > it and it runs and works correctly when run in the debugger from a > shell with th

Re: help with redirect in CGI.pm

2002-10-15 Thread Todd W
>> #!/usr/bin/perl -w >> >> use strict; # enforce variable declarations and quoting >> use DBI; >> use CGI qw(:standard); >> use Image::Size; >> print header, start_html(-title=>"UT-Austin University Supply >> Services"); >> print redirect('http://www.utexas.edu'); >> >> print end_ht

Re: Hash Reference Problem

2002-10-15 Thread Jenda Krynicky
From: "Chris Benco" <[EMAIL PROTECTED]> > Having problems when this script hits a hash that is undefined. This > happens when it does a look-up for a field in a notes database and it > is blank. Read on Perl Monks to give it the ability to use another > value when this happens

Re: creating a string on the fly

2002-10-15 Thread Rob
Or, of course: $, = ", "; print GetColumns ($table); R - Original Message - From: "Jeff 'japhy' Pinyan" <[EMAIL PROTECTED]> To: "Rob" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, October 15, 2002 5:55 PM Subject: Re: creating a string on the fl

Re: creating a string on the fly

2002-10-15 Thread Rob
Yes, but 'packing' the Perl before the solution is incomplete means you may have to 'unpack' it to make changes. This applies especially in this forum. Suppose we needed to throw out all 'system' column names (such as the internal table ID or the creation date) which, say, started with an undersc

RE: "No Such File or Directory"

2002-10-15 Thread Nikola Janceski
That's not ok. use File::Path; mkpath(); if you want that functionality. > -Original Message- > From: James Edward Gray II [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 15, 2002 2:14 PM > To: [EMAIL PROTECTED] > Subject: "No Such File or Directory" > > > Okay, here's a different

"No Such File or Directory"

2002-10-15 Thread James Edward Gray II
Okay, here's a different on, mkdir() is giving me a "No Such File or Directory" error. I am passing it a string of two directories I want created, one inside the other, but the way I read the entry in Programming Perl, this is okay. Am I missing something? James -- To unsubscribe, e-mail:

Re: help with redirect in CGI.pm

2002-10-15 Thread Brent Michalski
james, don't print out anything before the redirect statement. the redirect is actually a form of HTTP header, so by printing th eheader first, you end up printing out 2 headers and the redirect fails. hth, brent

help with redirect in CGI.pm

2002-10-15 Thread james
hi! i've written a test.cgi that has these lines: *#!/usr/bin/perl -w use strict; # enforce variable declarations and quoting use DBI; use CGI qw(:standard); use Image::Size; print header, start_html(-title=>"UT-Austin University Supply Services"); print redirect('http://www.utexas.edu'); pri

Re: counter for hash

2002-10-15 Thread John W. Krahn
Chad Kellerman wrote: > > Hello, Hello, > I wrote a script that goes thru the a access logs of a web server > and prints out the hour and number of hits/hour. THe only problem is > that if i use warnings I get a bunch of errors when I count the hits. > > Use of uninitialized value in addi

Re: Help me on concurant comiunication

2002-10-15 Thread James Edward Gray II
This is a pretty involved issue, so I would need more information to help. By multiple processes, do you mean your server forks? As for more information, Network Programming with Perl by Lincoln D. Stein, covers this issue in detail and is quite good, I think. James On Tuesday, October 15, 2

Re: counter for hash

2002-10-15 Thread chad kellerman
japhy, you are correct. That it what I wanted to convey. But with everyone's input I understand what I was missing. thanks again, chad On Tue, 2002-10-15 at 12:59, Jeff 'japhy' Pinyan wrote: > On Oct 15, Rob said: > > >From: "chad kellerman" <[EMAIL PROTECTED]> > > > >> $hits{$ho

Help me on concurant comiunication

2002-10-15 Thread Rakhitha Malinda Karunarathne
I wrote a program (a server ) to listen for clients requests using multiple processes but while a one process waits to incoming client requests all the other processes blocks how can i over come this problem I used IO::Socket::INET for comiunication is there a better way and where can i find

Re: counter for hash

2002-10-15 Thread Jeff 'japhy' Pinyan
On Oct 15, Rob said: >From: "chad kellerman" <[EMAIL PROTECTED]> > >> $hits{$hour} = $hits{$hour}+1; [snip] >> $hits{$hour} = $hits{$hour}+1; >> >> What it the best way to create a counter? >> >> I have seen $var++, it would not work here I had to use +1. > >But I'd be interested to know w

Re: creating a string on the fly

2002-10-15 Thread Jeff 'japhy' Pinyan
On Oct 15, Rob said: >$n = 0; >foreach $column ( GetColumns ($table) ) >{ >print ", " if $n++; >print $column; >} That's spelled print join ",", GetColumns($table); in Perl. :) -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http:/

Re: deleting spaces

2002-10-15 Thread Janek Schleicher
Learn Perl wrote: > I have a simple question. > > Is there ways to get rid of any spaces within a variable? > > say the variable holds " R" or "R " or " R ". > is there a function I could use for that? > I tried chomp but it will only get rid of the last space but not the > leading spaces. You

Re: counter for hash

2002-10-15 Thread Rob
Chad Your program is throwing the error only because you have warnings enabled. The solution is: $hits{$hour} += 1; But I'd be interested to know why you had to use '+ 1'? Also, I think my $hour = ( split /:/, $line )[1]; is nicer. HTH Rob - Original Message - From: "ch

Re: counter for hash

2002-10-15 Thread Janek Schleicher
Chad Kellerman wrote: > Use of uninitialized value in addition (+) at scripts/hits.pl line 14, > line 20569. > ... > The problem lies in the line that says: > > $hits{$hour} = $hits{$hour}+1; > > What it the best way to create a counter? > > I have seen $var++, it would not work here I h

RE: counter for hash

2002-10-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
$hits{$hour}++ is valid and would work as stated. The reason you are getting the working is using the $Hits{$Hour} on the right side of the equal sign. You can use ++ or -- or += or -= with scalars, hash or array values. Wags ;) -Original Message- From: chad kellerman [mailto:[E

counter for hash

2002-10-15 Thread chad kellerman
Hello, I wrote a script that goes thru the a access logs of a web server and prints out the hour and number of hits/hour. THe only problem is that if i use warnings I get a bunch of errors when I count the hits. Use of uninitialized value in addition (+) at scripts/hits.pl line 14, line 20

Re: creating a string on the fly

2002-10-15 Thread Vincent Lee
Get Tables is a select statement from the catalog. Currently it's in an array.. GetTables(Columns) is also another sql statement... I'll try and fool around with it and let you know. If you have any other ideas, let me know. Thanks a ton for your help. This is the best support I've ever seen!

Re: DBD::mySQL make fails

2002-10-15 Thread George Gunderson
On Monday, Oct 14, 2002, at 20:09 US/Eastern, Wiggins d'Anconia wrote: > It would appear that the "mysql.bundle" file is the output file: > > "cc -o blib/arch/auto/DBD/mysql/mysql.bundle" > > Is this possibly a permissions issue? or maybe a non-existing path, > though I would think cc would try

Re: creating a string on the fly

2002-10-15 Thread Rob
Two problems here. 1/ Getting the tables' names and columns from the database. 2/ Constructing the SQL from that information. The second part is easy: foreach $table ( GetTables() ) { print "CREATE VIEW_$table AS\n"; print "SELECT ("; $n = 0; foreach $c

Hash Reference Problem

2002-10-15 Thread Chris Benco
Having problems when this script hits a hash that is undefined. This happens when it does a look-up for a field in a notes database and it is blank. Read on Perl Monks to give it the ability to use another value when this happens to keep the script form halting. The example they give was someth

Re: scripts run by nobody

2002-10-15 Thread Anette Seiler
Hi, I had a similar problem the other day and got help from this list. When you run your script through the browser, it is not executed by you (your username), but by the user of the webserver. Apache normally uses the username "nobody". You can check this by looking into httpd.conf. The reas

Re: creating a string on the fly

2002-10-15 Thread Vincent Lee
I'm starting with data in the database. It's SQL statements and I'm populating arrays in perl. I don't need to build a hash but the statement. I thought an array or hash would be the easiest. [EMAIL PROTECTED] wrote: > >Vincent > >I will have several suggestions, but I need to know what data y

Re: line count

2002-10-15 Thread Rob
Yes, but how horrible! Thx James. - Original Message - From: "Kipp, James" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 15, 2002 3:17 PM Subject: RE: line count > The cookbook recipe here seems to be the quickest: > $count += tr/\n/\n/ while sysread(FILE, $_, 2 *

RE: line count

2002-10-15 Thread Kipp, James
The cookbook recipe here seems to be the quickest: $count += tr/\n/\n/ while sysread(FILE, $_, 2 ** 16); #assumes line terminator is "\n" > -Original Message- > From: Rob [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 15, 2002 10:12 AM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED]

Re: line count

2002-10-15 Thread Rob
Christophe Jenda's quite right - you have to count them. The reason being that the number of lines in a file is essentially the number of line terminator characters in it. You can't count these without reading the whole file in some way. HTH Rob - Original Message - From: "folschette"

Re: file to file copy

2002-10-15 Thread folschette
thanx a lot for your help rob!! the idea with the hash.so simple! christophe folschette Rob wrote: > Christophe > > I think using Tie::File is overkill here. Try this: > > # Merge the two files into a single hash > # > for $file ( 'file2.dat', 'file1.dat' ) > { > open

Re: MLDBM adding records

2002-10-15 Thread Rob
Rus You can't use the concatenation character on hashes. It's for "str"."ings" only. >From what you've said, you just need to set each hash entry: $hash{1} = { url => "www.slashdot.org" , title => "News for nerds" , lastvisit =>" 10" }; $hash{2} = { u

Re: line count

2002-10-15 Thread Jenda Krynicky
From: folschette <[EMAIL PROTECTED]> > hello, > is there a veriable holding the total amount of lines of a specific > file ? or do I have to count the lines in a loop? You have to count them. Jenda=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz == When it com

Re: MLDBM adding records

2002-10-15 Thread Jenda Krynicky
From: Rus Foster <[EMAIL PROTECTED]> >%hash = ( '1' => { url => "www.slashdot.org" , title => "News for > nerds" , lastvisit =>" 10" } ); > %hash .= ( '2' => { url => "www.slashdot.org" , title => "News for > nerds" , lastvisit =>" 10" } ); > > and I'm getting > > Can't modify priv

line count

2002-10-15 Thread folschette
hello, is there a veriable holding the total amount of lines of a specific file ? or do I have to count the lines in a loop? christophe folschette -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: creating a string on the fly

2002-10-15 Thread Rob
Hi Vincent I /think/ you're misunderstanding hashes, but I need to make sure. Do you mean that your has array contains: ORG => ID ORG => COL1 ORG => COL2 EMPLOYEE => ID EMPLOYEE => COL1 EMPLOYEE => COL2 Because you can't do that. A hash represents a one-

MLDBM adding records

2002-10-15 Thread Rus Foster
Hi all, I'm trying to do a proof of concept for myself using MLDBM of basically trying to add two records to a hash. ATM I have the following code #!/usr/bin/perl use strict ; use warnings ; use MLDBM; use Fcntl ; my %hash ; my $filename = "/tmp/filt" ; unlink $file

Re: file to file copy

2002-10-15 Thread Rob
Christophe I think using Tie::File is overkill here. Try this: # Merge the two files into a single hash # for $file ( 'file2.dat', 'file1.dat' ) { open FILE, "< $file"; while ( ) { chomp; ($key, $val) = split /:\s+/; $data{$

RE: scripts run by nobody

2002-10-15 Thread David Gerler
The following message was sent by Timothy Johnson <[EMAIL PROTECTED]> on Mon, 14 Oct 2002 22:34:45 -0700. > > What is the OS of the server you are uploading it to? > > -Original Message- > From: David Gerler [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 14, 2002 9:04 PM > To: Begi

file to file copy

2002-10-15 Thread folschette
hello, i have to write a perl script which copies text from one file to another but only if the text is not exisiting yet. For example: in file1: word: moon word2: sky ... the same syntax for every line in file2: #some text word: honey word3: lol word4: mu ... as well the same syntax for every

creating a string on the fly

2002-10-15 Thread Vincent Lee
Can someone help me with some basic logic? I have an array with unique tablenames from a DB catalog view TABNAME --- Org Employee Dept Each of these tablenames has columns in a hash array For example, ORG would have 3 columns and the array would be as follows: ORG ID ORG COL1 ORG COL2