RE: Sybase DBlib & CGI issue

2003-01-13 Thread .IT Workflow - Terry Honeyford
as far as I can make out, apache needs to be running as a sybase user, you may also need to set some $ENV variables within the script eg: $ENV{'DSQUERY'}='SQLCAS' HTH Terry -Original Message- From: Dan Muey [mailto:[EMAIL PROTECTED]] Sent: 10 January 2003 17:41 To: Andy Bridger; Beginne

Re: Remove some, not all \n from a text block

2003-01-13 Thread Paul Johnson
Rob Dixon said: > In general a string is undefined if nothing has yet been assigned to it. > It's not a real value in that you can compare against it ( $x == undef > doesn't work properly ) but you can test for it (if undef $x) and set a if (defined $x) { ... } > variable back to being undefin

Date manipulation

2003-01-13 Thread David Samuelsson (PAC)
I have an nice script that lest me list stuff from a certian date in time. It based on: DD-MON-YY (say 01-jan-03) that will be from the first of january. I am trying to add more functionality to the script. I need a function where i get an variable $days say 90, then i must subtract 90 days from

Re: slice indexing

2003-01-13 Thread Bryan Harris
>> I need to slice an array such that it gives me the first through the 4th to >> last in a variable length array. I thought I could just do: >> >> @comments[0..-4] >> >> but Perl seems to choke on this. It's perfectly okay with a slice using two >> negative #s: >> >> @comments[-2..-4] >

Re: Removing strings

2003-01-13 Thread Rob Dixon
"John W. Krahn" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > This will work but it will also remove the space in front of the match: > > s/(\s|^)#ba(?=\s|$)//; > s/((?<=\s)|^)#ba(?=\s|$)//; /R -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

Re: Formfeed in html (perl/cgi)

2003-01-13 Thread Tim Musson
Hey dhoubrechts, My MUA believes you used Mozilla 4.75 [fr] (X11; U; Linux 2.2.17-21mdk i686) to write the following on Saturday, January 11, 2003 at 6:06:11 PM. d> It's just what I want to do, a new sheet of paper out of the d> printer. I'm waiting for your page on next monday Here it

Duping IO::Srting

2003-01-13 Thread Beau E. Cox
Hi - I would like to pass a string scalar to an involked process as STDIN; I can do this with IO::File and IO::Socket classes, but not IO::String. A snippitt (sp?): my $fh = new IO::File; $fh->open("< something") or die "cannont open post.request"; open SAVEIN, '<&STDIN'; open (ST

Re: Duping IO::Srting

2003-01-13 Thread Jenda Krynicky
From: "Beau E. Cox" <[EMAIL PROTECTED]> > I would like to pass a string scalar to an involked process > as STDIN; I can do this with IO::File and IO::Socket > classes, but not IO::String. > > > I get 'cannot dup: Invalid Argument' when trying IO::String as the > source. It seems 'fileno' returns

Re: Why can't use SQL "GROUP BY..."?

2003-01-13 Thread Dan Muey
Oops sorry about that, I was trying to change it form html to text format and hit send. It's Monday. Any who, so you ran the -print $query;- bit and copied and pasted what that printed out directly into your Db program and it worked? You didn't just type in the same thing thinking it's the same

ftp: error Bad file descriptor

2003-01-13 Thread Michael Kramer
For some reason when I use NET:FTP's get. I will get an error of "Bad file descriptor". What does this mean. Here is my code. I left stuff out last time. use Net::FTP; $ftp = Net::FTP ->new("$ip_address", Timeout => 200, debug => 1,

Re: Re[2]: Titlecase

2003-01-13 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Irina Volkova) writes: >Stefan Lidman <[EMAIL PROTECTED]> wrote: >> >> David Gerler wrote: >> > >> > Hi, >> > I have a line of text that is all uppercase and I need to change it >> > to titlecase. >Try >$title =~ s/\b(\w+)\b/\u\L$1/g;

Re: Why can't use SQL "GROUP BY..."?

2003-01-13 Thread Dan Muey
Can you turn off the html and send mail as text instead? So basically you tested it on an Oracle database but your script was using CSV not oracle? Bad form my friend. http://www.tuxedo.org/~esr/faqs/smart-questions.html That wasted much time trailing the wrong stuff. Please do better next

Re: Why can't use SQL "GROUP BY..."?

2003-01-13 Thread Jeff Boes
On Fri, 2003-01-10 at 00:33, Philip Newton wrote: > On Thu, 9 Jan 2003 22:59:03 +0800 (CST), [EMAIL PROTECTED] (Gary fung) > wrote: > > > My coding is similar as: > > > > $value2 = $dbh->prepare("SELECT page FROM $Table > > > > GROUP BY page") || die "Couldn't add record, ".$dbh->errstr(); > >

perl vs tcl?

2003-01-13 Thread Sean Rowe
I'm trying to argue my somewhat biased opinion that perl is better than tcl. I want to embed perl in a c program we use because of it's speed and object oriented nature. They want to use tcl because they don't know perl and are comfortable with tcl. I'm not as familiar with tcl as I am with

RE: perl vs tcl?

2003-01-13 Thread Timothy Johnson
I think that before anyone can tell you whether it's better, you might have to explain what you're trying to do. Are you trying to create a GUI for a program? Are you parsing text? etc, etc... -Original Message- From: Sean Rowe [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003

reference problem (i think)

2003-01-13 Thread Joe Mecklin
i'm building a routine in a module (ISD.pm) that will clear a list of variables (set them to ""), with the intent of expanding the functionality further in the future. when called, the sub is passed a list of strings that are variable names without the leading "$". my goal is to append the "$" to

RE: Date manipulation

2003-01-13 Thread Wagner, David --- Senior Programmer Analyst --- WGO
David Samuelsson (PAC) wrote: > I have an nice script that lest me list stuff from a certian date in > time. It based on: > > DD-MON-YY (say 01-jan-03) that will be from the first of january. I > am trying to add more functionality to the script. I need a function > where i get an variable $days

RE: reference problem (i think)

2003-01-13 Thread Dan Muey
foreach $f(@fields) { $$f = ""; # or use undef, whatever } If strict refs is in use this won't work unless you turn them off do the $$f = ""; bit then turn them back on if stricy refs was in use So actually ( or somehting like it, I'm in a hurry and may have been sloppy )... foreach $f

Re: Removing strings

2003-01-13 Thread dan
I'm assuming that yours rob will just remove the #ba, without the space. While this was what I was originally looking for, John's solution removing the #ba and the space before is more convenient, saves me having to do s/ / /g; then. dan Network Administrator & Head Coder http://www.abovenet.org

[Fwd: Re: perl vs tcl?]

2003-01-13 Thread Sean Rowe
Original Message Subject: Re: perl vs tcl? Date: Mon, 13 Jan 2003 11:14:51 -0600 From: Sean Rowe <[EMAIL PROTECTED]> To: Timothy Johnson <[EMAIL PROTECTED]> References: No gui programming. I think it's used more for logic tha

FW: perl vs tcl?

2003-01-13 Thread Timothy Johnson
-Original Message- From: Sean Rowe [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 9:15 AM To: Timothy Johnson Subject: Re: perl vs tcl? No gui programming. I think it's used more for logic than anything else. Not really for string manipulation. It's hard to explain becaus

RE: Sybase::DBlib and CGI issue

2003-01-13 Thread Andy Bridger
This was the issue - thanks for your help! -Original Message- From: Michael Peppler [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 4:50 PM To: [EMAIL PROTECTED] Subject: Re: Sybase::DBlib and CGI issue You wrote: >The CGI bit is working - am able to display text, forms etc co

Re: perl vs tcl?

2003-01-13 Thread Sean Rowe
No gui programming. I think it's used more for logic than anything else. Not really for string manipulation. It's hard to explain because the program is so huge, no one person really knows everything about it. It seems to be more for extending the programs functionality so that we don't hav

RE: reference problem (i think)

2003-01-13 Thread Joe Mecklin
thanks Dan, but no go. here is the current incarnation, based on your suggestion: sub clear_input { no strict 'refs'; my %options = @_; my $fields = $options{FIELDS}; my (@field) = split /, /, $fields; print "\$fields = $fields "; print "\@field = @field ";

RE: reference problem (i think)

2003-01-13 Thread Dan Muey
Are there actually variables earlier in the script? $school_id = "SKOOL ID"; $school_name = "SKOOL NM"; $school_address = "SKOOL AD"; Print "ID - $school_id \n NM - $school_name \n AD - $school_address \n"; Run that then the code you have now and see what you get. Also print "\$f = $f = .$$f." m

RE: reference problem (i think)

2003-01-13 Thread Joe Mecklin
yes, the variables exist in the calling program (school_data), defined at the beginning of the program (my $school_id, my $school_name, etc). if i pass the actual variable, i get the stored value ("135" in the 2nd printout listing. i've tried using "my" and "our", to no effect. this is part of a

RE: reference problem (i think)

2003-01-13 Thread Dan Muey
Try just this : #!/usr/bin/perl use ISD; # or whatever you need to be able to use you module $school_id = "SKOOL ID"; $school_name = "SKOOL NM"; $school_address = "SKOOL AD"; Print "BEFORE :: ID - $school_id \n NM - $school_name \n AD - $school_address \n"; &ISD::clear_input(FIELDS => "school_

RE: reference problem (i think)

2003-01-13 Thread Joe Mecklin
update: i copied the clear_input() from ISD.pm to school_data and the values do appear as expected, so the problem is in how to pass the strings from the script to the module (or how to manipulate them in the module) and still have them be referenced as variables. any ideas in that direction? O

Re: reference problem (i think)

2003-01-13 Thread Rob Dixon
Hi Joe I got a bit lost amongst all those 'print' statements, but what you need to know is this: $current_field = 'school_id'; ${$current_field} = 1234;# same as $school_id = 1234 HTH, Rob "Joe Mecklin" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTE

Re: reference problem (i think)

2003-01-13 Thread Rob Dixon
Hi Joe I got a bit lost amongst all those 'print' statements, but what you need to know is this: $current_field = 'school_id'; ${$current_field} = 1234;# same as $school_id = 1234 HTH, Rob "Joe Mecklin" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTE

Re: error Bad file descriptor

2003-01-13 Thread Rob Dixon
Hi Michael First, and most obviously, your actual parameters for new() are a little odd. 'debug' needs to be 'Debug' (and that fix on its own will give you a lot more information) and 'ftp_passive' should be 'Passive' (although it shouldn't make mucxh difference). See what you get with debug enab

Re: Removing strings

2003-01-13 Thread Rob Dixon
Hi Dan "Dan" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I'm assuming that yours rob will just remove the #ba, without the space. > While this was what I was originally looking for, John's solution removing > the #ba and the space before is more convenient,

RE: reference problem (i think)

2003-01-13 Thread Dan Muey
I was having him print the variables before and after the module was supposed to modify them to see what happened. That's what all the print statements are. IE if the variables stil have values after the module then look in the module. IE if they don't the module is working like it should. The i

RE: reference problem (i think)

2003-01-13 Thread Dan Muey
What is the output of the code I sent when you use 'clear_input2'? If it makes the variables blank then the module code works ok and we need to figure out why your module can't use refs or otherwise access your variables. Then we need to determin if it's all variables or just refs. If not then

RE: vb or ubb

2003-01-13 Thread Hanson, Rob
I don't know of any module, but it would be easy to build one. The example below isn't great, but it gets the job done. I works with nested tags, but will have problems if you use [b] or [i] inside of [url]. If you need to add more, just add them to the %replace hash, where '' is the data inside

RE: reference problem (i think)

2003-01-13 Thread Joe Mecklin
Dan, here is the output with your additions. BEFORE :: ID - 101 NM - Arapaho Elementary AD - 1300 Cypress Dr. # this is the call to clear_input in ISD.pm $fields = school_id, school_name, school_address @field = school_id school_name school_address $f = school_id = .. $f = school_name =

RE: reference problem (i think)

2003-01-13 Thread Dan Muey
Gotcha. Did you do the test that has the module just print a variable by name? IE print "ID - $school_id \n"; # from within the module That is to see if it has to with refs or all variables. IE the module isn't seeing the refs ($$f) obviously but can it see the actual non ref version? If it can

installing perl modules requiring local modules

2003-01-13 Thread Edwin Madari
Hi all, forgive me if this is not the forum to ask this question, and would appreciate any help. working on a system where I do not have root privileges, I have installed quite a number of local modules under my home directory. No one of the modules that I am installing requires couple of my

RE: reference problem (i think)

2003-01-13 Thread Joe Mecklin
one respondent suggested if i gave out more of the code for a better overview of the entire process i may get better results. it was not my intention to keep anything out of sight, i just didn't want to include a lot of fluff code. if anyone wants the entire code (there's not a lot, actually) - e

Re: Printing Output To Screen.

2003-01-13 Thread Korthrun
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 It has been asked that I print some code. I found this nifty site so I figure this is the best time to use it: http://www.nomorepasting.com/paste.php?pasteID=222 -BEGIN PGP SIGNATURE- Version: PGPfreeware 6.5.8 for non-commercial use

RE: reference problem (i think)

2003-01-13 Thread david
Joe Mecklin wrote: > Dan, > > here is the output with your additions. > > BEFORE :: ID - 101 > NM - Arapaho Elementary > AD - 1300 Cypress Dr. > > # this is the call to clear_input in ISD.pm > $fields = school_id, school_name, school_address > @field = school_id school_name school_address

RE: reference problem (i think)

2003-01-13 Thread Dan Muey
Excellent info! -Original Message- From: david [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 1:59 PM To: [EMAIL PROTECTED] Subject: RE: reference problem (i think) Joe Mecklin wrote: > Dan, > > here is the output with your additions. > > BEFORE :: ID - 101 > NM - Arapaho

RE: reference problem (i think)

2003-01-13 Thread Joe Mecklin
David, this appears to be exactly what i was looking for, and i thank you with infinite groveling *g*. the reason i wanted something like this is because i like to name my variables and cgi parameters the same as my database fields - $school_id = school_id (cgi parameter) = school_id (mysql field

Conditional hook test

2003-01-13 Thread anonymous8653120
Can someone tell me what is going wrong with my conditional hook tests as marked below? #!/usr/bin/perl -w use warnings; #this program's specification is on page 167 #in the Llama book under exercise 1 my ($source, $go, $dest, $expression, $over); print"\$over = 1" if($ARGV[0] eq "-o"); until($go)

Re: perl vs tcl?

2003-01-13 Thread Paul Johnson
On Mon, Jan 13, 2003 at 10:36:46AM -0600, Sean Rowe wrote: > I'm trying to argue my somewhat biased opinion that perl is better than > tcl. I want to embed perl in a c program we use because of it's speed > and object oriented nature. They want to use tcl because they don't > know perl and ar

read file in from bottom instead of top

2003-01-13 Thread Larry Sandwick
I have tried to read a file in backwards in stead of from the top without any success !!! The original code looks like this . open(DATABASE, "

Re: read file in from bottom instead of top

2003-01-13 Thread Paul Johnson
On Mon, Jan 13, 2003 at 04:15:20PM -0500, Larry Sandwick wrote: > I have tried to read a file in backwards in stead of from the top > without any success !!! http://search.cpan.org/author/URI/File-ReadBackwards-0.99/ > Any suggestion would be helpful. _Always_ search CPAN first :-) -- Paul Jo

RE: read file in from bottom instead of top

2003-01-13 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Larry Sandwick wrote: > I have tried to read a file in backwards in stead of from the top > without any success !!! > > The original code looks like this . > > open(DATABASE, " read!\n"; > > I have tried the following. > > I do not get any errors from Perl, it just ignores the command. > > >

RE: read file in from bottom instead of top

2003-01-13 Thread Mark Anderson
> I have tried to read a file in backwards in stead of from the top > without any success !!! http://search.cpan.org/author/URI/File-ReadBackwards-0.99/ReadBackwards.pm /\/\ark -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAI

x-file tests

2003-01-13 Thread HENRY,MARK (HP-Roseville,ex1)
Hi All, I'm experiencing some odd results using the x file tests on files and directories. When I run the following: opendir(CURDIR, "c:\\") or die "cant open directory: $!\n"; foreach $direntry (readdir CURDIR) { if (-f $direntry) { print "$direntry is a file..\n"; }

RE: x-file tests

2003-01-13 Thread Wagner, David --- Senior Programmer Analyst --- WGO
HENRY,MARK (HP-Roseville,ex1) wrote: > Hi All, > > I'm experiencing some odd results using the x file tests on files and > directories. > > When I run the following: > > opendir(CURDIR, "c:\\") or die "cant open directory: $!\n"; > foreach $direntry (readdir CURDIR) { > if (-

Timing the response

2003-01-13 Thread Najamuddin, Junaid
Hi, Due to a latency issue I want to time a particular intranet web page response It is a web page that looks for the dsl availability for an address being input When you hit submit it checks for the availability of dsl and output a response I want to time that response from the time the user hit

Re: Epoch midnight

2003-01-13 Thread Todd Wade
"Rob Dixon" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > "Deborah Scott" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I thought I understood the answer, but I need more details. > > > > What exactly would I enter if

RE: x-file tests

2003-01-13 Thread HENRY,MARK (HP-Roseville,ex1)
David, Indeed you're right - good eye. Thanks! Mark > -Original Message- > From: Wagner, David --- Senior Programmer Analyst --- WGO > [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 13, 2003 1:58 PM > To: 'HENRY,MARK (HP-Roseville,ex1)'; '[EMAIL PROTECTED]' > Subject: RE: x-file tes

Re: Removing strings

2003-01-13 Thread dan
OK, that worked fine, until a \ character was introduced into the variable which contains the information to be removed, for example, #blah\ I tried both john's & rob's methods, both crashed the service. Any clues? Cheers. -- dan Network Administrator and Head Coder http://www.abovenet.org IRC Ne

Re: Epoch midnight

2003-01-13 Thread david
Todd W wrote: > [trwww@devel_rh trwww]$ perl > use Time::Local; > ($day, $month, $year) = ( localtime() )[3 .. 5]; > > $epoch = timelocal( 0, 0, 0, $day, $month, $year ); > > print( scalar( localtime( $epoch ) ), "\n" ); > Ctrl-D > Fri Jan 10 00:00:00 2003 > > $epoch holds the seconds between t

Re: Printing Output To Screen.

2003-01-13 Thread Todd Wade
"Korthrun" <[EMAIL PROTECTED]> wrote in message 000b01c2ba92$be2f07e0$22cf483f@korth">news:000b01c2ba92$be2f07e0$22cf483f@korth... > I have written a program in perl that collects some data and prints it to the screen based on parameters that are given > on the command line (gee original idea for

Re: vb or ubb

2003-01-13 Thread Paul Murphy
Top posting eh? We won't get in trouble will we? :) Thanks for that Rob, building it myself was going to be a last resort, as I figured it must have been done before a million times, with the amount of forum software there is out there. Maybe there is something in Sporum I could liberate... Yo

Re: installing perl modules requiring local modules

2003-01-13 Thread R. Joseph Newton
"...does any one have an idea how to install a perl modules locally, that in turn requires other locally installed modules." Edwin Hi Edwin, Look for Perl Package Manager in your installation. If Perl is installed, you should be able to call it by entering ppm at the command line. You will the

finding variable name in string

2003-01-13 Thread Dan Muey
Hello, Sorry to bother but... I have a script that I have to do an eval on code that someone else has put in a database. ... $code = "$row[1] $row[2] $row[3]"; # @row is from a database query eval $code; if($@) Print "sorry -$@-"; ... It works great except there is one variable that th

Re: Removing strings

2003-01-13 Thread Rob Dixon
Hi "Dan" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > OK, that worked fine, until a \ character was introduced into the variable > which contains the information to be removed, for example, #blah\ > > I tried both john's & rob's methods, both crashed the serv

Re: Timing the response

2003-01-13 Thread Mark Goland
you can try to use alarm and time your aperation. if times expires catch sig{alar}, and do your erro stuff inside . Mark - Original Message - From: "Najamuddin, Junaid" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, January 13, 2003 5:03 PM Subject: Timing the response > Hi,

Re: finding variable name in string

2003-01-13 Thread Jenda Krynicky
From: "Dan Muey" <[EMAIL PROTECTED]> > Sorry to bother but... > I have a script that I have to do an eval on code that someone else > has put in a database. ... Are you sure you want to do that? Are you sure you want them to be able to run any code they with inside your script? Deleting files th

Re: Conditional hook test

2003-01-13 Thread Rob Dixon
Hi. I'm confused. I don't have a copy of the Llama, and don't understand what the -o option is supposed to do. I also don't know what a 'conditional hook test' is. I may be being ignorant, but all I can point out is this: <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTEC

RE: Conditional hook test

2003-01-13 Thread anonymous8653120
-BEGIN PGP SIGNED MESSAGE- Thanks for pointing out that I was "not setting $over anywhere", the code snippet below clears that up. #!/usr/bin/perl -w use strict; #this program's specification is on page 167 #in the Llama book under exercise 1 my ($source, $go, $dest, $expression, $over);

Re: Printing Output To Screen.

2003-01-13 Thread R. Joseph Newton
Why dont you pipe your programs output to more? Good tip. Portable too, as it works precisely the same in Windows command and Unix. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]