$returnpage = $ENV{HTTP_REFERER}; # Not all Browser send this value, so
test to see
whether $returnpage is defined. If not, then you may have to assign a
value to it like:
$returnpage = "origin.pl";
$cook_admin = $cgi_this->cookie(-name=>'admin', -value=>$value1);
$cook_session = $cgi_this->c
Assuming you've established a connection...
@result = $dbh->selectrow_array("SELECT DISTINCT column1 FROM table
WHERE column2= -1");
$dbh->disconnect;
This should do...
Babs
||> -Original Message-
||> From: McMahon, Chris [mailto:[EMAIL PROTECTED]
||> Sent: Wednesday, May 05, 2004 12:4
Read the docs of the module or the source to find out which functions it
exports by default, and which you have to import explicitly.
So if a module is Bar::Foo and exports 2 functions (fistfunc,
secondfunc), then you can use them by
Saying:
Use Bar::Foo;
Firstfunc(); # Referring to the first f
It is probably because you didn't instruct the browser well.
Add this at the top of your script:
print "Content-type: text/html\n\n";
or if you're using CGI.pm this:
print header (-type => 'text/html');
||> -Original Message-
||> From: Sumanth Sharma [mail
It is probably because you didn't instruct the browser well.
Add this at the top of your script:
print "Content-type: text/html\n\n";
or if you're using CGI.pm this:
print header (-type => 'text/html');
||> -Original Message-
||> From: Sumanth Sharma [mail
My program depends on some CPAN modules (e.g. Image::Magick,
MD5::Digest) to operate, so I want to distribute it with those modules.
How do I best redistribute module?
Regard
Babs
Create a form for upload (you may also use CGI.pm to create the form)
like this:
myperl.pl
use CGI (:standard);
my $file = param("file_to_upload");
my $destination = "any_name.txt";
# Open a file handle to write the upload file.
Open (FH, ">/path/$destination");
while (<$file>)
Create a form for upload (you may also use CGI.pm to create the form)
like this:
myperl.pl
use CGI (:standard);
my $file = param("file_to_upload");
my $destination = "any_name.txt";
# Open a file handle to write the upload file.
Open (FH, ">/path/$destination");
while (<$file
my $counter = shift;
return(my $counter) = shift;
}
1;
||> -Original Message-
||> From: Charles K. Clarkson [mailto:[EMAIL PROTECTED]
||> Sent: Saturday, April 17, 2004 2:35 AM
||> To: 'B. Fongo'; [EMAIL PROTECTED]
||> Subject: RE: How do I make a
a special qualifier.
Oh! How I wish I could understand it. :-) I think I need to go back to
learn some more regexs.
||> -Original Message-
||> From: Wiggins d Anconia [mailto:[EMAIL PROTECTED]
||> Sent: Friday, April 16, 2004 5:40 PM
||> To: B. Fongo; [EMAIL PROTECTED]
||>
7;m not pulling anyone's leg. So just explain it if you can.
(.domain4you.com from http:://www. domain4you.com.)
foreach (@domains) {
my $name = $_;
$name =~ s/^[^\.]+//;
print $name;
}
-Original Message-
From: B. Fongo [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 15, 200
I get the usual warning "Use of uninitialized ." while trying to test a
variable ($counter) which is initialized later in my script. Using the
pragma use vars ($counter) makes it sticky. To avoid, I tried to work
around it by passing it to a sub.
my $counter = counter();
if ($counter ==
of "www.domain4you.com", "www" will be truncated isn't it?
$name =~ s/^[^\.]+//;
I hope I got the logic right.
Thanks
Babs
-Ursprüngliche Nachricht-
Von: Hanson, Rob [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 16. April 2004 01:36
An: 'B. Fongo
How do I match a domain name starting from the dot?
# Match something like these
".domain4you.co.uk"
".domain-house.de"
This is what I have:
@domains = ("http://www.domain.com ", "http://www.domain4you.co.uk
"http://www.domain-house.de"; "https//rrp.cash-day.com"
);
f
My implementation of Apache::Session::MySQL dies along the way, and gives
unclear warning.
[error] Died at /usr/lib/perl5/site_perl/5.8.0/Apache/Session/Generate/MD5.pm
line 40.
I decided to implement session as a module call Store::Session, so as to
minimize recoding it in many script.
Babs
Is it recommendable to use the pragma "use lib " when installing a
program on a server shared by many users?
Assuming my IPS did not install certain CPAN modules which my needs, and
I decide to install them in my www directory.
In such a scenario, putting "use lib" on my scripts will add my modu
That should work provided you're returning only on list.
It is much better to use reference when passing or retrieving more than
one value.
For instance: Retrieve the values from a sub as refereces.
($xRef, $yRef, $zRef) = example();
#
my @x = @$x;
my @y = @$y;
my $z = $$z;
sub example {
I've checked cpan AppConfig. I may get back to it.
Thanks Randy
-Ursprüngliche Nachricht-
Von: Randy W. Sims [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 15. März 2004 12:36
An: B. Fongo
Cc: [EMAIL PROTECTED]
Betreff: Re: AW: Problem using require()
On 03/15/04 06:19, B. Fongo
codes.
What I don't understand - is why my scripts get only the first variable
in the config file, but fail on the rest.
Babs
-Ursprüngliche Nachricht-
Von: Randy W. Sims [mailto:[EMAIL PROTECTED]
Gesendet: Sonntag, 14. März 2004 19:07
An: B. Fongo
Cc: [EMAIL PROTECTED]
Betreff: R
I have several modules which needs global variables from a text file
(global.txt).
Within each module, I use require "global.txt" to get my variables.
global.txt
$shop =
I thought I could solve the regex issue a different way, but failed.
My $path = "Mazda.1.jpg ";
($file, $dir, $ext) = fileparse ($path, '\..*' );
#I'm trying to get Mazda.2.jpg and Mazda.3.jpg.
# $file contains Mazda, so why does this regex fail to deliver
Mazda.2.jpg
# and Mazda.3.jp?
my @
Ursprüngliche Nachricht-
Von: Rob Dixon [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 17. Februar 2004 23:44
An: [EMAIL PROTECTED]
Betreff: Re: Regex to find group of image files
B. Fongo wrote:
>
> I'm having tough time trying to solve a problem at some regex. I have
> several pictur
Hello
I'm having tough time trying to solve a problem at some regex. I have
several pictures for cars, and want to use a script to create some HTML
files using those pictures.
For each car, I have three pictures named e.g. jeep.1.jpg, jeep.2.jpg
and jeep.3.jpg.
What am trying to do now, is to u
The best way to do it; is using the standard module File::Basename.
For instance
use File::Basename;
# This should return "somefile".
$file_name = basename (c:\test\abc\what\somefile.txt);
# This should also return "c:\test\abc\what\"
$dir_name = dir (c:\test\abc\what\somefile.txt);
# filepars
I got it. I never thought indentation could cause sendmail to mess up.
As a beginner, I need you try
everything possible to know their pros and cons. Next time - I may
consider using a CPAN module.
:-)
Thanks
Wiggins d'Anconia wrote:
B. Fongo wrote:
It's my first time to use sendma
You should use this: testscript.pl blah
where blah is the value to pass.
Ben Crane wrote:
Hi all,
Sorry, should have added this to my last email. Does
anyone know how to pass values to a perl script
through the command line? Do you use param as in CGI
scripting/
I want a user to be able to s
Thanks guys
Rob Dixon wrote:
Wiggins D'Anconia wrote:
B. Fongo wrote:
I want to use mkdir(blah blah, o777), but want to first find out
whether the directory "blah blah" exists.
I'm not if the -e option will bw right here. Let's say:
unless (-e blah_blah) mkdir
Sometimes I don't answers to my questions; so I thought it might help -
posting to both list.
Next time, I'll remember to post to one list only.
Thanks a lot.
Wiggins d'Anconia wrote:
Please don't cross post, if your question is CGI based then use that
list, otherwise
I want to use mkdir(blah blah, o777), but want to first find out
whether the directory "blah blah" exists.
I'm not if the -e option will bw right here. Let's say:
unless (-e blah_blah) mkdir(blah_blah, 0777);
# Is this okay?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comm
I went back to my books to refresh my memory on how to use references. Your
suggestion help a lot, but the subroutine returns wrong values. I did
some small modifications on the codes below
, and tried it. It return perl-5.8.0-80.3.i386.rpm and
samba-2.2.7-5.8.0.i386.rpm, which is wrong because:
Hi
I'm writing a script that will connect to an ftp server (Redhat mirror),
and download new versions of all packages that are on my machine. First
of all, the script collects information about all the packages installed
on my machine in an array (installed_packages). Then its goes on to get
a
What may be wrong with my codes? Perl complains of use of uninitialized
value at addition and in range (or flop).
Thanks
#
#!/usr/bin/perl -w
use strict;
my ($xi, $i, @numbers, @slice);
@numbers = (1..10);
$i = 0;
$xi = 0;
open(RS, ">perd.dat") || die "
Your question says very little about the your problem.
Try formulating it more precisely.
Babale Fongo
> -Ursprüngliche Nachricht-
> Von: ramakrishna [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 15. Oktober 2003 08:42
> An: [EMAIL PROTECTED]
> Betreff: How to get fields from a SQL DB
I'm quit confused with what I have below.
I have 2 database tables; Games and groups.
Name Group
#
John ,GroupA
Miler, GroupA
Peter, GroupB
Mathew, GroupB
Mark, GroupB
Luke, GroupA
I'm trying to select the members based on their groups and insert them
into a different table
[EMAIL PROTECTED]
Gesendet: Donnerstag, 4. September 2003 11:46
An: [EMAIL PROTECTED]
Betreff: Re: passing an argument to a subroutine
- Original Message -
From: "B. Fongo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, Septembe
Hello
An argument passed to a subroutine returns wrong value.
Code example:
@x = (1..5);
$x = @x;
showValue ($x); # or showValue (\$x);
sub showValue {
my $forwarded = @_;
print $forwarded; # print ${$forwarded};
}
In both cases, the script prints out 1.
What is going on here?
The original script has both -w and strict on, and no warnings are
generated. So everything is ok except param perhaps. The value of param
is some how sticky.
-Ursprüngliche Nachricht-
Von: Dan Muey [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 3. September 2003 20:00
An: B. Fongo
Hello
Below is a portion of a script that displays a table. The argument
passed by param() determines the number of rows the table should
display.
For some unknown reason, the value of param() seem to behave strangely.
It at times the value does not change; even if a different number is
sent a
Hello
Below is a portion of a script that displays a table. The argument
passed by param() determines the number of rows the table should
display.
For some unknown reason, the value of param() seem to behave strangely.
It at times the value does not change; even if a different number is
sent as
iles from one machine
to
another. And of course, you will need a FTP server for the machine
receiving the file.
Bye~
Yupapa
###
# Yupapa Web Hosting =^.^=
# Web Site - http://www.yupapa.com
# Email - [EMAIL PROTECTED]
###
"B. Fongo&qu
eader();
print $q->start_html();
#Registration form comes here!
print $q->end_html;
}
and etc. etc.
###
-Ursprüngliche Nachricht-
Von: Bob Showalter [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 17. Juli 2003 14:07
An: '
Hello,
I'm working on my first Perl project. Most of my cgi programs work ok,
but a look at the apache error log reveals this warning which is clear
to me:
Variable "$xy" will not stay shared at /data/www/cgi-perl/envir.pl line
19. [Wed Jul 16 11:44:57 2003] [error] Undefined subroutine
&Apache
Hi,
I've a small script intended for file transfer from a windows machine to
a remote linux server. To implement that, I decided to use two module
i.e File::Basename, File::Copy and CGI.pm.
The File::Copy is working well locally, but it fails to copy files to a
remote machine through the Browser
Is there any other way to check array uniqueness except the Module
Array::Unique?
I'm having problems in installing these two Modules: Array::Unique and
Tie. So I'm thinking of another way to check array for replicates.
I help will be appreciate. Thanks a lot!
--
To unsubscribe, e-mail: [E
lean =~
/\d+\s+\d+\s+\d+/);
$clean = ;
}
die ("Could not close output file. $! \n") unless close
(OUTPUT);
die ("Could not close input file. $! \n") unless close (INPUT);
}
Thanks
B. Fongo
45 matches
Mail list logo