Title: RE: perl and DB connectivities
you could try this little routine,
After opening the connection and making the query:-
while(($rc = $X->ct_results($restype)) == CS_SUCCEED) {
next if ($restype == CS_CMD_DONE || $restype == CS_CMD_FAIL || $restype == CS_CMD_SUCCEED);
@
Anyone here who has the binary files of perl 5.8 for AIX 4.3.3?
Any idea where I can get the bins?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
sorry, i have not made myself clear and the many typos won't have helped
either. I need both ends of the connection to be able to read and write
data. I will outline the process here:
1) user runs client using config file containing username/passwd/domainname
2) client connects to server and awai
On Tue, 24 Sep 2002, Angerstein wrote:
> Anyone here who has the binary files of perl 5.8 for AIX 4.3.3?
>
> Any idea where I can get the bins?
If you want to build from the source files (recommended approach)
http://www.cpan.org/src/stable.tar.gz
This is the link for binaries
http://www.cpan
No, there are no binaries of 5.8.
Today, I not in mind to build it myself.
Have to code a little.
> -Ursprüngliche Nachricht-
> Von: Sudarshan Raghavan [mailto:[EMAIL PROTECTED]]
> Gesendet am: Donnerstag, 26. September 2002 07:50
> An: Perl beginners
> Betreff: Re: perl 5.8.0 for AIX 4
-- Forwarded message --
Date: Thu, 26 Sep 2002 11:34:46 +0530 (IST)
From: Sudarshan Raghavan <[EMAIL PROTECTED]>
To: Mat Harris <[EMAIL PROTECTED]>
Subject: Re: client-server with socket
On Tue, 24 Sep 2002, Mat Harris wrote:
> sorry, i have not made myself clear and the many t
Hi
Does anyone know how to save any data that is matched
by regular expression, from within a string or array,
the match could occur any number of times.
I can happily discard any matched data, but not the
other way round.
Help this is driving me up the wall, I'm sure there is
an easy answer to
I've been working with perl for a while now, and I still have not been able
to grasp the concept of references. I've got Beginning Perl by Simon Cozens
published by Wrox, I have the Camel, and the cookbook. After reading the
information, and trying to ask people as well I still cannot understand w
On Tue, 24 Sep 2002, Brian Ling wrote:
> Hi
>
> Does anyone know how to save any data that is matched
> by regular expression, from within a string or array,
> the match could occur any number of times.
>
> I can happily discard any matched data, but not the
> other way round.
>
> Help this is
-- Forwarded message --
Date: Thu, 26 Sep 2002 12:22:33 +0530 (IST)
From: Sudarshan Raghavan <[EMAIL PROTECTED]>
To: "Meidling, Keith, CTR, OSD-C3I" <[EMAIL PROTECTED]>
Subject: RE: join hashes?
On Tue, 24 Sep 2002, Meidling, Keith, CTR, OSD-C3I wrote:
> I've been working with
i have read that but either it doesn't explain about 2-way sockets or i
don't understand it.
On Thu, Sep 26, 2002 at 11:38:53 +0530, Sudarshan Raghavan wrote:
>
>
> -- Forwarded message --
> Date: Thu, 26 Sep 2002 11:34:46 +0530 (IST)
> From: Sudarshan Raghavan <[EMAIL PROTECTED
I have an array with a lot of data.
i want to remove certain elements from it:
so i ran:
for (@array){
s/$current_user.*//;
}
nw when i print it, all $current user are gone as i wanted, but its a big space in the
array instead.
like:
user1
user1
user2
use
On Tue, 24 Sep 2002, David Samuelsson (PAC) wrote:
> I have an array with a lot of data.
>
> i want to remove certain elements from it:
> so i ran:
>for (@array){
>s/$current_user.*//;
>}
>
> nw when i print it, all $current user are gone as i wanted, but i
On Tue, 24 Sep 2002, David Samuelsson (PAC) wrote:
> I have an array with a lot of data.
>
> i want to remove certain elements from it:
> so i ran:
>for (@array){
>s/$current_user.*//;
>}
>
> nw when i print it, all $current user are gone as i wanted, but its
On Tue, 24 Sep 2002, Mat Harris wrote:
> i have read that but either it doesn't explain about 2-way sockets or i
> don't understand it.
It does the socket call creates a communication endpoint (for both reading
and writing). You can access this endpoint through the filehandle
which is the firs
Finally I managed to get my perl script to connect to the relevant MySQL
database. I've looked at the DBI.pm information, but I still am pretty
clueless about how you read data from a table, and write data to it. Any
help much appreciated.
Dan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
On Tue, 24 Sep 2002 10:47:33 +0100, [EMAIL PROTECTED] (Mat
Harris) wrote:
>sorry, i have not made myself clear and the many typos won't have helped
>
>1) user runs client using config file containing username/passwd/domainname
>2) client connects to server and awaits ready code
>3) server sees cl
On Tue, 24 Sep 2002 08:44:30 -0400, [EMAIL PROTECTED] (Zentara)
wrote:
>On Tue, 24 Sep 2002 10:47:33 +0100, [EMAIL PROTECTED] (Mat
>Harris) wrote:
>
>>anyone willing to write me some quick examples.
>
>Here is a "sockets-upload client-server" I wrote with Net::EasyTCP.
I must add that Net::EasyT
How have you 'looked at the DBI.pm' do a perldoc DBI and you will learn
faster
Besides if you are using Mysql install Mysql.pm and using this is very easy
Dan wrote:
> Finally I managed to get my perl script to connect to the relevant MySQL
> database. I've looked at the DBI.pm information, b
This is straight from the DBI docs:
The typical method call sequence for a SELECT statement is:
prepare,
execute, fetch, fetch, ...
execute, fetch, fetch, ...
execute, fetch, fetch, ...
for example:
$sth = $dbh->prepare("SELECT foo, bar FROM table WHERE baz=?");
$sth->exe
@array = grep !/^\s*$/, @array;
This will return an array of elements (removing all elements that are either filled
with spaces or are blank)
George.
i read that it wasnt so good to use this in ther perlfaq:
Please do not use
($is_there) = grep $_ eq $whatever, @array;
or worse yet
(
On Tue, 24 Sep 2002 12:45:58 +0100
"dan" <[EMAIL PROTECTED]> wrote:
> Finally I managed to get my perl script to connect to the relevant MySQL
> database. I've looked at the DBI.pm information, but I still am pretty
> clueless about how you read data from a table, and write data to it. Any
> help
Hi all,
Is there any way to open a "handle" to an array as we open a handle to a
file?? The condition being we can use that "array handle" everywhere we can
use a file handle
Like if we do:
$fh = new FileHandle "file.txt", O_APPEND;
print $fh "Written!\n";
it will add a line to the file f
I think you're looking for:
push @array, $elements, $to, $add;
On Tuesday, September 24, 2002, at 08:34 AM, Rohit Mishra-R53658 wrote:
> Hi all,
>
> Is there any way to open a "handle" to an array as we open a handle to
> a
> file?? The condition being we can use that "array handle" everywhe
On Tue, 24 Sep 2002, David Samuelsson (PAC) wrote:
> @array = grep !/^\s*$/, @array;
> This will return an array of elements (removing all elements that are either filled
>with spaces or are blank)
>
> George.
>
> i read that it wasnt so good to use this in ther perlfaq:
There is nothing wron
Hello everyone,
I am sure this is a newbie question but I have never had to do this
in a script and I am not quite too sure if I can.
Is there a way I can "mark" a part of a script so that, if I wrap an
eval around a particular statement I can go back to that mark and retry
it.
I have t
how about using a label?
-Original Message-
From: chad kellerman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 9:19 AM
To: Perl beginners
Subject: Don't know how to title this email.
Hello everyone,
I am sure this is a newbie question but I have never had to do this
i
Does anyone know if there is a function in perl thaat works like the fc
(File Compare) function under dos or Unix?
If so, plse let me know.
Thanks,
Jim
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Sep 24, Brian Ling said:
>Does anyone know how to save any data that is matched
>by regular expression, from within a string or array,
>the match could occur any number of times.
push @matches, $string =~ /pattern/g;
I *think* that's what you want... you're being a little to vague, though.
On Sep 24, David Samuelsson (PAC) said:
>i want to remove certain elements from it:
>so i ran:
>for (@array){
>s/$current_user.*//;
>}
>
>nw when i print it, all $current user are gone as i wanted, but its a big
>space in the array instead. like:
No, it's not
On Tue, 24 Sep 2002, Hughes, James wrote:
> Does anyone know if there is a function in perl thaat works like the fc
> (File Compare) function under dos or Unix?
>
>
> If so, plse let me know.
You can use File::Compare that comes with the standard distro
perldoc File::Compare
or downlo
Hi,
I codes in the while loop is too long. Can it be
written in different way?
Thanks.
sub display_helpdb{
my $server = $_[0];
my @results;
&sybase_connect("$server","master","sp_helpdb");
$dbh->dbsqlexec;
$dbh->dbresults;
@tbl_header = ("DB Name", "DB Size", "Owner",
"DBID", "Create
Hi,
how about:
while(@results = $dbh->dbnextrow){
print "";
foreach (@results) {
print "$_<\n";
}
print "";
}
R
At 08:19 24/09/2002 -0700, loan tran wrote:
>Hi,
>I codes in the while loop is too long. Can it be
>written in different way?
>
> -Original Message-
> From: loan tran [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 24, 2002 11:20 AM
> To: [EMAIL PROTECTED]
> Subject: can my code be shortened?
>
>
> Hi,
> I codes in the while loop is too long. Can it be
> written in different way?
> Thanks.
>
> sub display_
> "John" == John W Krahn <[EMAIL PROTECTED]> writes:
John> James Edward Gray II wrote:
>>
>> Is there a simple way, like a one liner perhaps, that will give me the
>> octal/hex value of a character? I need to look certain characters up,
>> so I would like to be able to give it something lik
Hi,
I have a problem which is simple to state:
Find all prices in a file, multiply them by 2.5, and print out the file with
the new prices.
It seemed like a good use for substitution at first.
The following successfully finds the prices and saves them in memory:
/\$([0-9.]+)/
(a dollar sign
i was given this url:
perldoc DBI (http://search.cpan.org/author/TIMB/DBI-1.30/DBI.pm)
that's what i was referring to when i said DBI.pm
dan
"Ramprasad A Padmanabhan" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> How have you 'looked at the DBI.pm' do a perl
Robin Cragg wrote at Tue, 24 Sep 2002 17:26:24 +0200:
> how about:
>
> while(@results = $dbh->dbnextrow){
> print "";
> foreach (@results) {
> print "$_<\n";
^
> }
> print "";
> }
Or still shorter:
while (my @
Hi all,
What I'm trying to do is find some type of user defined delimiter in a
file so that I can combine 2 files into 1. An example of the file would be:
## HTML ##
some HTML code
## TEXT ##
some text
Any help would be greatly appreciated. I'm fairly new to Perl and I don't
know wh
From: "Steven Arbitman" <[EMAIL PROTECTED]>
> I have a problem which is simple to state:
>
> Find all prices in a file, multiply them by 2.5, and print out the
> file with the new prices.
>
> It seemed like a good use for substitution at first.
>
> The following successfully finds the prices a
Sorry to make this a little clearer, I want to find the delimiter and then
process what's past the delimiter. So all the html code would go into a
variable and then all the text would go into a different variable. Sorry
for the confusion.
Jessee
Win32API::Net seems to be lacking a way to do a domain sync. Anyone have a
lead for me?
Bill
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Using the /g modifier would be appropriate. Consider using the /e modifier
which causes perl to execute code in the "replace-with" part of the s///.
The following is from the Camel 3rd Ed, page 209:
s/(\d+)/$1 * 2/; #Replaces "42" with "42 * 2"
s/(\d+)/$1 * 2/e; #Replaces "42" with "84"
Chee
If it's as simple as you're making it sound, the "split" function is for
you.
@arrayName = split(/delimiter/, $string);
So your new array is @arrayName
@arrayName[0] is what's before the delimiter ...
@arrayName[1] is what's after it.
put your delimiting character in between the forward slashes
Jenda Krynicky wrote:
>
> From: "Steven Arbitman" <[EMAIL PROTECTED]>
>
> > I have a problem which is simple to state:
> >
> > Find all prices in a file, multiply them by 2.5, and print out the
> > file with the new prices.
> >
> > It seemed like a good use for substitution at first.
> >
> > The
I have a script that uses an array to determine weather or not a subroutine
needs to be run or not. I want to be able do a foreach on the array and
invoke the subroutine using the control variable. The names of the
subroutines are the same as the items inside the array. This is what I have
so f
Instead of an array, you could change to a hash and use the
subroutine name as the key. Then if the key is defined, you execute
otherwise bypass.
Wags ;)
-Original Message-
From: Zielfelder, Robert [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 10:44
To: '[EMAIL PR
Keith wrote:
> I've been working with perl for a while now, and I still have not been
> able to grasp the concept of references. I've got Beginning Perl by Simon
> Cozens published by Wrox, I have the Camel, and the cookbook. After
> reading the information, and trying to ask people as well I sti
Or you could fill the array with sub refs:
$array[0] = \&sub0;
&{$array[0]};
-Original Message-
From: Wagner, David --- Senior Programmer Analyst --- WGO
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 1:55 PM
To: 'Zielfelder, Robert'; '[EMAIL PROTECTED]'
Subject: RE: Using
You're going about it the wrong way. I assume that based on some previous
criteria, you need to perform a certain action, and you have that criteria
stored in the array: @list_of_subs
See if this works for you.
Create 1 sub, which we'll call MySub.
Pass it whatever is in the array, and have a b
>foreach $sub (@list_of_subs) {
> &{$sub}; ##-- this is the part I am stuck on. This doesn't work
>}
I don't know the answer to your question; I'm also interested in what others
have to say. However, I have to wonder if Perl is looking at &{$sub} and
interpretting it as a command to ex
here is two examples of that work for me
require "pl/require.pl";
$functiontocall ='RequireAll';
$functiontocall->();
--
-
my $alias = "home|SplitInput,LoadVariables,DirectUser,";
my ($name, $subs) = split(/\|/, $al
Here is a small script which loads some subs and then depending on
what you enter, then executes the sub inputted:
#!perl -w
my %MyHash = qw(sub0 1 sub1 1 sub2 1 sub3 1 sub4 1 sub5 1
sub6 1 sub7 1 sub10 1 sub11 1 );
foreach my $MyKeys (sort keys %MyHash) {
printf "%-
Jessee Parker wrote:
> Sorry to make this a little clearer, I want to find the delimiter and then
> process what's past the delimiter. So all the html code would go into a
> variable and then all the text would go into a different variable. Sorry
> for the confusion.
>
> Jessee
try the followi
Rohit Mishra-R53658 wrote:
> Hi all,
>
> Is there any way to open a "handle" to an array as we open a handle to a
> file?? The condition being we can use that "array handle" everywhere we
> can use a file handle
>
why would you want to do that? to save yourself not having to move the whol
Hello, All:
What's the simplest method to remove a directory *and* it's contents?
(rmdir only works on empty directories.)
--
Eric P.
Sunnyvale, CA
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
.--[ [EMAIL PROTECTED] wrote (2002/09/24 at 10:38:59) ]--
|
| Hello, All:
|
| What's the simplest method to remove a directory *and* it's contents?
| (rmdir only works on empty directories.)
|
`-
rm -rf but be careful, a
on Tue, 24 Sep 2002 13:46:32 GMT, Rohit Mishra-R53658 wrote:
> Is there any way to open a "handle" to an array as we open a handle
> to a file?? The condition being we can use that "array handle"
> everywhere we can use a file handle
http://search.cpan.org/author/ERYQ/IO-stringy-2.108/lib/I
Robert Zielfelder wrote:
>
> I have a bunch of subroutines defined in the script, but they don't need
> to
> be invoked unless the "@list_of_subs" contains the name of the sub. I
> know that I could stick a bunch of if statements in there and make this
> work, but
> I am trying to be a little mo
Frank Wiles wrote:
> .--[ [EMAIL PROTECTED] wrote (2002/09/24 at 10:38:59) ]--
> |
> | Hello, All:
> |
> | What's the simplest method to remove a directory *and* it's contents?
> | (rmdir only works on empty directories.)
> |
> `
Hello All,
Where does a loadable object for a particular module get stored (ie what
directory)? Below is the error message i'm getting.
Can't locate loadable object for module Time::HiRes in @INC (@INC contains:
/usr/local/ActivePerl-5.6/lib/5.6.1/sun4-solaris-thread-multi
/usr/local/ActiveP
On Tue, Sep 24, 2002 at 10:18:58AM -0400, chad kellerman wrote:
> Is there a way I can "mark" a part of a script so that, if I wrap an
> eval around a particular statement I can go back to that mark and retry
> it.
>
> I have to make quite a few ssh connections to various servers, I was
> won
On Tue, Sep 24, 2002 at 01:43:50PM -0400, Zielfelder, Robert wrote:
>
> foreach $sub (@list_of_subs) {
> &{$sub}; ##-- this is the part I am stuck on. This doesn't work
> }
>
This is called a soft reference, and soft references are generally a bad
idea. However, it should work.
On Tue, Sep 24, 2002 at 10:38:59AM +0800, [EMAIL PROTECTED] wrote:
> What's the simplest method to remove a directory *and* it's contents?
> (rmdir only works on empty directories.)
I'm somewhat surprised by the advice given so far (rm -rf and File::Remove;
the first isn't portable, the second r
On Tue, Sep 24, 2002 at 03:08:44PM -0400, William Black wrote:
> Where does a loadable object for a particular module get stored (ie what
> directory)? Below is the error message i'm getting.
In @INC, in one of the architecture-specific directores, under an auto
subdirectory. You shouldn't nee
On Tue, 24 Sep 2002, Michael Fowler wrote:
> On Tue, Sep 24, 2002 at 10:38:59AM +0800, [EMAIL PROTECTED] wrote:
> > What's the simplest method to remove a directory *and* it's contents?
> > (rmdir only works on empty directories.)
>
> I'm somewhat surprised by the advice given so far (rm -rf an
Hello all,
How do you add a path to @INC?
>From: Michael Fowler <[EMAIL PROTECTED]>
>To: William Black <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED]
>Subject: Re: loadable object !!
>Date: Tue, 24 Sep 2002 12:21:08 -0800
>
>On Tue, Sep 24, 2002 at 03:08:44PM -0400, William Black wrote:
> > Wh
Sorry to pose a slightly off-topic question...
A colleague has a Sun Sparcstation 20 for sale. He says it will run linux. I
was thinking it might be a good project machine for running an Apache
server, trying out some cgi scripts, Perl, etc.
Any opinions on whether this might be suitable? (du
William Black wrote:
> Hello all,
>
> How do you add a path to @INC?
>
>
the simplest way would be just to use the 'use lib' pragmas like:
use lib 'path you want to add to @INC';
or:
BEGIN{
push(@INC,'path you want to add to @INC');
}
david
--
To unsubscribe, e-mail: [EMAIL PROTE
Hello all,
When trying to install modules, it's all dandy until I get to the
%make install
part and then it cacks out with an error. I need to be root to install it
into the path. How do I make install somewhere else? I can then explicity
push onto @INC within my script.
Thanks,
Nathanael
Nkuipers wrote at Tue, 24 Sep 2002 23:27:08 +0200:
> When trying to install modules, it's all dandy until I get to the
>
> %make install
>
> part and then it cacks out with an error. I need to be root to install it
> into the path. How do I make install somewhere else? I can then explicity
On Tue, Sep 24, 2002 at 02:27:08PM -0700, nkuipers wrote:
> How do I make install somewhere else? I can then explicity push onto @INC
> within my script.
See perldoc -q 'my own module'.
That's the second time I've given that advice out today. Anyone for a
third? :)
Michael
--
Administrator
On Tue, Sep 24, 2002 at 04:36:47PM -0400, William Black wrote:
> How do you add a path to @INC?
See perldoc -q 'my own module' for information on installing and using a
module installed into your own library directory. The advice works equally
well for modules installed in other non-standard loc
Robert Zielfelder wrote:
>
> I have a script that uses an array to determine weather or not a subroutine
> needs to be run or not. I want to be able do a foreach on the array and
> invoke the subroutine using the control variable. The names of the
> subroutines are the same as the items inside
Kevin Pfeiffer wrote:
> Sorry to pose a slightly off-topic question...
>
> A colleague has a Sun Sparcstation 20 for sale. He says it will run linux.
> I was thinking it might be a good project machine for running an Apache
> server, trying out some cgi scripts, Perl, etc.
>
> Any opinions on w
My brain is blocking something really simple here.
What I want to do is add a block of text to
a image created as
my $graph = new GD::Graph::pie(1200, 1200);
Could someone show me an example of adding a
wrapbox of text to this image ?
Thanks,
-pete
--
To unsubscribe, e-mail: [EMAIL PRO
Hi all.
I am hoping that someone can help me determine what is wronf with my regualr
expression.
background info: @array contains 'text', numbers, INT, or TINYINT.
I am trying to identify if the array element is a number.
What I have right now is:
if($array[$x] =~ /\d{1,3}?/)
{
do somethi
>if($array[$x] =~ /\d{1,3}?/)
>{
>...do something
>}
>
>Unfortunately this if statement never appears to come true.
That's because you have two quantifiers specified, the {1,3} and the ?.
for (@array) {
if ( m/^\d+$/ ) { #regex breaks on decimal numbers
do something...
}
}
--
To unsubscribe
It definitely depends on price.
A sparc 20 isn't even a match for most Pentium IIIs running just about
any flavor of UNIX or LINUX.
Not to mention, hardware is proprietary (uses S-bus not PCI bus), a
special keyboard is needed, and monitor, unless you get a converter.
If your not going to use
see my comments at bottom...
-Original Message-
From: Shaun Bramley [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 4:39 PM
To: [EMAIL PROTECTED]
Subject: Regular Expression help
Hi all.
I am hoping that someone can help me determine what is wronf with my regualr
expressio
I have an Ultra5 running Debian Sparc64 dist.. runs perfect. Probably my
favorite install i've got running but that might just be due to how much
time i've spent on it. It's cpu utilization is pretty damn impressive too.
I've got a dual 500 (maybe its dual 400, can't recall).
Anyways, I do mo
Hi there,
I am looking for a way of collecting directory and file information on
Window NT, i.e. permissions, ownership, size, creation and modification
timestamp etc and putting it in a csv file. If you know of any existing
scripts somewhere on the web could you please let me know.
Thanks in
Hello all,
I currently currently passing a subroutine one scalar value and two arrays.
Both array's work before and after the function call. However only one of
hte arrays works within the subroutine.
example code:
print @array1; //this works
print @array2; //this works
subroutine($a, @array
Shaun Bramley wrote:
>
> Hello all,
Hello,
> I currently currently passing a subroutine one scalar value and two arrays.
> Both array's work before and after the function call. However only one of
> hte arrays works within the subroutine.
>
> example code:
>
> print @array1; //this works
>
Hi, Shaun, :)
> I currently currently passing a subroutine one scalar value and two
> arrays.
Hmm. This is not what you're doing in the example code. In the
example code, this line:
subroutine($a, @array1, @array2);
says "Call subroutine with arguments of $a, all of the entries in
@array1, a
When you pass an array to a subroutine in Perl, it takes the arguments and
passes a list, I _think_ even if you use that format. It would be much
better, IMHO to use references. Something like:
### SCRIPT #
use strict;#Get in the habit of using th
thx for the help,
i've already using a pop3 like Net::POP3 or even create a open port to
listen.
but my script is on the pop3 server so if i have to login to myself it
useless.
if i have to install setuid it's dangerous or not... ?
one of my friend say if i install setuid and setgid it's dang
87 matches
Mail list logo