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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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?
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
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
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
>> #!/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
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
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
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
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
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:
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
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
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
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
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
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
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
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:/
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
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
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
$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
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
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!
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
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
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
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
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
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 *
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]
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"
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
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
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
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
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]
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-
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
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{$
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
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
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
58 matches
Mail list logo