RE: Translators

2002-11-04 Thread Peter Kappus
Are we talking programming languages like C to Perl? Or "spoken" languages like Spanish to Italian? if you're talking about localization I know there are lots of modules and tools to help you out... you might look here: http://cpan.org/modules/by-category/13_Internationalization_Locale/Locale/ "m

RE: How to check server for perl setup?

2002-11-04 Thread Peter Kappus
I tend to agree with zentara...Are you able to run simple perl scripts from the command line? If so then your perl install is okay... Can you run simple CGI scripts? When i first start using a new server I always run a quick: #!/usr/bin/perl print "Content-type: text/html\n\n; print "Howdy y'a

congrats kelvin....also, mail receipts for Sven

2002-11-12 Thread Peter Kappus
Kelvin...Congrats on your CGI success! Yes, it is a simple but easy to forget fact that the physical location of your documents on the server is not the same as the URL... if you're document root (set in your httpd.conf file) is "/var/www/" and inside it you have a folder called "myStuff" then th

RE: Weekly list FAQ posting

2002-11-14 Thread Peter Kappus
Hi Casey et al, Thanks for the useful information! I was just noticing that all of our email addresses are available as-is on the discussion archives (http://archive.develooper.com/beginners-cgi%40perl.org/) where they could easily be harvested by evil spam-bots and used to send us junk. Do you

RE: console window

2002-11-21 Thread Peter Kappus
Another quick dirty trick is to just put a ; at the end of your script. This makes yours script wait for input. When you hit "enter" it will terminate and the window will close. Of course, this only works if your script gets to the end. If it runs into a compile error, you'll see the error mes

RE: Changing row color with subroutine - a shortcut...

2002-11-22 Thread Peter Kappus
Another neat trick I use to get subroutine arguments is the old "shift" function without an argument. Since, @_ is the default array in a subroutine you can just say my $firstParm = shift; #shift off the first arg from @_ Therefore, print add(30,50); sub addTwo{ my $firstNum = shift;

RE: can we use "system()" inside cgi ?

2002-12-10 Thread Peter Kappus
I don't know much about suidperl but if I were doing this, I probably wouldn't give root privileges to my CGI. If it doesn't need to happen instantaneously, I'd consider a two-step approach: (of course, it probably does need to run instantaneously since you're doing it as a CGI anyway...) Instead

RE: cronjob via perl

2002-12-12 Thread Peter Kappus
Hi sven (et al) Wiggins(?) has a good point about calling the script remotely. But I was trying to figure out what the script actually does and I couldn't find a value for $sql...but my guess is that it looks for new members of some sort and gives them a random password? Is this something

RE: automatically downloading files into a certain directory

2002-12-12 Thread Peter Kappus
Yup...I'm afraid this isn't possible within a browser (for security reasons) but you could easily build a simple perl client that would (using LWP) make a request to a CGI and save the result locally. The problem there is the UI...If you're not using a browser to retrieve the info from a server, t

RE: really basic question about CGI module

2002-12-13 Thread Peter Kappus
In my experience, the only character you really have to watch out for with mySQL is a single quote (') which you can just replace with a double-single quote (''). So I usually do something like this on each piece of text that I plan to write to a database: $someInput =~ s/'/''/g; good luck! --

RE: Cookies - might be off topic

2002-12-16 Thread Peter Kappus
AFAIK, browsers will only send cookies back to the domain that set them. So this may not be possible without some sneakerylike somehow spoofing the hostname, etc. It may also be possible if all the domains resolve to the same IP...but even then I'm not sure how you could do it... good luck.

RE: Form TextArea loading

2002-12-16 Thread Peter Kappus
Well...I'd do something like this: open(IN,"myFile.txt"); #by undefining the input separator (below), #we can read the whole file as one scalar undef $/; my $fileContents= ; close(IN); print< Here's my file: $fileContents eof voila! As for your second question, if you wanna strip spaces

RE: Setting up CGI with IIS

2002-12-16 Thread Peter Kappus
Hi Emma, I've just run this script in a similar environment Win2k/IIS with no problems... This error usually occurs if you're script runs into an infinite loop. But that doesn't appear to be the case here. You might try a simpler script to get started with, such as #!h:\perl\bin\perl.exe

RE: broadcast photo on other site not by up load

2002-12-23 Thread Peter Kappus
Season's greets, Eric & fellow Perlites: Yes, chances are, if you're getting *something* but not an image, you're either sending the wrong headers to the browser OR you're sending the right headers and then getting a compilation error...Or both. On a windows machine, there's also the possibility

RE: File upload - probably simple..

2002-12-23 Thread Peter Kappus
If you're only uploading jpgs then you could also write this as my ($name) = $path =~ /\w+\.jpg$/i; since a regexp match returns an array, you're actually creating an array with a single element ($name) and mapping it to the return from your match $path =~ /etc/i; you're match says "one or more w

RE: Variable passing

2003-02-05 Thread Peter Kappus
Hi Stephen, In this particular example, you're merely using the onClick event of the form button to open a window and point it to sample2.pl For this particular case, I would actually create a series of links on the first page (instead of a form) and make those links open a popup and send data t

DBI question

2003-02-14 Thread Peter Kappus
Hi List, Sorry if this is a little offtopic but I'm trying to learn DBI for a CGI I'm writing. Been reading http://www.perldoc.com/cpan/DBI.html but seems a little over complex for what I need...just inserts, updates, and queries really. Portability isn't too important. Probably going to

php like behavior for my perl CGI...and DBI followup

2003-02-14 Thread Peter Kappus
Thanks to Rob for his Class::DBI suggestion earlier. Looks like what I needed was simply: my %hash; return $sth->fetchall_arrayref(\%hash); to return an array of hashes... As I'm continuing with my latest project, I'm finding myself wishing I could do some PHP type things...spec

RE: php like behavior for my perl CGI

2003-02-17 Thread Peter Kappus
Thanks to all who have responded to my rather vague request. Indeed, I should clarify a bit what I'm looking for. Because I'm extremely lazy, I'd like to use certain formatting shortcuts in my HTML. In a given document, I might have 15 different spacer gifs of different sizes to aid in precise f

RE: php like behavior for my perl CGI

2003-02-20 Thread Peter Kappus
Aha! This is exactly the kind of solution I was looking for. I guess what I'm doing here is passing a reference to a subroutine call? \box(5,10) and then turning it into a scalar? ${} Quite ingenious. While I'm sure I'll regret it later (and curse your good name as I'm wishing I'd taken the t

RE: passing page URL to SSI script

2003-03-11 Thread Peter Kappus
If you're using Apache, you can read from the magical environment hash to see what URL the script was called from. try this: $ENV{'REQUEST_URI'}; or print them all like so: print $_ . " " .$ENV{$_} . "" for(keys(%ENV)); I'm not sure how this behaves with other servers such as IIS, but it's prob

RE: Good Perl cgi book?

2003-03-18 Thread Peter Kappus
Get the mother of all perl books: "Programming Perl" (from O'reilly) by Larry Wall (perl creator), Tom Christainsen, and Jon Orwant. It moves at a comfortable pace and lets you dig as deep as you want. It's also actually a fun read! Try saying that about most programming books. (of course, I am

RE: Problem with regular expressions!!!

2003-03-18 Thread Peter Kappus
I also had no problem... "myfile.jpeg" =~ /(.*?)\.(.*)/; print $2; gives me "jpeg" Can we see the rest of your code? I think the problem may be in the value of $file_completename... -Peter -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Perl "include" files

2003-03-25 Thread Peter Kappus
If you're just trying to implement some sort of templating for the presentation of your site, I'd suggest looking at the HTML::Template module or maybe HTML::Mason. If you're talking about code reuse, there are probably more effective OO ways to create objects that you reuse, etc. But a quick a

RE: screen size question

2003-03-27 Thread Peter Kappus
Hi Lou, Yes, as Jeff pointed out, if you're running it from a console, system("stty -a") should give you the rows/columns and a bunch of other usefull stuff. If, however, you're talking about screen resolution and you're running your script as a CGI and sending the results to a browser (wh

RE: IIS saves '.pl' file - not execute

2003-03-28 Thread Peter Kappus
I can't figure out why one would work and not the other...but make sure IIS is set up to handle .pl files (under the "home directory" tab click "configuration" and look at "app mappings" you should see ".pl C:\path\to\perl.exe GET,POST,ETC" if you don't, then IIS is improperly configured... Also m

RE: exec still not working

2003-03-31 Thread Peter Kappus
oblem. Hope this helps... good luck. -Peter -Original Message- From: Luinrandir Hernsen [mailto:[EMAIL PROTECTED] Sent: Saturday, March 29, 2003 6:16 AM To: Peter Kappus Subject: exec still not working OK.. here are the facts My .pl program is in cgi-bin/game/game-log.pl it is the log on

RE: searching for files using perl

2003-04-01 Thread Peter Kappus
Shawn Sharp wrote: > I created the following code to search for extention .PBD files in the > htdocs/PBD folder while using the apache webserver. However it will only > search in the cgi-bin folder for these files. What am I doing wrong? If you're just searching for files, this is probably a gre

RE: searching for files using perl - CORRECTION

2003-04-01 Thread Peter Kappus
oops... perldoc File::Find (not Find::File ...duh) -Original Message- From: Peter Kappus If you're just searching for files, this is probably a great opportunity to use the File::Find module. I reinvented the wheel about four times before I discovered this one...d'oh

RE: searching for files using perl

2003-04-02 Thread Peter Kappus
s for you time, James Lile -Original Message- From: Peter Kappus [mailto:[EMAIL PROTECTED] #!/usr/bin/perl -w use File::Find; use strict; use warnings; #HEY! Do i need this with -w? somebody tell me... my $root = "C:/temp"; #directory to start from my $ending = &qu

RE: Why this perl error?

2003-04-02 Thread Peter Kappus
Hi teddy, I ran into this exact same problem (on win2k using DBI and fork()) and eventually gave up. Alas. Someone more knowledgable will have to give us a definative answer but my primitive understanding is that fork() typically uses the system's implementation of the fork() command and that W

portability question...IIS Vs. Apache

2003-04-02 Thread Peter Kappus
Hey all, Anyone move scripts between IIS and Apache or need to write scripts that work on both? The problem I'm facing is that IIS reports the current working directory (CWD) as the root dir of the "application" as defined in the IIS control panel while apache reports the CWD as the actual direct