RE: Connectivity with DB2 on AS400

2002-10-30 Thread Shaun
Hi Dana, > my $dbh=DBI->connect("dbi:DB2:$source", $user, $pass, {RaiseError => 1 > }); Try: my $dbh = DBI->connect( "dbi:DB2:$source", $user, $pass, {RaiseError => 1, PrintError => 1, AutoCommit => 1} ) or die "Unable to connect: " . $DBI::errstr . "\n"; > > my $sth = $dbh->prepar

Multi-source modules.

2002-10-30 Thread Beau E. Cox
Hi - I'm trying to bundle a module with a series of other modules: MY::Module (main) bundled with MY::Module::SomeStuff MY::Module::SomeOtherStuff ... I see mocules "including" other modules on CPAN, but I haven't been able to find out how to do it so that the make in MY::Module makes all

Sorry 'bout that

2002-10-30 Thread Beau E. Cox
Sorry - I attached a .pl script to a message posted to this list - apparently that is a no-no. Sorry, I won't do it again. Aloha => Beau. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: ms access & perl

2002-10-30 Thread Beau E. Cox
Hi Jerry - I'm dropping into my pedantic mode; Here's a "baby" script to access MS Access from Perl: use strict; use warnings; use DBI; my $dbh = DBI->connect("DBI:ODBC:MyDatabase") || die "could not connect to ODBC:MyDatabase:\n$DBI::errstr\n"; my $stmt = "selec

RE: Current Directory Name

2002-10-30 Thread Toby Stuart
use strict; use Cwd; $dir = cwd; print $dir; > -Original Message- > From: Johnstone, Colin [mailto:Colin.Johnstone@;det.nsw.edu.au] > Sent: Thursday, October 31, 2002 11:20 AM > To: '[EMAIL PROTECTED]' > Subject: Current Directory Name > > > Gidday All, > > How do I find out the name

Current Directory Name

2002-10-30 Thread Johnstone, Colin
Gidday All, How do I find out the name of the current directory I am in before I do chdir. Colin Johnstone -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Grabbing a process ID

2002-10-30 Thread John W. Krahn
Charlotte Oliver wrote: > > Additionally, if you're looking for a particular process, you could do: > > ps -aux | grep "processname" > > That will limit the output only to the particular thing you're looking > for, but will show all instances of it. Of course if you are on Linux you could do:

Re: ms access & perl

2002-10-30 Thread Jenda Krynicky
From: Robert Citek <[EMAIL PROTECTED]> > At 10:47 PM 10/30/2002 +0100, Jenda Krynicky wrote: > >From: "Jerry Preston" <[EMAIL PROTECTED]> > >> Is it possible to access MS access from Perl? If so, how? > > > >Sure. Use DBI and DBD::ODBC or Win32::ODBC or Win32::ADO or DBI with > >DBD::ADO :-) > >

Mail Problem

2002-10-30 Thread Palm Optins
Hello Everyone, Can someone help me with this. I keep getting this error when I try to access this file. http://www.host-4-you.net/Demo1/setup.cgi The config file is in the same directory as the others. At first I thought I was missing the 1; in the config file, but it's there. Thanks and God

Re: ms access & perl

2002-10-30 Thread Robert Citek
At 10:47 PM 10/30/2002 +0100, Jenda Krynicky wrote: >From: "Jerry Preston" <[EMAIL PROTECTED]> >> Is it possible to access MS access from Perl? If so, how? > >Sure. Use DBI and DBD::ODBC or Win32::ODBC or Win32::ADO or DBI with >DBD::ADO :-) Extending the question a bit, can I access an MS Acce

XSUB from C, and make install

2002-10-30 Thread George Szynal
I want to ship a Perl app (a rapid-prototyping development tool, and demo of XSUB) for MacOSX, and because it is for Cocoa applications (Objective C, Distributed Objects) I don't expect end-users to need Admin rights to the Library tree during final-app installation. Note: The demo calls a 'P

Re: ms access & perl

2002-10-30 Thread Jenda Krynicky
From: "Jerry Preston" <[EMAIL PROTECTED]> > Is it possible to access MS access from Perl? If so, how? Sure. Use DBI and DBD::ODBC or Win32::ODBC or Win32::ADO or DBI with DBD::ADO :-) Jenda = [EMAIL PROTECTED] === http://Jenda.Krynicky.cz = When it comes to wine, women and song, wizards

Re: ms access & perl

2002-10-30 Thread George Szynal
Are you using the native proprietary back-end DB, or a non-proprietary SQL DB? If the back-end is MSSQL, for instance, you can use the standard Perl database connectivity syntax. Otherwise, MSAccess may have an API to get at their proprietary DB, I'm not sure about that. - Original Message --

ms access & perl

2002-10-30 Thread Jerry Preston
Hi!! Is it possible to access MS access from Perl? If so, how? Thanks, Jerry

Re: MailSender.pm question

2002-10-30 Thread Jenda Krynicky
From: Goodman Kristi - kgoodm <[EMAIL PROTECTED]> > I got this error while compiling my script with PDK2.0. > > Argument "package main;\n#line 1 "Mail/Sender.pm"\n# Mail::Sender" > isn't numeric in multiplication (*) at Mail/Sender.pm line 55. > > I'm not sure what it means...the script seem

RE: Grabbing a process ID

2002-10-30 Thread Beau E. Cox
Hi - Yes, I agree ps -aux. To do it from perl, use bacticks: #!c:\perl\bin\perl -w use strict; my @processes = `ps -aux`; print "$_" for @processes; @processes has _everything_ about your currently running processes (depenging on your permission level). Aloha => Beau. -Original Message

RE: Grabbing a process ID

2002-10-30 Thread Kipp, James
the system command does not return pids. it only returns error status numbers(constants). check perldoc -f system for more info. your best bet is to fork another process (of the other perlscript your are calling) . for info see: perldoc -f fork perldoic perlipc and you should find tons of recent

MailSender.pm question

2002-10-30 Thread Goodman Kristi - kgoodm
I got this error while compiling my script with PDK2.0. Argument "package main;\n#line 1 "Mail/Sender.pm"\n# Mail::Sender" isn't numeric in multiplication (*) at Mail/Sender.pm line 55. I'm not sure what it means...the script seems to run fine and it sends mail fine. Thanks, Kristi **

RE: Grabbing a process ID

2002-10-30 Thread Charlotte Oliver
Additionally, if you're looking for a particular process, you could do: ps -aux | grep "processname" That will limit the output only to the particular thing you're looking for, but will show all instances of it. Cheers, Charlotte > -Original Message- > From: Tucker, Ernie [mailto:ETuc

RE: Grabbing a process ID

2002-10-30 Thread Tucker, Ernie
ps -aux -Original Message- From: Guy Davis [mailto:guy@;yournaturewithin.com] Sent: Wednesday, October 30, 2002 1:48 PM To: [EMAIL PROTECTED] Subject: Grabbing a process ID If I'm using the system command on a linux box is there any way to get the process id returned? I am calling anoth

Grabbing a process ID

2002-10-30 Thread Guy Davis
If I'm using the system command on a linux box is there any way to get the process id returned? I am calling another perl script and it has failed occasionally from errors that I have not yet tracked down. What I want to do is grab and store the process id. Then check to see if that process id

Re: [GENERAL] Stream data into Postgres via Perl

2002-10-30 Thread Medi Montaseri
Why you say using Excel is better, note how you just changed a batch program that could potentially run at 3:00 AM into an interactive operator needed task My vote is, stay with the automation, its hard at the begining but pays later... Ashish Lahori wrote: Hi, I think the best way of do

non-member submission: TCP server

2002-10-30 Thread Elliot Tobin
I have a TCP server listening on a socket, receiving data using the following line: my $res = $clientSocket->recv($inputBuffer, 1024); The problem is, when it gets the data and prints it, it doesn't wait for an enter, it just takes what it gets in, maybe 0.05 seconds and outputs it, and so for

Re: c shell commands in perl script

2002-10-30 Thread Jon Disnard
uh The obvious answer is to drop into a c shell and try the commands. In other words, type "csh" in your bash shell, and learn the c shell. Some things are different in csh, like setenv, builtin's, and a few other esoteric things. Elanchezhian Sivanandam wrote: hi, i have to give a

Re: the tilde and File::Spec?

2002-10-30 Thread Randal L. Schwartz
> "Frank" == Frank Wiles <[EMAIL PROTECTED]> writes: Frank> Tilde is Unix means 'home directory'. But not to any of the system calls. Just some applications that have agreed to do so, like the shells. So "unix" (the kernel) doesn't know about it at all. I believe the first utility to

Re: malloc equivalent.

2002-10-30 Thread Jenda Krynicky
> Just would like to know if there is a malloc equivalent. No. You just have as much memory as you need. The closest to malloc() you can get is $buffer = "\x0" x $size; which is sometimes necessary if you use Win32::API. But as long as you stay in Perl you don't have to care about memo

malloc equivalent.

2002-10-30 Thread Wert, Nathaniel
Just would like to know if there is a malloc equivalent. Thanks. --- Nathaniel J. Wert Computer Associates Quality Assurance Engineer, Development tel: +1 513 229 2300 [EMAIL PROTECTED]

RE: split function using "." for the pattern

2002-10-30 Thread Kipp, James
escape the . with \ in your split statement > -Original Message- > From: [EMAIL PROTECTED] [mailto:bengleto@;calpoly.edu] > Sent: Wednesday, October 30, 2002 12:39 PM > To: [EMAIL PROTECTED] > Subject: split function using "." for the pattern > > > I have a string that I want to split

RE: split function using "." for the pattern

2002-10-30 Thread Timothy Johnson
Did you remember to represent '.' as '\.'? -Original Message- From: [EMAIL PROTECTED] [mailto:bengleto@;calpoly.edu] Sent: Wednesday, October 30, 2002 9:39 AM To: [EMAIL PROTECTED] Subject: split function using "." for the pattern I have a string that I want to split into an array 10.

split function using "." for the pattern

2002-10-30 Thread bengleto
I have a string that I want to split into an array 10.30.02 I cant get it to split up the string at the "."s. Do I have to do something different because "." is an ambiguous character? Thank you Brian -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROT

Re: variable names problem

2002-10-30 Thread Jenda Krynicky
From: "Dario Greco" <[EMAIL PROTECTED]> > i must create an array and an hash and store them for each cycle of a > "while". i want name these variables @array1, @array2... and %hash1, > %hash2... in which 1,2 etc are the number of cycle of the "while". No you don't. Please read "Why it's stupid to

RE: variable names problem

2002-10-30 Thread NYIMI Jose (BMB)
You can use symbolic references: perldoc perlref (see Symbolic references section) $i=0; While(bla bla){ $i++; $a_var_name="array$i"; $h_var_name="hash$i"; # @$a_var_name=(); #this for instance clears @array1 if your are in the first loop. %$h_var_

Re: c shell commands in perl script

2002-10-30 Thread Tanton Gibbs
Very good point...should have thought of that ;) I think an even more important question is why the user is trying to write bash or csh. I can't imagine anything that can be done in shell but not in perl (with some POSIX calls). Why not try to eliminate the dependency on the shell and use more p

Re: c shell commands in perl script

2002-10-30 Thread Peter Scott
In article <000f01c2802a$a988ece0$80b59c42@brooklyn>, [EMAIL PROTECTED] (Tanton Gibbs) writes: >More than likely, you are misusing system. > >If you are saying system( "csh" ); system( "ls -l" ) ... >Then you are not understanding how system works. Everything system is >executed it spawns >a s

variable names problem

2002-10-30 Thread Dario Greco
hi, i must create an array and an hash and store them for each cycle of a "while". i want name these variables @array1, @array2... and %hash1, %hash2... in which 1,2 etc are the number of cycle of the "while". how is the correct grammar for this case? tnx very much ___ D G

Re: pattern matching

2002-10-30 Thread Tanton Gibbs
You need to match the whole string, not just part of it. $str =~ /^[A-Za-z0-9_]+$/ The ^ will match the beginning of the string, and the $ will match a newline or the end of the string. Usually, the newline doesn't come into play as you normally chomp( $str ) before comparing. Tanton - Orig

Re: c shell commands in perl script

2002-10-30 Thread Tanton Gibbs
More than likely, you are misusing system. If you are saying system( "csh" ); system( "ls -l" ); ... Then you are not understanding how system works. Everything system is executed it spawns a subshell which is destroyed on termination of the system call. Therefore, your csh does not last past

Re: pattern matching

2002-10-30 Thread bioinfo Gu
Hi Jonathan, Thank you very much for your reply. I check your script, it did not work: for example: Suppose I give the string "abc", "abc123" "123" "abc_123" "abc.123": The string "abc", "abc123", "123", "abc-123" should be legal, but the "abc.123" should be NOT legal. I am using perl script

Re: again about php and perl

2002-10-30 Thread Frank Wiles
.--[ Adriano Allora wrote (2002/10/30 at 14:04:55) ]-- | | Hi to all, | I've ever used PHP for my webworks, but I'm slowly learning Perl and I | recently discovered the cgi.pm and it seems enought simply and useful. | What's the difference between using perl-cgi and php pages?

c shell commands in perl script

2002-10-30 Thread Elanchezhian Sivanandam
hi, i have to give a set of commands from a perlscript in bash and c shell depending on an argument. since my default shell is bash the commands i give work. but for c shell the set of commands don't execute. i mean the subsequent commands after i go to c shell (system

again about php and perl

2002-10-30 Thread Adriano Allora
Hi to all, I've ever used PHP for my webworks, but I'm slowly learning Perl and I recently discovered the cgi.pm and it seems enought simply and useful. What's the difference between using perl-cgi and php pages? And: is it very stupid to write a cgi wich creates all the web pages as I could do w

Re: Comparing array elements with scalar variables.

2002-10-30 Thread Josimar Nunes de Oliveira
Try this code: use Time::Local; $date = time(); for ($i=0;$i<6;$i++){ my $thisMonth = uc(substr(localtime($date - $i*(31 * 24 * 60 * 60)),4,3)); print "$thisMonth\n"; } Will this help you? Josimar - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wedne

RE: Comparing array elements with scalar variables.

2002-10-30 Thread jonathan . musto
Thanks for that Nigel it worked a treat. I understand that it would be more efficient not to have the months in a database table, but unfortunately for the peice of software we are using the database with requires it!! we are hoping it will be ironed out in a later release tho. Cheers for time any

Re: Comparing array elements with scalar variables.

2002-10-30 Thread Nigel Wetters
On Wed, 2002-10-30 at 09:33, [EMAIL PROTECTED] wrote: > I've have some code that prints a column of a database table into a html > form. The column of the table is just the last 6 months of the year: see previous post database lookups are expensive. the last 6 months of the year are fairly const

Re: Comparing array elements with scalar variables.

2002-10-30 Thread Nigel Wetters
On Wed, 2002-10-30 at 09:33, [EMAIL PROTECTED] wrote: > my @emonth; > while ( @emonth = $end_Months->fetchrow_array()) { > print HTML "@emonth\n"; > } Grab the month from the database row before writing the line: while ( my @row = $sth->fetchrow_array()) { my $month = $row[0]; # first colum

Comparing array elements with scalar variables.

2002-10-30 Thread jonathan . musto
I've have some code that prints a column of a database table into a html form. The column of the table is just the last 6 months of the year: my @emonth; while ( @emonth = $end_Months->fetchrow_array()) { print HTML "@emonth\n"; } returns: MAY JUN JUL AUG SEP OCT i've got the current month

Re: Determining the meaning of a subscript...

2002-10-30 Thread David Buddrige
Thanks Nigel. The program that my collegue wrote parses a C++ file, and allows us to re-arrange the comments contained in it based on their location in relation to various code. We have a bunch of company-standard comments in this code, but we are now being required to move to doc++ as our do

Re: Determining the meaning of a subscript...

2002-10-30 Thread Nigel Wetters
On Wed, 2002-10-30 at 07:49, David Buddrige wrote: > $TO_sub="$;#"; > $TC_sub="$;@"; obscure. $; is by default "\034"; thus $TO_sub is "\034#" and $TO_sub is "\034@". I guess your colleague has manually constructing her own multidimensional hashes or arrays using these subscript separators. With

RE: [GENERAL] Stream data into Postgres via Perl

2002-10-30 Thread Ashish Lahori
Hi, I think the best way of doing the Insertion is to use the copy command of postgres. You then have to insert Then nextval manually. this can be done by replacing and '|' with ',' and save it as .CSV. Open the file in Excel and insert the intial row as the way you want, i mean the starting index