Re: perl DBI

2003-03-25 Thread Brett W. McCoy
On 26 Mar 2003, mark sony wrote: > What are the good online sites which will give details about perl > DBI, about using perl interacting with databases,right from basic > to advanced stage? Start with http://dbi.perl.org/ -- Brett http://www.chapelperil

Re: Problem with regular expressions!!!

2003-03-18 Thread Brett W. McCoy
On Tue, 18 Mar 2003, Marcelo Taube wrote: > As u probably have guessed some part of my code is not working properly and > i don't understand why!! > > This is the code. > # > $file_completename =~ /(.*?)\.(.*)/; > if ($2 eq $extension]) { > #DO SOMETHING!!! >

Re: Good Perl cgi book?

2003-03-18 Thread Brett W. McCoy
On Tue, 18 Mar 2003, Dennis Stout wrote: > That is the mother of all perl books. It's also more of a reference book than > anything else. Altho if you're that type of learner, it'll be a great read. > It should also sit on the bookshelf of any Perl programmer, regardless of > whether they use it

Re: sprintf questions

2003-03-13 Thread Brett W. McCoy
On Wed, 12 Mar 2003, David Gilden wrote: > Is the following considered ok as in good PERL style? > > #!/usr/bin/perl -w > > $num =1.12345; > > my $tax_formated = sprintf("%.2f", $num); # <--- THIS LINE > > print "$tax_formated " ,length($tax_formated), "\n"; The important thing is, does it do w

RE: html table limit

2003-03-12 Thread Brett W. McCoy
On 12 Mar 2003, Rob Benton wrote: > 1000+ rows is a rare situation on my page but in can happen. It's a dbi > script. I couldn't really think of a better design but I am open to > suggestions... Ideally you could page the returned data in groups of 100. Take a look at this: http://www.carumba

RE: html table limit

2003-03-12 Thread Brett W. McCoy
On 12 Mar 2003, Rob Benton wrote: > > > Is there a limit to how many rows you can put in an html table? I > > > can't find anything wrong with my script but when I get over 1000 > > > rows or so in my tables they start drawing weird borders. I think if you are needing tables on an HTML page that

Re: Camel Book

2002-03-20 Thread Brett W. McCoy
On Wed, 20 Mar 2002, Octavian Rasnita wrote: > I heard about that famous Camel Book for Perl but I don't know its real > name. The full name is _Programming Perl_, by Larry Wall, et al. It's an O'Reilly book and can be found in any bookstore that has a computer section. -- Brett

Re: first glimpse of regex

2002-03-19 Thread Brett W. McCoy
On Tue, 19 Mar 2002, Matthew Harrison wrote: > i need to say something like > if $username = "" then ... > > where "" is literally nothing. i want to match it ONLY if the variable is > totally empty. > > this is my first experience with regex so what should this be? if(!$username) { } An e

Re: Can someone explain the difference ?

2002-03-19 Thread Brett W. McCoy
On Tue, 19 Mar 2002, Kamali Muthukrishnan wrote: > I have the following perl-script , which gives the user ( supposedly a > first or second grader) a problem in addition or subtraction by > generating random numbers. The random numbers generated are between 1 > and 10 for first graders and 10 an

Re: extracting params to a hash

2002-03-05 Thread Brett W. McCoy
On Tue, 5 Mar 2002, Jeff 'japhy' Pinyan wrote: > On Mar 4, Shaun Fryer said: > > >I'm trying to convert an old script that used cgi-lib.pl over to using > >CGI.pm. In order to save time I'd like to simply do something like > >what follows (though that doesn't actually work it seems). > > > >%in =

Re: Asynchronous Perl

2002-03-04 Thread Brett W. McCoy
On Mon, 4 Mar 2002, Jason Frisvold wrote: > I'm looking for a way to have perl output in an asynchronous > manner. What I mean is, if I write a perl script to generate a large > amount of data and output it to the screen, it seems to pause until some > unknown buffer is full and then spit

Re: SHIFT in a subroutine

2002-02-20 Thread Brett W. McCoy
On Wed, 20 Feb 2002, Curtis Poe wrote: > Great description with one minor caveat: shift with no arguments will > pull from @ARGV if not used in a subroutine. Yes, thanks for pointing that out. -- Brett http://www.chapelperilous.net/ ---

Re: SHIFT in a subroutine

2002-02-20 Thread Brett W. McCoy
On Wed, 20 Feb 2002, Nestor Florez wrote: > I was wondering about the "shift" inside a subroutine. > > I have never used it. What is the purpose of it been there? It pulls off the first element of the array passed to it. Using shift with no arguments always pulls from @_ -- it returns $_[0] an

Re: Spaces in form values --> cgi

2002-02-15 Thread Brett W. McCoy
On Fri, 15 Feb 2002, David Gilden wrote: > Kayak Touring Rescue >Techniques > > Or do I need to use underscores, > > Kayak Touring Rescue >Techniques I believe the spaces will get replaced with %20. I question the necessity of making the value of the option the same as the text you are displa

Re: buton names

2002-02-14 Thread Brett W. McCoy
On Thu, 14 Feb 2002, GsuLinuX wrote: > It worked on normal submit buttons but problem on image submit button. > > I couldn't manage to work it with > image submit buttons. Fot example if their 2 image submit buttons as : > > src="c:\windows\desktop\house.gif" width="100" height="50"> > src="c:\

Re: use, require, do... which is appropriate?

2002-02-12 Thread Brett W. McCoy
On Tue, 12 Feb 2002, W P wrote: > my problem is simple. i have a number of scripts on my server, and i > would like all of them to initially run a function defined by me. > however, it would be burdensome to write that function over for every > script. creating a custom module, however, doesn'

Re: image button submit?

2002-02-08 Thread Brett W. McCoy
On Fri, 8 Feb 2002, Josiah Altschuler wrote: > Is there a way to use an image button in CGI.pm to submit? Sure: print image_button(-name=>'name', -src=>'path/to/img'); will produce: This is documented in the CGI.pm documentation, accessible via perldoc. -- Brett

RE: beginners-cgi Digest 8 Feb 2002 17:29:24 -0000 Issue 165

2002-02-08 Thread Brett W. McCoy
On Fri, 8 Feb 2002, Allen Wang wrote: > I want to change the string "d:\orant\oracle" to "d:\\orant\\oracle" > > Anyone know how to do this? $string =~ s|\\||g; (\ is used to escape metacharacters in a regexp, so you need to escape \ also). -- Brett

Re: Reading a big text file

2002-02-08 Thread Brett W. McCoy
On Fri, 8 Feb 2002, Octavian Rasnita wrote: > To store the file in an array, then to insert the changed value in that > array, and then to write that array to the file, or to use a temporary file > to store each line from the source file and twhen I want to modify a line, I > have just to insert

Re: procmail or perl to drop dups?

2002-02-08 Thread Brett W. McCoy
On Fri, 8 Feb 2002, Dennis G. Wicks wrote: > Has anyone developed any method to drop messages that > are cross-posted to both [EMAIL PROTECTED] and > [EMAIL PROTECTED]? Here's the procmail recipe I use for duplicates: :0 Whc: msgid.lock | formail -D 8192 msgid.cache :0 a: DUPLICATES -- Brett

RE: Passing a hash through a URL

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Josiah Altschuler wrote: > Hi. Thanks for the response. I'm passing the hash with an href in this > manner. So does this mean that I'm not using get or post? > > $query = CGI->new({red => [%{$clusArrayHash[$i]}]})->query_string; > print pre h6 (" ", a ({ -href

Re: module errors

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Uwe Voelker wrote: > > use HTML::Parse; > > > The module is called HTML::Parser. A further investigation via CPAN showed me that HTML::Parse is part of the HTML::Tree bundle and is now actually a deprecated module, according to the readme. -- Brett

Re: module errors

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, GsuLinuX wrote: > we wroted a perl code to fetch some information we want from a web site. The code is >as below: > > #!/usr/bin/perl > use LWP::Simple; > use HTML::Parse; > We have the debug error: > > Can't locate HTML/Parse.pm in @INC(@INC contains: > /usr/lib/perl5/5.6

Re: To write a script that reads numbers from STDIN and print onSTDOUT.

2002-02-07 Thread Brett W. McCoy
On Thu, 7 Feb 2002, Bruce Ambraal wrote: > Could any one write some coding for the problem. > > In perl against Linx could someone help. > > I want to write a script that reads in four numbers from STDIN and add > the first two together, and than adds the second 2 together. > > The input format

Re: CGI Form Submit Buttons

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002, Andre` Niel Cameron wrote: > But what about cases of having two image buttons? Does the one that is > clicked default as submit or does this require java script? You give them differnet names and have your script do different things based on the name that was clicked. -- Br

Re: printing an email address

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002, Brett W. McCoy wrote: > On Wed, 6 Feb 2002, Octavian Rasnita wrote: > > > I tried to print my email address when it is enclosed in < and > signs but > > it didn't print anything. > > The code: > > > > my $line; > > $li

Re: printing an email address

2002-02-06 Thread Brett W. McCoy
On Wed, 6 Feb 2002, Octavian Rasnita wrote: > I tried to print my email address when it is enclosed in < and > signs but > it didn't print anything. > The code: > > my $line; > $line= ""; > # I also tried with $line = \"; > print "$line"; No need for the double quotes (it will try to interpolate

Re: Hexadecimal Dictionary

2002-02-05 Thread Brett W. McCoy
On Tue, 5 Feb 2002, Fred Sahakian wrote: > Anyone know of a good online Hexadecimal Dictionary? > > I know that %OD%OA is a carriage return, but I need to know what the > code is for a quote mark (") as well as a few others..thanks! perl -e 'foreach(0..127) {printf("%s: %x (%d)\n", chr($_), $_,

Re: validation

2002-02-02 Thread Brett W. McCoy
On Sat, 2 Feb 2002, Brett W. McCoy wrote: > > return 1 unless ($Bid_Amount =~ [/d/] ); > > Your regular expression should be /[0-9]/ Or rather, /\D/ if you are matching against non-numerical values. -- Brett http://www.chapel

Re: validation

2002-02-02 Thread Brett W. McCoy
On Fri, 1 Feb 2002, Al Hospers wrote: > I need a regular expression that will only allow a variable to contain > digits. it should fail if there is anything else in the variable: > dollar signs, commas, dots, alphas, spaces, quotes etc. I thought the > following would work, I am obviously incorre

Re: Perl Compiler

2002-01-03 Thread Brett W. McCoy
On Thu, 3 Jan 2002, Barrie Heck wrote: > We fully respect the conditions of the GPL and in fact have contributed > greatly ourselves towards the development of applications based on perl, as > well as many others. This specific requirement is security related, where a > user with any intelligence

Re: Interesting Chop question.

2001-12-12 Thread Brett W. McCoy
On Wed, 12 Dec 2001, Brett W. McCoy wrote: > > I have a pain in the butt array that SOMETIMES has a CR at the end and > > sometimes does not. Can anyone think of a way to test to see if the \n is > > there and if it is then chop else no chop? Cause if I just use chop

Re: Interesting Chop question.

2001-12-12 Thread Brett W. McCoy
On Wed, 12 Dec 2001, Andre` Niel Cameron wrote: > I have a pain in the butt array that SOMETIMES has a CR at the end and > sometimes does not. Can anyone think of a way to test to see if the \n is > there and if it is then chop else no chop? Cause if I just use chop then it > starts chopping of

Re: Creating a CGI menu

2001-12-12 Thread Brett W. McCoy
On Wed, 12 Dec 2001, Gerry Jones wrote: > I want to create a menu/navigational section for a website I plan on > building, and I would like to know if there are any easy-to-use modules I > could use, or if there's another way. My website will have many levels and I > don't fancy copying, pasting

Re: IP Address Reverse Lookup

2001-12-10 Thread Brett W. McCoy
On Mon, 10 Dec 2001, Brian wrote: > If at all possible, which perl module would I need to call in order to > perform a reverse lookup on an IP address? > > I need to produce something simalar to the "host" command > ie: > > [brian@mustang brian]$ host 12.90.6.4 > 4.6.90.12.in-addr.arpa domain nam

Re: Next 10 Results Help Needed

2001-12-07 Thread Brett W. McCoy
On 7 Dec 2001, Randal L. Schwartz wrote: > > > ... too bad I've already written my *last* WT column, to appear > in Feb 2002, because the magazine is terminating. :( Bummer. -- Brett http://www

Re: graphic manipulation program

2001-12-07 Thread Brett W. McCoy
On Fri, 7 Dec 2001, Carl Franks wrote: > Could someone advise me on a program to use. > I want to use a command-line program to resize .jpegs, and specify > compression. > I've not found anything suitable so far. > The GD module looks promising, but I can't find useful documentation for it. Chec

Re: Help with Debug Please.

2001-12-06 Thread Brett W. McCoy
On Thu, 6 Dec 2001, Andre` Niel Cameron wrote: > Hey I got an error on a script and went to run it from the command line to > figure out what i forgot but to my surprise I got this: > (offline mode: enter name=value pairs on standard input) > > What the he$$ is it and how can I get by it to run m

Re: Generating static HTML Pages

2001-12-05 Thread Brett W. McCoy
On Wed, 5 Dec 2001, Richard S. Crawford wrote: > Long time reader, first time writer here... > > For a personal project, I would like to use Perl to generate static HTML > pages. Can the output of CGI be redirected to a file which can be read > later by a browser? What is the best way to approa

Re: "\n" in Perl

2001-12-05 Thread Brett W. McCoy
On Wed, 5 Dec 2001 [EMAIL PROTECTED] wrote: > I' d like to know why, when I use a cgi script under Win95, the browser > doesn't print in output the carriage-return "\n". > An example: this is my simple cgi script: > > print qq' > > Perl Page > '; > for (1..5) {print qq'Hello\n';} > print qq''; >

Re: variables using blank spaces

2001-12-04 Thread Brett W. McCoy
On Tue, 4 Dec 2001, Wagner Garcia Campagner wrote: > I have a varilable: > > $var = 'asdf asdf asdf'; #using blank spaces > > Then i send it to another script like this: > > > > The problem is when i get it back the value became: > > $var = asdf > > It stops in the first blank space is the

Re: variables using blank spaces

2001-12-04 Thread Brett W. McCoy
On Tue, 4 Dec 2001, Wagner Garcia Campagner wrote: > I have a varilable: > > $var = 'asdf asdf asdf'; #using blank spaces > > Then i send it to another script like this: > > > > The problem is when i get it back the value became: > > $var = asdf > > It stops in the first blank space is the

Re: Fwd: Fw: PLEEEEEEEASE READ!!!

2001-12-01 Thread Brett W. McCoy
On Fri, 30 Nov 2001, lynn bui wrote: > this does not concern perl, but maybe you should read > it. > it may be true and if so it's a really good deal. This is a hoax. Please do some research before sending things like this along. A good place to look is http://www.snopes.com -- Brett

Re: Program dilema

2001-11-30 Thread Brett W. McCoy
On Fri, 30 Nov 2001, Andre` Niel Cameron wrote: > I am having a bit of a problem. Does anyone have any idea how I could have > a variable and see if the value of that variable is also located in an array > and hash? IE: > > $myvar= 6 > > @myarray= ("4", "7", 10", 6") > > if (6 exists in @myarra

RE: Redirecting STDOUT to a variable...

2001-11-28 Thread Brett W. McCoy
On Wed, 28 Nov 2001 [EMAIL PROTECTED] wrote: > Thanks, but I need to preserve the value returned by $mycommand also. I > guess using backticks won't allow me to do that . > Mostly what I need to do is read from STDOUT into a variable. But I don't > know how to do that. Then just redirect STDOUT

Re: Redirecting STDOUT to a variable...

2001-11-28 Thread Brett W. McCoy
On Wed, 28 Nov 2001 [EMAIL PROTECTED] wrote: > I am looking to run a command using perl and get its return value as well as > its STDOUT. Currently I am doing is > > $result = system("$myCommand >out.txt"); > open(FILE,"< out.txt"); > > and then processing the data from the file. This is terribly

Re: deleting a file

2001-11-23 Thread Brett W. McCoy
On Fri, 23 Nov 2001, Wagner Garcia Campagner wrote: > Sorry for the stupid question, but i didn't find in the FAQ. > > What is the sintax to delete a file??? unlink deletes a file. perldoc -f unlink -- Brett http://www.chapelperilous.net/ -

Re: why is perl better then PHP

2001-11-15 Thread Brett W. McCoy
On Thu, 15 Nov 2001, rabs wrote: > Ive been using perl for a few months now, most people I speak to seem to > prefer PHP. Why? Maybe you should ask the PHP users and not the Perl users... :-) I would venture to say that a lot of people like PHP because it is specifically designed for web develo

Re: Text Field Question

2001-11-13 Thread Brett W. McCoy
On Tue, 13 Nov 2001, Justin Howell wrote: > I'm working on a perl script using CGI.pm and had some general > questions. Is there a way to set the focus (ie put the cursor) in a > text input field on page load? And when I finish typing in that field > and hit enter, for it being the same as hitt

Re: End of File

2001-11-08 Thread Brett W. McCoy
On Thu, 8 Nov 2001, Wagner Garcia Campagner wrote: > I don't know how to tell perl EOF, i am doing a search in a file like this: You don't need to -- you can loop through a file and it will stop automatically when EOF is reached. > > $username eq 'wagner'; > $file = 'c:\file'; > > open(INFO, $f

Re: Printing Hash Keys

2001-10-25 Thread Brett W. McCoy
On Thu, 25 Oct 2001, RaFaL Pocztarski wrote: > You can always use http://www.perldoc.com/ but it's hard to believe that > any version of perl comes without perldoc, however I don't know MacPerl > at all. Try to find any info about perldoc in MacPerl docs or website. Yeah, but recall that Macs (p

Re: Printing Hash Keys

2001-10-25 Thread Brett W. McCoy
On Thu, 25 Oct 2001, Shannon Murdoch wrote: > So I take it there is no way to list all the keys contained in a hash in the > same order they were entered in, like I can with a normal array? Why do you need to? There is way by using the Tie::IxHash module. It is available from CPAN (if you have

Re: System call from a CGI script

2001-10-24 Thread Brett W. McCoy
On Wed, 24 Oct 2001, James B. Williams II wrote: > I just posted a question to the beginners-cgi list yesterday; I'm > having almost the exact same problem. Both my cgi script and the script > I am trying to call via system are owned by root, but I'm not sure if > that is related to the user th

Re: Printing Hash Keys

2001-10-24 Thread Brett W. McCoy
On Wed, 24 Oct 2001, Shannon Murdoch wrote: > What everyone has said so far is ways to list all the VALUES contained in a > hash array, what I need to do is list all the KEYS contained in the hash > array-with a tab (\t) between each. Read the perldoc on the keys function. It takes all of the k

Re: Printing Hash Keys

2001-10-24 Thread Brett W. McCoy
On Wed, 24 Oct 2001, Shannon Murdoch wrote: > >> foreach (sort keys %params) { print "\t$params{$_}" } > > > > The same way. $_ is the key for the hash element in the while loop. > > > I want a list of keys, not their values though. Right -- the 'keys' function extracts the list of keys from a

Re: Auto-initialising a client-side download

2001-10-24 Thread Brett W. McCoy
On Wed, 24 Oct 2001, Shannon Murdoch wrote: > I think it would be good to have an online searchable database of this > newsgroup, so you don't have to download every message to see if your > question has already been answered a few days or weeks ago! =) Shannon -- Actually, there is an archive

Re: Printing Hash Keys

2001-10-23 Thread Brett W. McCoy
On Wed, 24 Oct 2001, Shannon Murdoch wrote: > I know how to print the contents of a hash, but what if I wanted to print > the keys themselves that the hash is called from (delimited by tabs)? > > This is how I print the contents of a hash (Thanks to Brett W. McCoy): > > %pa

Re: Test if first character of a variable is a 0 (zero)

2001-10-18 Thread Brett W. McCoy
On Thu, 18 Oct 2001, Rene Verharen wrote: > I need to delete the first character of a variable if this (and ONLY this) > character is a 0 (zero). > > What I tried : > > $text =~ s/01/1/; > $text =~ s/02/2/; > $text =~ s/03/3/; > etc... > > Not what I want, because it also deletes

Re: new html window

2001-10-17 Thread Brett W. McCoy
On Wed, 17 Oct 2001 [EMAIL PROTECTED] wrote: > i'm writing a formmail-esque script that checks for required fields coming > in from the html form. should a field be missing user input, i'd like to > have a new html window open displaying the missed fields. > i'm familiar with using the Location f

Re: Parsing HTTP links

2001-10-16 Thread Brett W. McCoy
On Tue, 16 Oct 2001 [EMAIL PROTECTED] wrote: > I need to parse out all http links stored in a local file. > How would I go about doing this? > > which modules would I need to use? Take a look at HTML::Parser, which is available from CPAN. -- Brett http:

Re: (simple) cgi.pm question

2001-10-16 Thread Brett W. McCoy
On Tue, 16 Oct 2001, Shannon Murdoch wrote: > So the script halves in size and now becomes: > print OUTFILE > "$entrynumber\t$params{q1_1}\t$params{q1_2}\t$params{q1_3}\t$params{q1_4}\t$ > params{q1_5}\t$params{q1_6}\t$params{q1_7}\t$params{q1_8}\t$params{q1_9}\t$p > arams{q1_10}\t$params{q1_11}

Re: (simple) cgi.pm question

2001-10-15 Thread Brett W. McCoy
On Tue, 16 Oct 2001, Shannon Murdoch wrote: > So far my script puts every form item in to it's own variable, and calls > upon that variable when it is writing the tab-delimited file (which will be > used in Exel or SPSS etc for data analysis. > > Is there an easier way to do this than I have? Yo

Re: How to change shell environment by cgi-file?

2001-10-12 Thread Brett W. McCoy
On Fri, 12 Oct 2001, Qi zhang wrote: > Thanks Brett for your reply but if i run my script under unix shell as > " perl my-script-file" it works well . > If i call my script online through apache server it does not perform my > C-file well. Why? The apache cgi director is set already. Possible t

Re: How to change shell environment by cgi-file?

2001-10-12 Thread Brett W. McCoy
On Fri, 12 Oct 2001, Qi zhang wrote: > I am using bash but my C file is under C-shell. How could I change the > bash to shell by perl script file? > system ('csh'); > system ('./my-file'); > system ('exit'); > does above list work? It shouldn't matter, if your C-shell script has a proper s

Re: Format interger printing, MORE INFO

2001-10-12 Thread Brett W. McCoy
On Fri, 12 Oct 2001, Chuck wrote: > It is now printing the number as a negative: > print "\n"; > printf "%15d bytes free in $phost:/var/tmp\n", $freespace; > > Result: > -48288 bytes free in smh4:/var/tmp Your integer is too big to be handled as an integer. :-) Use %15.f for your format

Re: Format interger printing, MORE INFO

2001-10-12 Thread Brett W. McCoy
On Fri, 12 Oct 2001, Chuck wrote: > Oh my god. *BONK*' > > You are correct, this is no doubt the dumbest mistake I have ever made. Bah, we've all been there. It's one of the best ways to learn: "That which does not kill us makes us stronger." :-) -- Brett

Re: Browser Redirection

2001-10-12 Thread Brett W. McCoy
On Fri, 12 Oct 2001, Carl Franks wrote: > if (condition) { > print "Location:page.html\n\n"; > } else { > print "Content-type: text/html\n\n"; > print "...html..."; > } > } BTW, for a Location header, you should an absolute URL and not a relative URL, even if it's on the same server as the

Re: Format interger printing, MORE INFO

2001-10-11 Thread Brett W. McCoy
On Thu, 11 Oct 2001, Chuck wrote: > Here is a snippet: > printf "%20d bytes free in $phost:/var/tmp\n", $freespace; > printf "$shipsize bytes being shipped.\n"; > > Here is the output: > -1012379648 bytes free in smh4:/var/tmp > 359731200 bytes being shipped. It's because 3282567168, apparently,

Re: Format interger printing

2001-10-11 Thread Brett W. McCoy
On Thu, 11 Oct 2001, Chuck wrote: > Nothing is working, I have tried every permutation. I tried this right on the command line: $ perl -e 'printf "%10d\n", 25' 25 -- Brett http://www.chapelperilous.net/ -

Re: Format interger printing

2001-10-11 Thread Brett W. McCoy
On Thu, 11 Oct 2001, Chuck wrote: > Arg, I am going crazy. Ok, it has been a long time since I was kneee deep in > perl, but why does this not work: > > printf "%-10d bytes", $x; Remove the - printf "%10d", $x; Works for me. -- Brett http://www.chapel

RE: Easy way to get output from system()

2001-10-11 Thread Brett W. McCoy
On Thu, 11 Oct 2001, Camilo Gonzalez wrote: > Dude, assign it to a variable. > > $tempdir = system("ls -l /tmp") No, that only gives you the exit status of the called program (which you then need to divide by 256 to do anything useful with). using `` or qx() will give the output of the called p

Re: Easy way to get output from system()

2001-10-11 Thread Brett W. McCoy
On Thu, 11 Oct 2001, Chuck wrote: > I have several CGI's that use system() to get various OS details. > > What is the most reliable way to glean this information after using this > command: > > For example: > > #!/bin/perl > > system("ls -l /tmp") > > How can I get that data? Use backticks: my

Re: Browser Redirection

2001-10-10 Thread Brett W. McCoy
On Wed, 10 Oct 2001, Michael Kelly wrote: > print "Content-type: text/html\n"; > print "Location: http://www.mysite.com/page.html\n\n";; This is incorrect also, because the "Location: ...\n\n" is an http header and should not be used after a Content-type header is sent to the browser. It should

Re: where to get modules? and any gui for win32?

2001-10-10 Thread Brett W. McCoy
> Where do I get some of these cool modules like www, DBI... etc? www.cpan.org is the definitive repository. Many assume the availability of a C compiler and proper development tools like make or nmake. On Win32, you can use VC++, or the CygWin environment, which gives you a lot of GNU tools.

Re: Sending someone to a new location...

2001-10-08 Thread Brett W. McCoy
On Mon, 8 Oct 2001, _brian_d_foy wrote: > > print "Location: $url\n\n"; > > > > This must be the only header sent to the browser. It won't work if http > > headers have already been sent. > > that's a bit misleading. as with any CGI script, there is only > one header. in a redirection, a Locat

Re: Sending someone to a new location...

2001-10-08 Thread Brett W. McCoy
On Mon, 8 Oct 2001, James Kelty wrote: > I would like to be able to send someone automatically to another page when > requirements in a for are filled out correctly. Other that presenting a link > I can figure out how to do this. > > Example: > > Someone correctly fills out a user/pass form and i

Re: ultimate stupidity

2001-10-05 Thread Brett W. McCoy
On Fri, 5 Oct 2001, Francesco Scaglioni wrote: > Answer: > I had inadvertently put a space in front of the # at the beginning of > the #!. The space is, of course covered by the cursor when I visit > the beginning of the file an I had failed to notice the implied space > ( implied because I coul

Re: Looking for a script that will "clean up" and print a page

2001-10-05 Thread Brett W. McCoy
On Fri, 5 Oct 2001, Rusty Wilson wrote: > Changing the width of the page is not an option as > that would "break" the interface (graphics/layout/etc) > which were designed at 760px wide (at the customers > reqest!) The client does not want a "narrower" > interface. Argh, that's one of the 7 dead

Re: References

2001-10-03 Thread Brett W. McCoy
On Wed, 3 Oct 2001, Bill Jones wrote: > References: > > I am looking for a basic explaination and example: > > $animal = "Dog"; > $sound = \$animal; > $bark = $$sound; > > $bark is now Dog. \$animal --> create a reference to $animal, which contains 'Dog' $sound --> assigned the reference to

Re: anti-SSSCA petition

2001-10-03 Thread Brett W. McCoy
On Wed, 3 Oct 2001, Kevin Meltzer wrote: > I meant to alter the PDF with a signature, silly. There's gotta be a Perl module out there for doing that... -- Brett http://www.chapelperilous.net/ -

Re: How can i search a line in a document and print this line inhtml page??

2001-10-03 Thread Brett W. McCoy
On Wed, 3 Oct 2001, shenneke pl wrote: > I need to know how can i search a line in a document and print this line in > html page?? > > if somebody know how can i do please help me!!! Can you please be a little more specific? What document are you searching? What do you mean by 'document'? Wha

Re: Any suggested response ? FW: Need PERL module DBI on SUN1

2001-10-03 Thread Brett W. McCoy
On Wed, 3 Oct 2001, Moon, John wrote: > > Does anyone have any suggestions as to how to reply to this gentleman ? There's nowhere near enough information to go on to even venture a guess. -- Brett http://www.chapelperilous.net/ -

Re: frexp panic

2001-10-02 Thread Brett W. McCoy
On Tue, 2 Oct 2001, Robert Becker wrote: > Has anyone ever gotten this error from perl? How do I resolve it? > > panic: frexp at IWfacschd.cgi.exp line 366. > > line 366: $fte = sprintf("%2.4f", $fte); > $fte is a returned number from a database. > > frexp is apparently a library that

Re: suggestions?

2001-10-02 Thread Brett W. McCoy
On Tue, 2 Oct 2001, Gareth Londt wrote: > i have a problem in which i have a lists of Domain names ..k, and i need to > get there matching email address of an external site but i cant arite a shell > script so i was wondering if anyone has any ideas or code that can help me > with what im doing?

RE: Replacing carriage returns in a variable

2001-10-02 Thread Brett W. McCoy
On Tue, 2 Oct 2001, Guy Tubbs wrote: > but it does the same thing, i.e. I get: > > Line1 > Line2 > > What I need is: > > Line1Line2 > > Do you know how to get rid of the returns altogether? Odd. Here's the code snippet I ran right at the command-line: $ perl $text = "line1\nline2\n"; $te

Re: Replacing carriage returns in a variable

2001-10-01 Thread Brett W. McCoy
On Mon, 1 Oct 2001, Guy Tubbs wrote: > Can anyone give me the code that will replace all the carriage returns in a > variable with another character. > > I am getting input from a web page and need to replace the returns with the > tag. I tried this: my $text = "some text\n"; $text =~ s/\n//g

Re: a new line?

2001-10-01 Thread Brett W. McCoy
On Mon, 1 Oct 2001, Gareth Londt wrote: > i need to know where to put a new line in.i keep getting errors..? > here is what the code looks like, if anyone can help with the newlinei > would much appreciate it. > > #!/usr/bin/perl -w > > $file = 'dnsbills.06-09-2001'; > > open FILE

Re: Stylesheet line not working

2001-09-30 Thread Brett W. McCoy
On Sun, 30 Sep 2001, Gary L. Armstrong wrote: > I have skimmed through the Llama and Camel and I don't know why this should > not work: > > #startcode > print < > "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd";> > > > > Geek Shop -- A Web Page > > > ...blahblahblah... > BLOCK1 > #endcode

Re: Browser Resolution

2001-09-29 Thread Brett W. McCoy
On Sat, 29 Sep 2001, Randy5235 wrote: > Does anyone know where I can find some information on possibly using perl to > determine a visitors browser resolution? Is this even possible ( sorry still > a noob!) > I have a couple pages that look horrible on certain sizes and would like to > basically

Re: How to save and retreive form

2001-09-26 Thread Brett W. McCoy
On 26 Sep 2001, Randal L. Schwartz wrote: > I've found Pg to be more lightweight than MySQL. > > Again, not at all what I would have said a year ago. But with the > removal of the 8K limit per record, life with Pg is great! I was in heaven when they added foreign keys. Actually, I've been usin

RE: How to save and retreive form

2001-09-26 Thread Brett W. McCoy
On Wed, 26 Sep 2001, Camilo Gonzalez wrote: > Doesn't PostgreSQL have a reputation as being somewhat pokey? Is it open > source? It's not pokey anymore, and yes, it is open source, and while MySQL may be faster for basic queries, for more complex things, MySQL just can't cut it, plus it's missin

Re: How to save and retreive form

2001-09-26 Thread Brett W. McCoy
On 26 Sep 2001, Randal L. Schwartz wrote: > Brett> MySQL is very simple to set up and easy to use. > > /me whispers "in 2001 and beyond, MySQL is spelled p o s t g r e s q l" > > MySQL is dead. Long Live PostgreSQL. I agree 100%. Actually, 1000%. I suggested MySQL beacuse she wanted somethi

Re: How to save and retreive form

2001-09-26 Thread Brett W. McCoy
On Wed, 26 Sep 2001, Lynn Glessner wrote: > For a small business intranet, I want the user to fill out the form, save it > onto the web server, and be able to retreive it later. A text file will be > fine, there won't be any need for reporting etc and a database would be > overkill. I would like

Re: redirection with perl

2001-09-26 Thread Brett W. McCoy
On Wed, 26 Sep 2001, Wagner wrote: > I want to do a redirection based on a variable > > for example: > > if ($name eq 'invader') { > > redirection to some URL ; > > } > > What do i have to put in the middle line to do the redirection... If you are using CGI.pm, there is a method called redir

Re: How Do I Extract Elements from an Array?

2001-09-25 Thread Brett W. McCoy
On Tue, 25 Sep 2001, aurillo, gabriel wrote: > I have an array, as follows: > > @allLines = ( > "line1 = value1", > "line2 = value2", > "line3 = value3", > "!line4 = value1", > "!line5 = value2", > "!line6 = value3", > "line7 = value7", > "line8 = v

Re: "Unless" statement

2001-09-18 Thread Brett W. McCoy
On Tue, 18 Sep 2001, Mark Bergeron wrote: > I would go: > > unless ( ($x < 50) || ($x > 80) ){ > print ""; > } No... that will return true for all values less than fifty or all values more than 80. To get the numbers in between, you want numbers that are more than 50 AND less than 80, the o

Re: FW: formating variables

2001-09-18 Thread Brett W. McCoy
On Tue, 18 Sep 2001, Wagner wrote: > I have a variable $var and its value is 345.678975 (for example). > How can i format $var to became 345.67 only two digits after the > point... printf("%.2f", $var); Note that this will do actual rounding of your number as well. > Another question... my

Re: "Unless" statement

2001-09-17 Thread Brett W. McCoy
On Mon, 17 Sep 2001, David Draley wrote: > how would I write an unless statement that is looking for the values > inbetween two numbers? > > unless (50 < $x > 80) print '' unless( ($x > 50) and ($x < 80) ); -- Brett http://www.chapelperilous.net/ --

Re: Renaming a File

2001-09-10 Thread Brett W. McCoy
> > Yes, and surprisingly enough, it's called "rename". :) > > I've had bad luck using rename, I've had to copy the file to the new name > and deep six the old, check out File::Copy, I think it ironically, has a > function called copy(), or even cp(), my memory eludes me. There's also one called

Re: Win32 Apache and Perl

2001-09-02 Thread Brett W. McCoy
On Sun, 2 Sep 2001, Gunther Birznieks wrote: > >I stand corrected then! Does Apache interpret the shebang line before > >running the script? I've had problems with Apache *requiring* the correct > >drive and pathname for other things in its configuration under Win32. > > I believe it does. But

  1   2   >