[Perl-unix-users] Perl modules ...

2001-03-14 Thread Valentin Zanfir

Anybody knows how to make Perl modules by wrapping C or C++ sources ?

Thanks


___
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users



Re: [Perl-unix-users] GRAPH

2001-03-14 Thread Wes Wannemacher

On Tue, Mar 13, 2001 at 08:55:56PM -0800, Pragneshkumar Gandhi wrote:
>
> Hi all can any body tell me where i can find script for displaying
> dynamic graph - charts.  i just want display some data in graphical
> design fetching from mysql database using perl.  bye
> 

There is the GD module. It can make simple polygons which can be easily
interpreted as graphs. But there is also a GD::3DGraph or something like
that. I couldn't find it on CPAN, but it is in the latest edition of the
CGI Programming with PERL from O'Reilly. 

->W

-- 
~~~
Wesley Wannemacher
Instructor / Network Administrator
University of Northwestern Ohio
http://www.unoh.edu/
[EMAIL PROTECTED]
~~~

--
The only disadvantage I see is that it would force everyone to get Perl.
Horrors.  :-)
 -- Larry Wall in  <[EMAIL PROTECTED]>
--
___
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users



RE: [Perl-unix-users] Perl modules ...

2001-03-14 Thread Lamb, Ronald F.

Yes,

The following two man pages explain how to do this
perlxs
perlxstut

If you follow the examples in the perlxstut page you
should be able to make a module that wraps your C 
code.

Ron
___
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users



[Perl-unix-users] kill a process

2001-03-14 Thread Dan Jablonsky

Hi all,
I need to kill a dozen perl programs running
simultaneously. I would like to kill them every
morning after 6 am but I don't know how to reference
the 12 programs. Usually I use kill PID, but in this
case I don't know the PID. If I do a ps -al I can see
that all perl programs have CMD perl. How do I kill a
process knowing its CMD?
Thanks a lot,
Dan

__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
___
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users



[Perl-unix-users] shell question

2001-03-14 Thread Dan Jablonsky

Hi all,
I need to run 20 distinct perl programs in 20 distinct
shells. The programs write to some files but also
print to the standard output so I'd like to have 20
terminals open simultaneously to check various
messages printed by the programs. One obvious solution
is to open 20 different terminals and launch every
program in its own shell. Is there a way I could write
a program that does this for me?

I tried using the system function but all system calls
would execute sequentially and this is not what I
want.
Then I tried to open a different shell for each
program but I got a "perl can't execute binary file",
then I used some switches without knowing exactly what
they do ( -s and -h) and obviously it did not work.
Again, I need the 20 programs to execute independently
and simultaneosly.
Anybody any ideas? Thanks,
Dan

__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
___
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users



[Perl-unix-users] FTP across platforms

2001-03-14 Thread Scicluna, Martin

I am experiencing intermittent hangs (resulting if FTP timeouts) when
running  a system script on a 
Solaris box that creates an FTP connection to a remote NT server. Below is a
simple script that was 
written to test the problem with the FTP connection on the system script.

All this script does is create an FTP connection, log-on and then toggle
between two remote dirs
and prints the filenames found... and it still experiences the hangs.


Any input would be appreciated.

use Net::FTP;
use strict;

my ($ftp, $path1, $path2);


#Create a FTP handle object
$ftp = Net::FTP->new('***.***.***.***', Timeout => 500) || die "WARNING!
Could not create FTP handle";
#Connect to FTP server  
$ftp->login('usrname', 'passwd') || print "[main] FTP returned an error
$!\n";
#change transfer type to binary to get correct file sizes
$ftp->binary; 

$path1 = "//delta/import/reports/csvreports/testing";
$path2 = "//delta/import/reports/csvreports/testing2";

$ftp->cwd($path1);
print $ftp->pwd()."\n";

while (1) {
printStuff($path1);
printStuff($path2);
sleep(1);
}


sub printStuff{
my $path = shift;
my @files;
my $temp;

$ftp->cwd($path);
print "Currently serarching directory $path\n";
@files = $ftp->ls();

foreach $temp (@files) {
print "$temp\n";
}
} 


**
This e-mail may be confidential and only the intended
recipient may access or use it.  If you are not the intended
recipient, please delete this e-mail and notify the sender
immediately.

The contents of this e-mail are the writer's opinion and are 
not necessarily endorsed by Delta Electricity unless
expressly stated.

We use virus scanning software but exclude all liability for
viruses or similar in any attachment.
**
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users



Re: [Perl-unix-users] shell question

2001-03-14 Thread $Bill Luebkert

Dan Jablonsky wrote:
> 
> Hi all,
> I need to run 20 distinct perl programs in 20 distinct
> shells. The programs write to some files but also
> print to the standard output so I'd like to have 20
> terminals open simultaneously to check various
> messages printed by the programs. One obvious solution
> is to open 20 different terminals and launch every
> program in its own shell. Is there a way I could write
> a program that does this for me?
> 
> I tried using the system function but all system calls
> would execute sequentially and this is not what I
> want.
> Then I tried to open a different shell for each
> program but I got a "perl can't execute binary file",
> then I used some switches without knowing exactly what
> they do ( -s and -h) and obviously it did not work.
> Again, I need the 20 programs to execute independently
> and simultaneosly.
> Anybody any ideas? Thanks,

Read the docs/FAQs (below from 5.5 not 5.6):

perlipc:

  Background Processes

You can run a command in the background with:

system("cmd &");

The command's STDOUT and STDERR (and possibly STDIN, depending on your
shell) will be the same as the parent's. You won't need to catch SIGCHLD
because of the double-fork taking place (see below for more details).

  Complete Dissociation of Child from Parent

In some cases (starting server processes, for instance) you'll want to
completely dissociate the child process from the parent. This is often
called daemonization. A well behaved daemon will also chdir() to the
root directory (so it doesn't prevent unmounting the filesystem
containing the directory from which it was launched) and redirect its
standard file descriptors from and to /dev/null (so that random output
doesn't wind up on the user's terminal).

use POSIX 'setsid';

sub daemonize {
chdir '/'   or die "Can't chdir to /: $!";
open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
open STDOUT, '>/dev/null'
or die "Can't write to /dev/null: $!";
defined(my $pid = fork) or die "Can't fork: $!";
exit if $pid;
setsid  or die "Can't start a new session: $!";
open STDERR, '>&STDOUT' or die "Can't dup stdout: $!";
}

The fork() has to come before the setsid() to ensure that you aren't a
process group leader (the setsid() will fail if you are). If your system
doesn't have the setsid() function, open /dev/tty and use the
`TIOCNOTTY' ioctl() on it instead. See the tty(4) manpage for details.

Non-Unix users should check their Your_OS::Process module for other
solutions.

perlfaq8:

  How do I fork a daemon process?

If by daemon process you mean one that's detached (disassociated from
its tty), then the following process is reported to work on most Unixish
systems. Non-Unix users should check their Your_OS::Process module for
other solutions.

*   Open /dev/tty and use the TIOCNOTTY ioctl on it. See the tty(4) manpage
for details. Or better yet, you can just use the POSIX::setsid()
function, so you don't have to worry about process groups.

*   Change directory to /

*   Reopen STDIN, STDOUT, and STDERR so they're not connected to the old
tty.

*   Background yourself like this:

fork && exit;

The Proc::Daemon module, available from CPAN, provides a function to
perform these actions for you.


-- 
  ,-/-  __  _  _ $Bill Luebkert   ICQ=14439852
 (_/   /  )// //   DBE Collectibles   http://www.todbe.com/
  / ) /--<  o // //  Mailto:[EMAIL PROTECTED] http://dbecoll.webjump.com/
-/-' /___/_<_http://www.freeyellow.com/members/dbecoll/
___
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users