RE: Perl File Uploading

2004-04-20 Thread B. Fongo
Create a form for upload (you may also use CGI.pm to create the form) like this: form name=upload action=myperl.pl enctype=multipart/form-data method=post input type=file name= input type=submit value= ok /form myperl.pl use CGI (:standard); my $file = param(file_to_upload); my

FW: Perl File Uploading

2004-04-20 Thread B. Fongo
Create a form for upload (you may also use CGI.pm to create the form) like this: form name=upload action=myperl.pl enctype=multipart/form-data method=post input type=file name= input type=submit value= ok /form myperl.pl use CGI (:standard); my $file = param(file_to_upload); my

RE: How do I make a variable globally accessible without vars

2004-04-17 Thread B. Fongo
|| To: 'B. Fongo'; [EMAIL PROTECTED] || Subject: RE: How do I make a variable globally accessible without vars || || B. Fongo [EMAIL PROTECTED] wrote: || : || : I get the usual warning Use of uninitialized . while trying || : to test a variable ($counter) which is initialized later in || : my

How do I make a variable globally accessible without vars

2004-04-16 Thread B. Fongo
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 ==

What exactly is this simple regex doing?

2004-04-16 Thread B. Fongo
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, 2004 7:29 PM To: [EMAIL

RE: What exactly is this simple regex doing?

2004-04-16 Thread B. Fongo
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] || Subject: Re: What exactly

Regex to match domain for cookie

2004-04-15 Thread 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 ); foreach

AW: Regex to match domain for cookie

2004-04-15 Thread B. Fongo
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'; [EMAIL PROTECTED] Betreff: RE: Regex

Apache::Session question

2004-03-26 Thread B. Fongo
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

AW: Apache::Session question

2004-03-26 Thread B. Fongo
The error occurs on initial call, so id should be empty be then. I expect the routine to open a new session (see code below) if session_id is empty - but it fails then. == my $dbh = dbConnect(); # Get value of url or cookie id if any. my

Fwd: Apache::Session question

2004-03-25 Thread B. Fongo
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

use lib

2004-03-23 Thread B. Fongo
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 module

How to add an item into Shopping cart

2004-03-22 Thread B. Fongo
I'm working on a shopping cart, and yet to implement Apache::Session. But before then, I have a question on how to populate a shopping cart without the page reloading. Is there a way of achieving this using perl? I believe it is possible to use JavaScript event-handler can be to keep track of

AW: returning hashes, and arrays

2004-03-17 Thread B. Fongo
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 {

AW: Problem using require()

2004-03-15 Thread B. Fongo
. 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: Re: Problem

AW: AW: Problem using require()

2004-03-15 Thread B. Fongo
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 wrote

Problem using require()

2004-03-14 Thread B. Fongo
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 =

Which method is best for passing session id?

2004-03-10 Thread B. Fongo
I'm trying to implement cgi sessions with Apache::Session and found myself contemplating on a method to pass session id to my script. I'll appreciate if someone experienced could help me out of that - by giving any pros and cons on the following methods: 1. URL 2. Hidden fields 3.

Any CPAN module for creating thumbnails?

2004-03-07 Thread B. Fongo
I wander if here a way to create thumbnails using Perl? I want to implement functionality for my shop program to create a thumbnail of product pictures. A good instance of it may be that of eBay. Users can upload a picture of any dimension for their listing. EBay will automatically create a

AW: Any CPAN module for creating thumbnails?

2004-03-07 Thread B. Fongo
Thanks for the link. I'll try Image::Magic::Thumbnail. -Ursprüngliche Nachricht- Von: WC -Sx- Jones [mailto:[EMAIL PROTECTED] Gesendet: Sonntag, 7. März 2004 16:08 An: B. Fongo Cc: [EMAIL PROTECTED] Betreff: Re: Any CPAN module for creating thumbnails? B. Fongo wrote: I wander if here

AW: Any CPAN module for creating thumbnails?

2004-03-07 Thread B. Fongo
: WC -Sx- Jones [mailto:[EMAIL PROTECTED] Gesendet: Sonntag, 7. März 2004 16:08 An: B. Fongo Cc: [EMAIL PROTECTED] Betreff: Re: Any CPAN module for creating thumbnails? B. Fongo wrote: I wander if here a way to create thumbnails using Perl? I want to implement functionality for my shop program

AW: AW: Need help to divert HTML print ETHL to file.txt

2004-02-19 Thread B. Fongo
to you all guys Babs -Ursprüngliche Nachricht- Von: Wiggins d Anconia [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 18. Februar 2004 15:41 An: B. Fongo; [EMAIL PROTECTED] Betreff: Re: AW: Need help to divert HTML print ETHL to file.txt Hello, Can you guys tell me on this piece

AW: Regex to find group of image files

2004-02-19 Thread B. Fongo
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

Need help to divert HTML print ETHL to file.txt

2004-02-18 Thread B. Fongo
I tried to divert the output of print EOF to a file.txt, but pern warns of uninitialized value. The filehandle below succeeded - so what is not initialized? --- open (OUT, $dirhandle\$file) || die Can't create the html template:

Need help to divert HTML print ETHL to file.txt

2004-02-18 Thread B. Fongo
I tried to divert the output of print EOF to a file.txt, but pern warns of uninitialized value. The filehandle below succeeded - so what is not initialized? --- open (OUT, $dirhandle\$file) || die Can't create the html template:

AW: Need help to divert HTML print ETHL to file.txt

2004-02-18 Thread B. Fongo
Hello, Can you guys tell me on this piece of codes? It doesn't print the small html codes in the sub below. No warning - nothing! N.B. Don't bother about the html; just check my perl codes to see why I doesn't print what I want. Thanks Babs

Regex to find group of image files

2004-02-17 Thread B. Fongo
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

Re: file path pattern matching problem.

2003-12-10 Thread B. Fongo
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); # fileparse

Re: command line commands passed to perl script?

2003-12-09 Thread B. Fongo
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

Re: sendmail error: No reciient address found in header

2003-12-09 Thread B. Fongo
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 sendmail. I want

sendmail error: No reciient address found in header

2003-12-08 Thread B. Fongo
It's my first time to use sendmail. I want to my script to send a mail to [EMAIL PROTECTED] or whoever is in the To: line. The script warns:No recipient name found in the header and dies, even though there's a recipient. I'm puzzled. ### #!/usr/bin/perl -w

Re: How to verify whether a directory exists

2003-12-08 Thread B. Fongo
: 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(blah_blah, 0777); # Is this okay? In general -e

Re: How to verify whether a directory exists

2003-12-07 Thread B. Fongo
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 use the other... B

How to verify whether a directory exists

2003-12-06 Thread B. Fongo
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

How to verify whether a directory exists

2003-12-06 Thread B. Fongo
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

Re: Pattern matching

2003-12-05 Thread B. Fongo
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

Re: Pattern matching

2003-12-05 Thread B. Fongo
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

Pattern matching

2003-12-04 Thread B. Fongo
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

Pattern matching

2003-12-04 Thread B. Fongo
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

Use of uninitialized value

2003-10-28 Thread B. Fongo
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

Desperately needs help with nested looping

2003-09-04 Thread B. Fongo
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

passing an argument to a subroutine

2003-09-04 Thread B. Fongo
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

AW: passing an argument to a subroutine

2003-09-04 Thread B. Fongo
: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, September 04, 2003 11:34 AM Subject: passing an argument to a subroutine Hello An argument passed

Desperately needs help with nested looping

2003-09-04 Thread B. Fongo
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

passing an argument to a subroutine

2003-09-04 Thread B. Fongo
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

CGI-param question

2003-09-03 Thread 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 as

if-else-statement

2003-09-03 Thread 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

AW: if-else-statement

2003-09-03 Thread B. Fongo
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

Conditional statement and param()

2003-09-01 Thread 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

Conditional statement and param()

2003-09-01 Thread 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

AW: File::Copy CGI.pm

2003-08-21 Thread B. Fongo
### # Yupapa Web Hosting =^.^= # Web Site - http://www.yupapa.com # Email - [EMAIL PROTECTED] ### B. Fongo [EMAIL PROTECTED] ???:[EMAIL PROTECTED] Hi, I've a small script intended for file transfer from a windows machine to a remote linux

AW: File::Copy CGI.pm

2003-08-21 Thread B. Fongo
### # Yupapa Web Hosting =^.^= # Web Site - http://www.yupapa.com # Email - [EMAIL PROTECTED] ### B. Fongo [EMAIL PROTECTED] ???:[EMAIL PROTECTED] Hi, I've a small script intended for file transfer from a windows machine to a remote linux

Thank for helping: Variable $q will not stay shared at

2003-07-20 Thread B. Fongo
] Gesendet: Donnerstag, 17. Juli 2003 14:07 An: 'B. Fongo'; [EMAIL PROTECTED] Betreff: RE: Variable $q will not stay shared at B. Fongo wrote: 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

Variable $q will not stay shared at

2003-07-16 Thread B. Fongo
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

Variable $q will not stay shared at

2003-07-16 Thread B. Fongo
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

File::Copy CGI.pm

2003-07-12 Thread B. Fongo
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

File::Copy CGI.pm

2003-07-12 Thread B. Fongo
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

Array and Pattern matching

2003-06-30 Thread B. Fongo
; } die (Could not close output file. $! \n) unless close (OUTPUT); die (Could not close input file. $! \n) unless close (INPUT); } Thanks B. Fongo

How to check Array Uniqueness without Modul Array::unique

2003-06-30 Thread B. Fongo
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: