Ing. Branislav Gerzo [EMAIL PROTECTED] asked:
2. on my server in uppercase.cgi all text change to uppercase and this
result I want send back via _PHP_ to user.
Theoretically it should suffice to make sure that your
output has the proper MIME type for a PHP document, i.e.
Ing. Branislav Gerzo [EMAIL PROTECTED] asked:
user come to website, write in textbox some IPs, I want send
this input to my perl script (parse that text, takes IPs, do
operation with them - insert them to database, check
them...), and send results via _PHP_ to user.
I have a really nasty
Elliot Holden [EMAIL PROTECTED] asked:
okay this may seem like a simple problem but here it goes:
[...]
open(OUTFILE, survey.txt);
[...]
Your web server may not have permission to create
the file in question. Always check return codes!
open(OUTFILE, survey.txt) or die Could not open file: $!;
Anish Kumar K. [EMAIL PROTECTED] asked:
Is there any way in perl I can modify the permission of a
directory using perl scripts
Of course. Check out the builtins chmod and chown.
HTH,
Thomas
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Urs Wagner [EMAIL PROTECTED] asked:
I have a problem on WinXP. In perl I want to read the tail of a file.
The file is written with another windows program. If I am
using a sleep(5) before of the read command I get the new
tail content. It seems the program has longer to write it or
it is
Anish Kumar K. [EMAIL PROTECTED] asked:
Say I have a string called returned from the text file..
I don't understand this part. I assume from context that
you want to use a template.
I could very well use substition for the variables
individually. But it will be nice If I could substitute
James W. Thompson, II [EMAIL PROTECTED] asked:
Out of curiosity is there any method for trapping Windows
HTTP traffic transparently, without establishing a proxy
configuration, using Perl.
Probably not. Depending on what you want to do,
a cheap solution might be to set up a Linux box
as a
Michael Kraus [EMAIL PROTECTED] asked:
Is:
my ($id) = $item =~ /_(\d+)$/;
Equivalent to:
$item =~ /_(\d+)$/;
$id = $1;
Yes. It's especially useful when you've got more than one
capture in your RE.
Wild Technology Pty Ltd , ABN 98 091 470 692 Sales - Ground
[...]
And that'll really
Hi,
After a failed open, I want to run two statements for an or die.
Code Quesiton:
open (TEST, /tmp/test)
or {
die Could not open test file\n;
syslog(LOG_ALERT,Could not open test file);
};
This does not work, but what is the right way
[EMAIL PROTECTED] suggested:
Just as an FYI, you don't need exists in your code at all.
It is just a waste of time in your example. Should be beter writen as:
print hi if $n{11};
Bad idea, if you consider this:
$n{'oops'} = 0;
print hi if $n{'oops'};
print ho if exists $n{'oops'};
HTH,
Mariano Cunietti [EMAIL PROTECTED] asked:
can anyone address me to a Perl module/function to parse
gzipped log files without uncompressing them via gzip/gunzip?
You have to uncompress them somehow, but you don't have to
uncompress them to a file. I regularly use code like this:
if( $file =~
Robin [EMAIL PROTECTED] suggested:
This will split up the string based on the pattern (in this
case, a single space. You may want to change that to gain
robustness, e.g. /[ \t]+/ will split on any number of spaces and tabs)
I suggest /\s+/ instead. This splits on any whitespace,
and it'll
Groleo Marius [EMAIL PROTECTED] asked:
i have a simple question : how can i execute an array,
knowing that it contains perl code?
Assuming you meant a Perl script, not bytecode:
eval join(\n,@code);
Read all about it with perldoc -f eval.
HTH,
Thomas
--
To unsubscribe, e-mail:
Myers, Drew [EMAIL PROTECTED] asked:
I've been lurking on this list for a while, but this is my
first email.
I've written a series of ksh scripts, that prompts the user
for information, and reads the user's input.
I'd like to call these ksh scripts from within my perl script.
You
Owen [EMAIL PROTECTED] suggested:
Well perhaps for a single debugging line, it doesn't matter
too much, but consider a program where endless things can and
do go wrong. Peppering your script with
or die Can't open the file Data1 $!\n; or die Can't open
the file Data2 $!\n; or die Can't
Daniel [EMAIL PROTECTED]
I made a mistake when setting up CPAN, I chose Central
America as my Continent, then the only option was to chose
Costa Rica as my Country.
Not that I have anything against Costa Rica, very lovely
place will visit soon, but would like a ftp server closer to
my
Christian Stalp [EMAIL PROTECTED] asked:
Does anybody has any experience with making liked lists in perl.
Perl's arrays are really linked lists - check out the
built-in function splice().
HTH,
Thomas
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Anish Kumar K. [EMAIL PROTECTED]
Sorry to put in this PL forum
Just don't do it.
Say I have Javascript alert like this.
BODY onload=window.alert(welcome to my page)
when I preview this I get the alert window it is working
fine. But The caption of the window is Microsoft Internet
Mauro [EMAIL PROTECTED] asked:
I have a problem with my perl program because I'm not be able
to understand why it seems to execute both part of or statement.
I'm assuming you're referring to
system('/usr/bin/scp -qvp [EMAIL PROTECTED]:/home/clariion/cx700_perf.txt
/home/mgatt/rrd/tmp') or
Ing. Branislav Gerzo [EMAIL PROTECTED] asked:
just pretty simple question: is LWP::UserAgent encode URL ?
for example I have:
my $ua = LWP::UserAgent-new;
my $resp = $ua-get('http://something.net/this:is+just test');
my question is, if LWP first encode (escape) path in URL as
is written
Ing. Branislav Gerzo [EMAIL PROTECTED] wrote:
Mauro [M], on Tuesday, November 23, 2004 at 10:44 (+0100) wrote:
M I made a script that works fine.
M When a try to run it in crontab it seems it doesn't work.
it is maybe path related problem. Try tu run exactly that
script as in crontab,
James Taylor [EMAIL PROTECTED] asked:
Should be a pretty simple question, looking for an option in
header_out to target a frame.
[...]
Was hoping I could do something like:
$r-header_out('Target'='_top');
but that doesn't seem to work. Any suggestions?
The destination window for a HTML
A Taylor [EMAIL PROTECTED] asked:
I am trying to set some HTTP header variables in a perl
script that I can then pick up in another script.
I want to create a situation as if some one had POSTed
variables from a form. I then want to pick these variables up
in an .asp script.
You can use
Chris Devers [EMAIL PROTECTED] claimed:
[...]
well
written shell scripts don't need Perl and well written Perl
scripts don't need external shell commands.
I think that's the ivory tower point of view. Down
here in the trenches, it's more like a well-written
Perl script uses shell commands
Chris Devers [EMAIL PROTECTED] wrote:
On Fri, 29 Oct 2004, Thomas Bätzler wrote:
Chris Devers [EMAIL PROTECTED] claimed:
[...]
well written shell scripts don't need Perl and well written Perl
scripts don't need external shell commands.
I think that's the ivory tower point of view. Down here
James P Donnelly [EMAIL PROTECTED] asked:
I am only trying to login into a server, travese to the
correct directory, dump a file and quit. I have hacked
together something that gets me to the server and
then it seems to hang at the login.. Has anyone written
something like
this w/o
Murphy, Ged (Bolton) asked:
In order to use the array @files in the below code outside of
the subroutine, so I need to declare @files globally?
I'm getting errors at the moment: Global symbol @files
requires explicit package name
If so, where is the correct place to declare them in terms
Hi,
c r [EMAIL PROTECTED] asked:
I need to match an expression and its reverse to a very long string.
When a match occurs all matching should stop and the position
of the match should be returned.
Could you please illustrate this with an example or two?
Unless you specify the /g modifier,
Bernd Mueller [EMAIL PROTECTED] asked:
Would someone be so nice to explain me how i change the
values in @INC, because i know where to find this SiteDefs.pm.
You could use the use lib pragma, like
use lib qw(/path/to/my/modules);
HTH,
Thomas
--
To unsubscribe, e-mail: [EMAIL
Hi,
Johann Tagle [EMAIL PROTECTED]
I have a script that receives certain data from an html form,
processes them, then submits the processed data to another
script. Problem is, I want it to do so without having to
click anything anymore.
[...]
Any ideas?
Have a look at LWP and in
Bee [EMAIL PROTECTED] asked:
Is that if I throw the array to another sub also means the
array would be copied and then pass to the target sub ?
while reference is using the same data in system memory?
Yes. Use references, unless you need to munge the array in the
sub you're calling.
HTH,
Edward WIJAYA [EMAIL PROTECTED] asked:
How can I take out/splice(?) the element of that hash that
start with '1' and store it into another hash. So in the end
I will have two hashes:
Off the top of my head, I'd say
my @temp = grep /^1/, keys %myhash;
my %myNEWhash;
foreach my $k (@temp){
Karthick [EMAIL PROTECTED] asked:
Is it possible to embed C/C++ codes into perl programs.
(Actually I want to make use of an API, that could be used
with with C).
It's not exactly simple, but with h2xs you can create a Perl
module out of standard C libraries. Well, h2xs creates the
module
[EMAIL PROTECTED] asked:
How can I print certain fields delimited by ' '?
In awk I would write awk '{print $1, $6}' filename
In Perl, that would be
perl -lane 'print $F[0] $F[1] $F[5]' filename
See the perlrun manpage about all of the command line
switches. Here I use
-e - run Perl
[EMAIL PROTECTED] [EMAIL PROTECTED] asked:
I'm have a email in a text file. From this file I would like
to get the sender information, the attached files and the
body of the e-mail.
Is there something simple to do this?
Yeah. MIME::Parser from the MIME-tools distribution.
HTH,
Thomas
Hi,
Jaffer Shaik [EMAIL PROTECTED] asked:
I want to swap 2 variables without using a tempoarary variable.
( $a, $b ) = ( $b, $a );
HTH,
Thomas
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Bastian Angerstein [EMAIL PROTECTED] asked:
Could I change the contens of the datatoken (filehandle)
during the runtime of the skript?
That depends on the OS and implementation - for some
you can do that, for others you can't. And the big
question is of course if you should do that.
HTH,
Tim McGeary [EMAIL PROTECTED] asked:
Sort of. What I don't understand is why do you have to decide on the
server side, post-request that the result will be in a new window?
Couldn't the original portal page just use targets like normal?
It's a database driven site and so, unfortunately,
Peterson, Darren - Contractor.Westar asked:
I'd like to remove duplicate values from an array
[...]
This is a FAQ. Run perldoc -q duplicate for the answer.
HTH,
Thomas
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
[EMAIL PROTECTED] asked:
I need to test if an array holds duplicates, and if so do something.
Try
use strict;
use warnings;
my @array = qw(foo baz bar foo);
my %have;
foreach my $item (@array){
warn duplicate item $item if exists
Dirk Tamme [EMAIL PROTECTED] asked:
I get the error message:
/usr/bin/perl: relocation error:
/usr/lib/perl5/site_perl/5.8.0/i586-linux-thread-multi/auto/Sendmail/Milter/
Milter.so:
undefined symbol: smfi_setconn
It seems that there is missing something.
OTTOH, I'd say your sendmail
Randall wrote:
In fact, let me take this one step further. I've been told recently
(although I might be misremembering) that O'Reilly will publish NO
MORE CDs because of rampant piracy.
And the fact that they want to sell Safari subscriptions
has nothing to do with it, right? ;-)
Thomas
--
Hi,
Octavian Rasnita [EMAIL PROTECTED] asked:
Does anyone know what could be a reason a perl program gives
a segmentation error each time I run it under Linux?
This sounds like one of the libraries you're using was built for
a different version of Perl or with a different set of libraries.
If
Hi,
Jan Eden [EMAIL PROTECTED] wrote:
and thanks for all the previous suggestions regarding email
modules. Now it turned out that my ISP refuses to let me
install *any* additional Perl module on the server, so I have
to use sendmail.
Well, I'm sure he won't let you install a module in the
Dan Brow [EMAIL PROTECTED]
Any one know when perl 6 will be released for production use?
I doubt anybody on this list will be able to give you
anything else but when it's done as the answer.
Thomas
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Octavian Rasnita [EMAIL PROTECTED] asked:
Does anyone know what line I neet to print after using the
crontab -e
command, in order to run a program every half an hour, at 0
minutes and at 30 minutes?
You need to print out the crontab manpage and read it. If you
don't have them on your
Dan Muey [EMAIL PROTECTED] asked:
I'm tryign to do a perl -e '' command and am wondering if it is
possible to do single quotes inside the single quotes.
perl -e print \joe's mama\n\;
perl -e 'print joe.chr(39).s mama;'
HTH,
Thomas
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Hi,
glidden, matthew [EMAIL PROTECTED] asked:
I'm using the CPAN module to build my modules and have hung
up just trying install Bundle::CPAN. Installing Data::Dumper,
for example, shows a 'cc: command not found' error during make.
My system uses gcc instead of cc, but I'm not sure where to
Hello,
usef [EMAIL PROTECTED] asked:
Is there any way to get the size of a file without downloading it?
I want to write a program using LWP to download a file only
if it is bigger than 3K but smaller than 500K.
So I need to know the file size in the first place.
Try making a HEAD request -
mark o' sullivan [EMAIL PROTECTED] asked:
I'm trying to include javascript code in my perl script but
I'm getting the
following error 'Can't find string terminator quot;EOFquot; anywhere
before EOF at calendar.pl
Anyone have any ideas why I might be getting this error.
Usually that's
Hello Shaunn,
I think I've seen it, but I don't know where -
Isn't there a method to use Perl to connect to
some MS Access database and extract the
data into some other format (say, text).
That works fine with the DBD::ODBC module. If you
have got large records in the database, you should
Hello Stephen,
Does anyone have any recommendations for a perl cgi script that will
accept input from a HTML form and verify that the form input
isn't going to do something nasty?
At present the CGI we are using is based on form-mail.pl which is
apparently notorious for security holes.
Hello Mark,
Any ideas is it possible to read the address bar through perl alone?
Assuming that you meant a web browser's address bar
running on a client you don't control, no. And that's
not even considering that there are clients without
address bars ;-)
But why would you want to do that,
km [EMAIL PROTECTED] asked:
i am just curious -- is perl 6 coming with a compiler ?
That depends on your definition of compiler.
It certainly has a compiler that creates byte code, just
as all of the current Perl versions. I don't know wether
it will have a compiler like PerlEx bundled.
What
Hi,
[EMAIL PROTECTED] [EMAIL PROTECTED] asked:
I'm actually building a web interface to a news group server (INN).
One of the feature is to allow a few users to create and
delete newsgroups from the web.
Hopefully only for your local news hierarchy ;-)
Normally, from the shell, I would
Yehezkiel B Syamsuhadi [EMAIL PROTECTED] asked:
What does this line mean?
use CGI qw(:cgi-lib :standard);
The qw operator makes a text into a list by splitting at
the whitespace.
That list is passed to the module as an argument. In
CGI.pm's case these arguments are used to specify what
yomna el-tawil [mailto:[EMAIL PROTECTED] asked:
i'd like to say first that i'm using activePerl ,
under windows.
If you've installed that properly, you're set.
for O'Reilly, i couldn't subscribe or even have the 14
days trial because i don't have a credit card.. :(
I have a question,
Octavian Rasnita [mailto:[EMAIL PROTECTED] wrote:
Thank you, but $0 will tell me the path and the file name of
the script.pl file, not the path from where I ran the script.
So the FindBin module is not what you need?
Now, I could run pwd and get what I want, but in fact I need
to run this
Hi,
[EMAIL PROTECTED] wrote:
How do I pass a null variable as an argument? Sometime I may want a
wrapper sub as below:
Example,
...
sub procName
{ my $fname = $_[0];
my $lname = $_[1]];
}
Alternatively, you could write either
my $fname = shift;
my $lname = shift;
or even
my(
Jerry Preston [EMAIL PROTECTED] asked:
I am trying to break down the following:
printf(numsteps=%d i=%d im=%g vfr=%g
\n,numsteps,i,imeas,vforce);
into
numsteps= numsteps i=i im=imeas vfr=vforce \n
printf (\noriginal cap = %g, offset = %g, *ci, cap_offset);
into
Hi,
Chris Charley [EMAIL PROTECTED] wrote:
Should be (works correctly):
while () {
s/^/Line: $. /;
print;
}
Then the command could be:perl prepend.pl somefile.txt
somefile.new
which would correctly print to the 'new' file the
somefile.txt file with the line
Hi,
Jerry Preston [EMAIL PROTECTED] asked:
I am trying to change some text from:
if ( (fabs(log(im[ii]/im[ii-1])/vstep)
fabs(3*log(im[ii-1]/im[ii-5])/(4*vstep)) ) ((im[ii] ifr[x]) ||
(im[ii-1] ifr[x])) ) {
to
if ( (fabs(log(im[ii]/im[ii-1])/vstep) fabs(3 *
[EMAIL PROTECTED] asked:
Here's an excerpt about the from orielly and what the heck
does it means:
...If a subroutine is called using the form, the argument list is
optional. if ommitted, no @_ array is setup for the routine;
the @_ array at the time of the call is visible to subroutine
Todd Wade [EMAIL PROTECTED] wrote:
Gary Stainburn [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[...]
One thing you forgot was to close the file. Also, don't
forget that you can do it with less typing:
Closing files is optional in Perl ;-) Filehandles
will either be closed
Joshua Colson [mailto:[EMAIL PROTECTED] suggested:
sub load_file {
my($file,$html) = shift;
$html = '';
open(FILE, $file) or die Cannot open $file for reading: $!
while(FILE) { $html .= $_; }
return $html;
}
Instead of while(FILE) { $html .= $_; }, you
could use $html = join(,
Ronen Kfir mailto:[EMAIL PROTECTED] asked:
The following script meant to calculate simple math drills,
such as 5 *
9 or 4 + 3, written in one line. What I cannot comprehend is the lines
marked with ---. What do they do? Why is there a 0 index...
That looks like somebody wrote a C program
[EMAIL PROTECTED] [EMAIL PROTECTED] asked:
what is the proper way to pass a parameter for something like
$cgi-param(username)?
as far as i know it, this works for me:
$cgi-param(username);
Don't do that. Using barewords as strings can
break your code if you later on introduce a
sub with
Hi,
Jeff Westman [mailto:[EMAIL PROTECTED] asked:
Why does the order of these options matter?
[...]
$ nslookup someServer | perl -en 'print qq($_);'
$ nslookup someServer | perl -ne 'print qq($_);'
-e must be followed by the code:
$ perl --help
Usage: perl [switches] [--] [programfile]
Dillon, John [mailto:[EMAIL PROTECTED] asked:
When I am in a black command.com screen with CPAN prompt,
where am I? Why can't I cd to c:\?
That would be the CPAN prompt. Try help for a terse
command listing, quit to exit back to the DOS prompt.
CPAN is the Perl module installer. Check out
Dillon, John [mailto:[EMAIL PROTECTED] asked:
Is there a gobble-di-gook looker-upper for perl. For
instance, if I don't
know what '@_' is saying, as in:
my($email, $orig_email) = @_;
Look at the perlvar manpage. @_ is the array that has the
parameters passed to a function.
The above line
Hi,
Pandey Rajeev-A19514 [mailto:[EMAIL PROTECTED] asked:
I have a question regarding matching strings that have
embeded perl special characters.
$abc = 'MC10.G(12)3c';
$efg = 'MC10.G(12)3c';
Now I want to check whether they are same or not by doing
if ($abc =~ /$efg/) { do something;}
Hi,
James Edward Gray II [mailto:[EMAIL PROTECTED] asked:
I would like to add some code to a sub that only needs to be run the
first time the sub executes, or before is fine. If I add an INIT { }
block at the beginning of the sub, would that do it? Are there other
ways? Thanks.
If you
Marcus Claesson [mailto:[EMAIL PROTECTED] asked:
I have a silly little list-parsing problem that I can't get my head
around, and I'm sure some of you have come across it before.
Sure. Looks like homework ;-)
HTH,
Thomas
#!/usr/bin/perl -w
use strict;
my %unique;
while( DATA ){
my( $key,
301 - 373 of 373 matches
Mail list logo