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
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
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
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
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
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;
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
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
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
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!
--
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.
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
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
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
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
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
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
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
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
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
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
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
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]
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
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
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
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
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
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
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
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
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
32 matches
Mail list logo