Re: Sorting a hash

2004-10-04 Thread Octavian Rasnita
From: "Gunnar Hjalmarsson" <[EMAIL PROTECTED]>

> >> You don't need another hash.
> >>
> >> perldoc -f sort
> >> perldoc -q "sort a hash"
> >>
> >> my @codes = sort {
> >> $comp{$a}{$year}{profit}
> >>   <=>
> >> $comp{$b}{$year}{profit}
> >> } keys %comp;
> >

I have tried that, but it gave me an error telling that $year is undefined.
$year should be a variable but the sort function should loop through all
the years for every code of all the companies, and return the biggest
profit.

That's why I think I need to use a second hash that uses the code of the
companies as a hash key and the profit as its values.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Sorting a hash

2004-09-28 Thread Octavian Rasnita
Hi all,

I have a hash that have multiple sub hashes and I want to sort it by a sub
key.

For example, I have:

$comp{$code}{$year}{profit}.

And I want to sort the $code values after the value of the "profit" key.

Is this possible directly, or I will need to create another hash for doing
this type of sort?

Thanks.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Using a variable in a perl module

2004-09-18 Thread Octavian Rasnita
Hi all,

Does anyone know how can I use in a perl module a certain variable defined
in the main program?
I know how to Export a variable from the module to the main program, and in
fact that module uses OOP, but I don't know how to send a variable from the
main program to the module, or how to modify a hash value for a certain key
of a variable from the module.

Is it possible?

Thank you.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Making the program run faster

2004-09-18 Thread Octavian Rasnita
Hello all,

I have made a program and I have made some benchmarks in order to see how
much time consumes each part of it, and I was pretty surprised when I've
seen that the CGI module takes very much comparing with the other parts of
the program.
Well, I don't need very many methods from the CGI library, but I still want
to use it because many functions are much more simple with it.

Can you recommend me some tricks to make it work a little faster?

If I want to use the OOP style, is it possible to load only some methods and
not all?

Or, if I want speed, is it better to choose the functional style and to
import only a a group of functions?

Why do I need to use multiple CGI objects in the same session? Can you give
me an example?
If I won't find many reasons to keep using the OOP style, I think I will
start using the functional one... (hoping that it will work faster).

Thank you for any suggestions.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




mms:

2004-09-15 Thread Octavian Rasnita
Hi all,

Does anyone know a perl library that can be used for saving a stream
broadcasted using the mms: protocol into a .mp3 file?

Thanks.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




DirectoryIndex

2004-09-12 Thread Octavian Rasnita
Hello all,

I have named index.html a file that in fact is a perl cgi program and I have
put it in the directory /cgi-bin/

It works fine if I access it using an URL like:

http://localhost/cgi-bin/index.html

The problem is that I want to access that program using:

http://localhost/cgi-bin/

But it gives me the 403 Access denied error.

I have put Options FollowSymLinks MultiViews Includes ExecCGI indexes for
that directory but it still doesn't choose automaticly the file index.html
from that directory.

I have tested but it doesn't choose even if I use another extension (like
.cgi) and if I set it to be a DirectoryIndex in httpd.conf.
Do you know if a certain file (like index.html) can be automaticly chosen by
the web server if rezides in a ScriptAlias directory (like /cgi-bin/)?

Or, are there any other secure solutions for what I want to do?

Thank you.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




PHPerl

2004-09-08 Thread Octavian Rasnita
Hi all,

Is there a way to embed Perl programs in html like PHP can do?
I heard that Perl can be used in ASP files, but I am wondering if there is
an Apache module for that task.

It would be cool to exist such a thing...

Thanks.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: CGI scripts, security and MySQL

2004-09-03 Thread Octavian Rasnita
This might be helpful for more users, because a system admin can create
automaticly a special dir where the users can put their config files, and
"insert" that file in httpd.conf.
After that, every user can create its own config file, with any variables
they want (their names should not be only "user" and "pass"), and after that
chmod that special dir in order to be viewd only by the root.

T

Teddy

- Original Message - 
From: "Chris Devers" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; "michael watson (IAH-C)"
<[EMAIL PROTECTED]>
Sent: Friday, September 03, 2004 3:56 PM
Subject: Re: CGI scripts, security and MySQL



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: CGI scripts, security and MySQL

2004-09-03 Thread Octavian Rasnita
No, the environment variables are set a single time at the start (or
restart) of the web server.
The problem is that if there is any change in httpd.conf file, the server
must be restarted and this might not be very easy for a system with very
many users, but it is not impossible.
Teddy


- Original Message - 
From: "Chris Devers" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; "michael watson (IAH-C)"
<[EMAIL PROTECTED]>
Sent: Friday, September 03, 2004 3:31 PM
Subject: Re: CGI scripts, security and MySQL


> On Fri, 3 Sep 2004, Octavian Rasnita wrote:
>
> > You can put something like this, in httpd.conf file:
> >
> > include ...path_to_file
> >
> > And make the directory where sits that file readable only by the root
user.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: CGI scripts, security and MySQL

2004-09-03 Thread Octavian Rasnita
Hi,

You can put something like this, in httpd.conf file:

include ...path_to_file

And make the directory where sits that file readable only by the root user.

Then, in that file, put something like:

SetEnv usr user_name
SetEnv pass parolissima

Those 2 environment variables will be seen by any script that runs on that
server.

If you want them to be seen only by the scripts which are ran by a certain
virtualhost, put that  "include" line between  and
.

T

- Original Message - 
From: "Chris Devers" <[EMAIL PROTECTED]>
To: "michael watson (IAH-C)" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, September 03, 2004 3:08 PM
Subject: Re: CGI scripts, security and MySQL


> On Fri, 3 Sep 2004, michael watson (IAH-C) wrote:
>
> > I need to make this secure such that only users I want can use the
> > system.  I want to set up a username and password so that users can
> > log in once at the beginning of a session, carry out their work
> > filling in various forms and writing to the database, and then log-out
> > at the end.
> >


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Cookies v. Hiddent Fields

2004-09-01 Thread Octavian Rasnita
From: "Siegfried Heintze" <[EMAIL PROTECTED]>


> What is the difference (as far as security goes) between using a cookie
and
> a hidden field? Are hidden fields cached if we are using SSL? I think not.
>
>

Both have the same security.
A hidden field is simpler to be viewd by a user, but a cracker can see them
both.

>
> If I use a GUID as a session ID in my database and store the GUID in a
> hidden field and the user sees the GUID in some GET parameters, is this of
> any consequence?
>

No, no problem, but it depends how you define that hidden field.
For exemple, don't use as hidden fields autoincreasing numbers but always
use random strings.

>
>
> Someone recommend that I don't persist cookies. How do I not persist
> cookies?
>
>
>

Don't put an expiration date and they will  not be persistent.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Locating the root directory to find files on a web site

2004-07-21 Thread Octavian Rasnita
Use the %ENV hash
T

- Original Message - 
From: "Ron Goral" <[EMAIL PROTECTED]>
To: "Perl Beginners - CGI" <[EMAIL PROTECTED]>
Sent: Wednesday, July 21, 2004 3:00 PM
Subject: Locating the root directory to find files on a web site


> Howdy -
>
> I have a module that needs to locate the root directory in order to search
> for files or directories on a web site.  The difficulty is that I cannot
be
> certain of a couple things -
>
> 1.  I don't know where the script will be installed except that it will be
> in the cgi-bin
> 2.  I don't know where the file or directory to be located will be
relative


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




server push

2004-07-11 Thread Octavian Rasnita
Does anyone  know if Internet Explorer 6 supports server push?

Thanks.

Teddy,
teddy.fcc.ro [EMAIL PROTECTED]

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Executing a subroutine from a runtime chosen module

2004-07-10 Thread Octavian Rasnita
Hi all,

Does anyone know how can I do something like:

my $mod = "Module.pm";

#Then require this $mod module (using eval()

#Then executing a certain subroutine from that module and getting the results.

I found that I can require a module and execute it entirely but I am not able to 
choose to execute just a subroutine from it, nor to extract the value of a certain 
variable because if I require that module using eval(), the vars are not exported.

Or is there any other way to do what I want?

(Choosing to run a certain module depending on some conditions, and getting some 
variables from a subroutine which I choose to execute.

Or if you believe that perl can do such a thing, and if you know where on the web I 
could find out more, please let me know.

Thank you very much.

Teddy,
teddy.fcc.ro [EMAIL PROTECTED]

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Reading a file

2004-07-09 Thread Octavian Rasnita
Hi all,

Does anyone know how can I read a file from a UNC path?
Is perl able to read files this way?

Thank you.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: popup_menu

2004-06-24 Thread Octavian Rasnita
BTW, regarding XForms, does anyone know if they are supported by the browsers, and if 
yes, where can I get more information/manual about using them?

Thank you.

Teddy

- Original Message - 
From: "Wiggins d Anconia" <[EMAIL PROTECTED]>

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




parsing Latex documents

2004-06-18 Thread Octavian Rasnita
Hi all,

I want to parse Latex documents with Perl, and to analyse their structure for 
translating them with spoken words for the blind.
Do you know if the single way is to parse those documents like HTML::TreeBuilder parse 
the HTML files, or is there a parser that can get the Latex elements?
I want to be able to "spoke" very complex equations.

Thank you for any tips.

Thanks.

Teddy


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How to host CGI scripts ?

2004-06-18 Thread Octavian Rasnita
And BTW, I am sure most of the listers will be able to help you with some advice about 
your problem if you will install the Apache web server for Windows from www.apache.org.

It is much more used than IIS, much secure, and with many other advantages, and also 
free.

Teddy

- Original Message - 
From: "Bob Showalter" <[EMAIL PROTECTED]>
To: "'Sunil Kumar'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, June 18, 2004 6:00 PM

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Printing a multipart HTML output

2004-06-08 Thread Octavian Rasnita
Hi,

Thanks for responding.
I need to create that multipart page because I am trying to create a single html file 
with a financial analysis which includes pictures and I don't want to be necessary to 
send more files to the clients.
But I was sure that if Outlook Express can read such a page, Internet Explorer and 
other browsers will be able to read it for sure.

Thanks.

Teddy

- Original Message - 
From: "Wiggins d Anconia" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, June 08, 2004 6:18 PM
Subject: Re: Printing a multipart HTML output


> > Hi all,
> > 
> > Please tell me how can I create a multipart html file that includes html
> > text and images.
> > I know that Mime::Lite can create such a thing for sending an email with
> > attachments, but I don't know if it is possible to use it for creating
> > common HTML pages with multipart content.
> > 
> 
> I was not aware that this was even possible. It does appear that some
> browsers, specifically in the Netscape class could handle this at least
> once upon a time.  I found a link through google to chapter 13 of the
> definitive HTML book from ORA (illegal copyright violation so I will not
> provide it), that talks about how to do this, specifically in an HTTP
> push application (like streaming media, etc.) so apparently it can be done.
> 


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Printing a multipart HTML output

2004-06-08 Thread Octavian Rasnita
Hi all,

Please tell me how can I create a multipart html file that includes html
text and images.
I know that Mime::Lite can create such a thing for sending an email with
attachments, but I don't know if it is possible to use it for creating
common HTML pages with multipart content.

Thank you.

Teddy

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: CGI and mySQL book, any recommendation.

2004-06-01 Thread Octavian Rasnita
Does this mean that PostgreSQL is faster than MySQL?
In most simple web applications I could work even with text files databases,
so MySQL is very enough.

But if PostgreSQL is faster, the situation changes...

Teddy

- Original Message - 
From: "Randal L. Schwartz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 01, 2004 2:52 PM
Subject: Re: CGI and mySQL book, any recommendation.


> > "Wiggins" == Wiggins D'Anconia <[EMAIL PROTECTED]> writes:
>
> Wiggins> Agreed. I have requested this from him before, but didn't get
much.
>
> I haven't responded because I've been using the net at 40 cents per
> minute from a satellite link on a ship this past week, and right now
> I'm using a 10 cents per minute cellphone modem.  When I get back to a
> free link, I'll post more.
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Creating a table automaticly

2004-05-31 Thread Octavian Rasnita
Thank you much. I will try that.

Teddy

From: "zentara" <[EMAIL PROTECTED]>> >
> You might try abiword, it takes alot of commandline options.
> I don't know how it handles tables though, but you could 
> parse the output.
> 
> 
> system( 'abiword', '--to=html', $file )
> or warn "Cannot convert $file\n";
> 
> 
> 
>

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Creating a table automaticly

2004-05-31 Thread Octavian Rasnita
Hi all,

I need to read an MS Word file, get the text from it and print it as an HTML
page.
I can get the text if I run the program under Windows, but:

1. I don't know how I can get the tables and transform them in HTML tables
and
2. I don't know how can I get the text if I run the program under Linux
where I think I cannot use the Win32:: modules.

Help!

Thank you for any helpful advise.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: CGI and mySQL book, any recommendation.

2004-05-30 Thread Octavian Rasnita
From: "Randal L. Schwartz" <[EMAIL PROTECTED]>

> Please, never ever post the URL to your website.  "Blind leading
> Blind" comes to mind.
> 
> -- 
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095

Well... talking about that saying, I am blind and I have tought other blind persons to 
use a computer, even though not programming with Perl. :-)
But even though I am not a PhD I like very much O'Reilly's books, especially those 
talking about Perl programming.

Teddy


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Displaying another page

2004-05-17 Thread Octavian Rasnita
Hi,

You can do something like this:

print "Location: http://www.site.com/file.html\n\n";;

Teddy

- Original Message - 
From: "Werner Otto" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 17, 2004 12:13 PM
Subject: Displaying another page


> Hi there,
>
> I have the following situation where I need to call a html page depending
> on.
>
> if($name eq "")
> {
> call/display my html page.
> }


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Deleting a dir

2004-05-12 Thread Octavian Rasnita
Hi all,

If the user Apache which runs the cgi scripts on my server want to delete a
file that has restrictive priviledges and is owned by another user, how can
I make a cgi program to be able to delete those files?

I don't know very much about Unix/Linux yet...

Thank you.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




System()

2004-05-12 Thread Octavian Rasnita
Hi,

I have tried:

system("zip", "-r", "archive", "*");

But this tells me that the file "*" cannot be found.
I guess the shell thinks that I want to pass the quoted string "*" and not
only the * character to match all files.

I have succeeded with:

system("zip -r \"archive\" *");

But I have seen that it is recommended for security reasons to use system()
with multiple parameters...

Thank you.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Reading a Java applet

2004-05-10 Thread Octavian Rasnita
Hi all,

Does anyone know if a perl program could be made to read the content of a
Java applet?

I have made a script that should read such an applet, get the text from it
and print it on the browser.

Thank you.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Getting the values of some variables

2004-04-15 Thread Octavian Rasnita
How can I do that?

I have the string in $in variable and it contains the text:

"example $aa $bb $cc ..."

Thanks.

T

- Original Message - 
From: "frbn" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, April 15, 2004 5:47 PM
Subject: Re: Getting the values of some variables


>   do you use double quotes to interpolate the string ?
> 
> 
> Octavian Rasnita wrote:
> 
> >Hi all,
> >
> >I have a text file that contains a text something like this:
> >
> >This text contains a $aa variable and a $bb variable and a $cc one.
> >


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




CGI and XML

2004-04-15 Thread Octavian Rasnita
Hi all,

I have seen that in the last time the XML/XSLT technologies are very much
promoted as beeing the future in the configuration field at least.
I have tried to parse a very small XML file using XML::Simple but I found
that it works very very slow.
It took more than a half of a second just to get and print the data from a
very small file (less 2 kb).
I am wondering how much time it could take if I would need to parse more XML
files, and filter them using XSLT...

I have tried to load the same information from a MySQL database and with the
whole connection overhead it took less than that. I also tried to parse that
information from a .csv file, and it took 10 times less than using an XML
file.
I've seen that XML::Simple uses the expat C library, and I guess that it
might be the core of more XML parsers, and I am almost sure that this
library causes the slowness, so probably all of them have the same problem.
Is there a faster solution for parsing XML files with Perl?
Is there another library than XML::Simple which works faster, or a trick to
make XML::Simple work faster?

Thank you.

Teddy,
teddy.fcc.ro [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Getting the values of some variables

2004-04-15 Thread Octavian Rasnita
Hi all,

I have a text file that contains a text something like this:

This text contains a $aa variable and a $bb variable and a $cc one.

My program reads this text and I want to replace the variables with their
values, then return the result string.

How can I do this?

Is using s/(\$\w+)/eval($1)/gse the only solution?
(I haven't test it if it works this way yet, but I hope there is a simpler
and easier method to evaluate the entire string.
Is there such a way?

Thank you.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




CGI and SSL

2004-04-15 Thread Octavian Rasnita
Hi all,

I want to configure my web server to use HTTPS for accessing some CGI files.
What do I need to do in order to do this?

Do I need to print a special header when printing something into the
browser?

Also, does anyone know how could I create the keys? Can I use Open SSL for
this, or there are separate programs?

Thank you.

teddy


Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Running a Perl module

2004-04-05 Thread Octavian Rasnita
Hi,

Ok, I see. Please tell me if there is a way to do what I want.

I want to get a certain string value from a text file, use that text string
as the name for a module, execute that module, and get the result of a
certain variable which is created in that module for using it in the program
which calls the module.

It is not absolutely necessary to use a .pm module, but I want to choose
what perl file I want to execute and get its result in the program that
calls it.
I would like not to be forced to use the shell, and i hope it is possible.

Thank you.

Teddy



- Original Message - 
From: "Bob Showalter" <[EMAIL PROTECTED]>
To: "'Octavian Rasnita'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, April 05, 2004 3:29 PM
Subject: RE: Running a Perl module


> Octavian Rasnita wrote:
> > Hi all
> >
> > I want to run a certain perl module by getting the name of the perl
> > module from a scalar variable like:
> >
> > $module ="Test";


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




segmentation fault?

2004-04-05 Thread Octavian Rasnita
Does anyone know what could be a reason a perl program gives a segmentation
error each time I run it under Linux?
I have no problem with it under Windows.

It is a program that uses LWP, downloads some pages, analyse them, and save
the data into a text file.

Thank you for any idea.


Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Running a Perl module

2004-04-05 Thread Octavian Rasnita
Hi all

I want to run a certain perl module by getting the name of the perl module
from a scalar variable like:

$module ="Test";
require $module;

I have read in the POD documentation that I need to use:

eval {require $module};
or
eval "require $module";

But the problem is that I cannot get a value returned by that module.

The Test module returns a value named $value.

If I use:

require Test;
print $value;

The var $value is printed without problems, but if I call require for the
$module, the var $value is not exported and I cannot use it.

Is Perl able to run a certain module if getting the name of the module from
a variable, and able to access a value returned by that module?

Thank you very much.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Output Unicode

2004-04-02 Thread Octavian Rasnita
I am accessing www.google.com which redirects to www.google.ro, or
www.google.com/ncr

T

- Original Message - 
From: "mt m" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, April 02, 2004 6:35 PM
Subject: Re: Output Unicode


> which google url are you accessing?
>
>
>
> >From: "Octavian Rasnita" <[EMAIL PROTECTED]>
> >To: "mt m" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> >Subject: Re: Output Unicode
> >Date: Fri, 2 Apr 2004 15:59:10 +0300
> >MIME-Version: 1.0
> >Received: from onion.perl.org ([63.251.223.166]) by mc2-f14.hotmail.com
> >with Microsoft SMTPSVC(5.0.2195.6824); Fri, 2 Apr 2004 04:54:59 -0800
> >Received: (qmail 80022 invoked by uid 1005); 2 Apr 2004 12:54:55 -
> >Received: (qmail 80007 invoked by uid 76); 2 Apr 2004 12:54:54 -
> >X-Message-Info: JGTYoYF78jE9bEGLbvndwDuh3RJSuy17
> >Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> >Precedence: bulk
> >List-Post: <mailto:[EMAIL PROTECTED]>
> >List-Help: <mailto:[EMAIL PROTECTED]>
> >List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
> >List-Subscribe: <mailto:[EMAIL PROTECTED]>
> >Delivered-To: mailing list [EMAIL PROTECTED]
> >Delivered-To: [EMAIL PROTECTED]
> >X-Spam-Status: No, hits=0.0 required=7.0tests=
> >X-Spam-Check-By: la.mx.develooper.com
> >Message-ID: <[EMAIL PROTECTED]>
> >References: <[EMAIL PROTECTED]>
> >X-MSMail-Priority: Normal
> >X-Mailer: Microsoft Outlook Express 6.00.2800.1158
> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> >Return-Path: [EMAIL PROTECTED]
> >X-OriginalArrivalTime: 02 Apr 2004 12:54:59.0231 (UTC)
> >FILETIME=[B4A692F0:01C418B1]
> >
> >Yes but I get Google's page with Internet Explorer 6 and I can see that
the
> >page uses UTF-8. And I can see teh page fine.
> >But that example page read with IE6 also, is not read correctly.
> >
> >T.
> >
> >- Original Message -
> >From: "mt m" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> >Sent: Friday, April 02, 2004 3:47 PM
> >Subject: Re: Output Unicode
> >
> >
> > >
> > > >Oh thanks, this is helpful.
> > > >I can see that it is very complicated to use Unicode standards.
> > >
> > > well it can be. But if you've got a new browser (mozilla 1.6), and a
> > > reasonably new OS, - Solaris 9/XP/JDS then you should be fine for
> >viewing
> > > UTF-8 encoded pages in most languages.
> > >
> > >
> >
> >
> >--
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> ><http://learn.perl.org/> <http://learn.perl.org/first-response>
> >
> >
>
> _
> The new MSN 8: advanced junk mail protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Output Unicode

2004-04-02 Thread Octavian Rasnita
Yes but I get Google's page with Internet Explorer 6 and I can see that the
page uses UTF-8. And I can see teh page fine.
But that example page read with IE6 also, is not read correctly.

T.

- Original Message - 
From: "mt m" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, April 02, 2004 3:47 PM
Subject: Re: Output Unicode


>
> >Oh thanks, this is helpful.
> >I can see that it is very complicated to use Unicode standards.
>
> well it can be. But if you've got a new browser (mozilla 1.6), and a
> reasonably new OS, - Solaris 9/XP/JDS then you should be fine for viewing
> UTF-8 encoded pages in most languages.
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Output Unicode

2004-04-02 Thread Octavian Rasnita
Oh thanks, this is helpful.
I can see that it is very complicated to use Unicode standards.

I have seen that on that page I can read the text in romanian language, but
even though I can read well some chars, I am not able to read other special
chars and I can read just question marks instead.

I know that I might need to install some fonts in order to be able to read
them correctly, but it might be a problem with the UTF encoding of that
page, because as I said, I am able to read Google's page without problems.

Teddy

- Original Message - 
From: "mt m" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, April 01, 2004 9:23 PM
Subject: Re: Output Unicode


> I think it's your font support.
>
> Go to http://www.columbia.edu/kermit/utf8.html
>
> This multilingual page has strings in many languages - all UTF-8 encoded.
>
> If your browser can't render text for a specific language on this page,
then
> the problem is your font support.
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Output Unicode

2004-03-31 Thread Octavian Rasnita
Hi,

Thank you for these examples.
I have tried the program, but it printed the following result on Internet
Explorer 6:

Reading and displaying a file with UTF-8 encoded multilingual text.
Japanese string:
?? | |  | ?- |
 | ??

Korean:
?? ??? ?? ? ???. ??? ??? ???

Hebrew
???  ? ?? ??? ??  ??.


It seems that something's wrong because Internet Explorer automaticly
chooses UTF-8 encoding, but it doesn't display the text correctly.
In fact, I don't know which is the problem because I read the text from the
screen using a screen reader (I am blind) but I can read other UTF encoded
pages like Google's page, without problems.

Thank you.

T

- Original Message - 
From: "mt m" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, March 31, 2004 7:21 PM
Subject: Re: Output Unicode


>
> I'd say the problem is that the content of your page is not in fact in
> UTF-8. Telling the browser that it is is one thing, but that doesn't make
> the content itself UTF-8 encoded.
>
>
> Are you sure you can actually create a UTF-8 encoded file?
>
> If you create a web page using Mozilla Composer ( part of the Mozilla
> browser bundle - free at mozilla.org), it allows you to save it as UTF-8.
> That's what I did with multiling.txt attached. - except I exported it as
> text. [It may look like garbage in notepad - but it should be ok when
viewed
> as UTF-8 in browser]
> It contains 3 strings - japanese, korean and hebrew.
> [to input ja, ko or he strings - merely copy and paste them from a website
> in that language]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Output Unicode

2004-03-30 Thread Octavian Rasnita
Thank you.

I have tried to set the header of the web page as you described, but I have
seen that the special chars like şţăîâŞŢĂΠare not recognized correctly,
even though the browser recognizes that the encoding is UTF-8.

However, I have seen that the page returned by Google is viewed correctly,
but their page uses those byte order marks special chars that I don't know
how to print.

If I print only common ASCII chars, I have no problem printing them in UTF8.

Thanks.

I will subscribe to the other mailing list. I hope the address for
subscribing is [EMAIL PROTECTED]

Teddy

- Original Message - 
From: "mt m" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, March 30, 2004 10:51 PM
Subject: Re: Output Unicode


> >I have tried those modules and others like Encode, and they produce UTF-8
> >strings, but without printing those first 3 special chars which made the
> >browser and other programs to recognize that it is a UTF-8 file.
>
> Are you talking about the Byte Order Marks (BOM) ?  The browser doesn't
need
> these to know that the file is UTF-8. - Other apps might.
>
> There are several ways to tell a browser what the encoding of a page is.
Use
> one of these methods when outputting from your cgi script, then do a


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Output Unicode

2004-03-30 Thread Octavian Rasnita
I have tried those modules and others like Encode, and they produce UTF-8
strings, but without printing those first 3 special chars which made the
browser and other programs to recognize that it is a UTF-8 file.

Thank you anyway.

Teddy

- Original Message - 
From: "Wiggins d Anconia" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, March 30, 2004 5:38 PM
Subject: Re: Output Unicode



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Output Unicode

2004-03-29 Thread Octavian Rasnita
Hi all,

Does anyone know how could I print a UTF-8 HTML page (like Google's one)?

Which modules I need to use?

Is perl able to do that?

Thank you.


Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Generating .doc

2004-03-16 Thread Octavian Rasnita
Thanks. I don't like .doc format either, but it is not my choice
unfortunately.

Teddy

- Original Message - 
From: "Gary Stainburn" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, March 16, 2004 2:50 PM
Subject: Re: Generating .doc


> On Tuesday 16 Mar 2004 11:51 am, Octavian Rasnita wrote:
> > Hello all,
> >
> > Please tell me what modules I need to use if I want to  generate a Word
> > document from a CGI program.
> >
> > It would be wonderful if it would work under Unix also.
> >
> > Thank you.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Generating .doc

2004-03-16 Thread Octavian Rasnita
Hello all,

Please tell me what modules I need to use if I want to  generate a Word
document from a CGI program.

It would be wonderful if it would work under Unix also.

Thank you.


Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Problem installing a module

2004-03-03 Thread Octavian Rasnita
Hello all,

Does anyone know how can I configure the installation for a perl module if I
want to install it using CPAN library?

I want to install the perl module DBD::mysql and if I try:

perl -MCPAN -e "install DBD::mysql;"

It fails installing the module and it tells me that it can't find mysql or
something like that, but mysql is installed and running fine in:
/usr/local/mysql

Thank you very much for your help.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Need help to divert HTML print <

2004-02-18 Thread Octavian Rasnita
You need to separate dirs and files using / and not \.

Teddy

- Original Message - 
From: "B. Fongo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 18, 2004 11:22 AM
Subject: Need help to divert HTML print < I tried to divert the output of print < warns of uninitialized value.
> The filehandle below succeeded - so what is not initialized?
>  
> ---
>  
> open (OUT, ">$dirhandle\$file") || die "Can't create the html template:


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Re: File not downloading - off topic

2004-01-23 Thread Octavian Rasnita
> I suspect that ".eml" is a recognized extension that is supposed to have
> some specific format, maybe IE thinks it is in the XML class because of
> the 'ml'. This is usually handled by the mime-type listing in the
> browser, and possibly on the server end which determines the
> content-type header based on extension when the response chain isn't CGI
> based.  Out of curiousity why not just use '.txt' since e-mail is in
> plain text anyways?
>


I have finished making the program to save the files with the .txt
extension, but then I need to change the extension after downloading them,
because if I press enter on a .eml file in Windows, it is opened in an
Outlook Express Window where all the To: From: Date: Subject: fields are
nice arranged and I can read the message easily.

I have also tried to put some garbage in an .eml file to see if this can
fool Internet Explorer, but it doesn't want to work this way either.

I guess that IE recognizes that extension and it is made to ignore those
files... who knows.

Teddy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




File not downloading - off topic

2004-01-23 Thread Octavian Rasnita
Hi,

Sorry for this off topic subject, but I don't even know where to ask about
this problem.

A program on my site saves some email messages and let me download them
later, and I use the .eml file extension for those files.
When I try to access the URL to one of those messages, Internet Explorer 6
doesn't let me to download it if the files have a .eml extension.
If I choose another extension, (.zip for example), I can download them
without problems.

I've tried that on localhost also, and it happends the same.

For example, I've tried accessing:
http://localhost/z.eml

And the result follows below.

Thank you for any tips why is this happening.

Teddy

Invalid syntax error

The page cannot be displayed

The page you are looking for might have been removed or had its name
changed.

Please try the following:
. Open the
localhost
home page, and then look for links to the information you want.
. If you typed the page address in the Address bar, make sure that it is
spelled correctly.

If you still cannot open the page, click the Internet Explorer
search.gif (114 bytes)Search
button to look for similar sites.


Thanks.
Teddy,


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Script within a script

2004-01-15 Thread Octavian Rasnita
You can execute that second script:
require script.pl

or

system('perl script.pl');

- Original Message - 
From: "Kenneth W. Craft MCP" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 14, 2004 3:06 PM
Subject: Script within a script


> Is it possible to execute a perl script within another perl script?
> 
> I have advertisements on many of my pages of my site that are randomly
> picked using a random ad script. I am creating some pages that are
> dynamically being created, and I can't use ssi to pull the ads into the
> page (right now on my main page I use  to call the ad
> scripts.
> 
> Thanks
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.558 / Virus Database: 350 - Release Date: 1/2/2004
>  
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
> 
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




using crontab

2004-01-13 Thread Octavian Rasnita
Hi all,

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?

Thank you very much!

Teddy,
teddy.fcc.ro[EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Unicode

2004-01-04 Thread Octavian Rasnita
Hi all,

I have a problem printing a file encoded as UTF8.

I have tried using the following script:

use Unicode::String qw(utf8);

my $text = "astaîâSTAÎÂz";

my $t = utf8($text);

print $t;

The result printed on the screen or in a file is just "az" and not the whole
string.

I would like those non english special chars be converted as UTF8 chars.

Do you know what is the problem?

Thank you.

Teddy,
teddy.fcc.ro [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Special characters

2003-12-29 Thread Octavian Rasnita
I've tried this method, but unfortunately it doesn't work right.
I have a problems with special chars from other languages.

For example, if I want to type the letter t which in Romanian language is a
"t" with a comma below it, I need to switch to the Romanian keyboard and
press a key which types the code 254.

Well, if I use this code in a character entity like þ in an HTML
document, it shows me a question mark instead (?).

To make it show right I need to use ţ instead.

I don't know why this difference appears nor how I could solve it
automaticly.

So for the moment I need to manually replace each separate special
character.

The CGI pod documentation says that if I use CGI::escapeHTML it will replace
all the characters which are not standard with some named character entities
or if other charset than ISO-8859-1 is used they will be replaced with their
numeric form.
Well, this replacement is not made at all for those strange chars, but only
for < > & " and maybe a few others.

Teddy

- Original Message - 
From: "J. Alejandro Ceballos Z." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, December 28, 2003 7:58 PM
Subject: Re: Special characters


> yes, I agree, in fact we should take care about observing the 3 digits
> (@ instead of @)
>
> maybe something like
>
> $cString =~ s/([\x7f-\xff])/'&#'.ord($1).';'/ge;
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Special characters

2003-12-28 Thread Octavian Rasnita
Oh thank you.
I just wanted to make that regexp and it saved me the time.

Teddy

From: "J. Alejandro Ceballos Z." <[EMAIL PROTECTED]>
Subject: Re: Special characters


> yes, I agree, in fact we should take care about observing the 3 digits 
> (@ instead of @)
> 
> maybe something like
> 
> $cString =~ s/([\x7f-\xff])/'&#'.ord($1).';'/ge;
> 
> will fix the matter.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: special characters

2003-12-27 Thread Octavian Rasnita
I found the solution, but I needed to print the chr() for many ansi codes in
order to find the codes I need.

I can see that if I type alt+ a number in order to print its ansi code, it
prints a different char if I choose the keyboard for romanian.
I thought the ansi code is the same but the keyboard keys are mapped to
other chars if I choose another language, but I see that it is not true.

- Original Message - 
From: "Camilo Gonzalez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, December 27, 2003 5:46 PM
Subject: Re: special characters


> J.,
>
> In my experience, the numeric escapes where available seem to be more
> universal between browsers.
>
> J. Alejandro Ceballos Z. wrote:
>
> > I may try with nueric equivalents (like .) or htmlspecialchars()
> > or htmlentities()
> >
> >
> > Octavian Rasnita wrote:
> >
> >> Hi all,
> >>
> >> I want to create some web pages that use special characters for foreign
> >> languages (romanian), like staîâSTAÎÂ.
> >>
> >> Please tell me what can I do to make them show right in the visitors'
> >> browser.
> >> I've seen that if I just print them, they appear like a question mark
> >> instead (?).
> >>
> >> I've seen that other sites can print them right and I don't know how.
> >>
> >> Is there an HTTP header I need to set?
> >> Or are there any special Apache settings I need to make?
> >>
> >> Thank you for your help.
> >>
> >> Teddy,
> >> teddy.fcc.ro [EMAIL PROTECTED]
> >>
> >>
> >
> >
>
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: special characters

2003-12-24 Thread Octavian Rasnita
Where can I find those functions/methods?
(htmlentities and htmlspecialchars)

I have tried searching for them in the CGI POD documentation but I couldn't
find them.

Thanks


- Original Message - 
From: "J. Alejandro Ceballos Z." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 24, 2003 6:59 PM
Subject: Re: special characters


> I may try with nueric equivalents (like .) or htmlspecialchars() or
> htmlentities()
>
>
> Octavian Rasnita wrote:
> > Hi all,
> >
> > I want to create some web pages that use special characters for foreign
> > languages (romanian), like staîâSTAÎÂ.
> >
> > Please tell me what can I do to make them show right in the visitors'
> > browser.
> > I've seen that if I just print them, they appear like a question mark
> > instead (?).
> >
> > I've seen that other sites can print them right and I don't know how.
> >
> > Is there an HTTP header I need to set?
> > Or are there any special Apache settings I need to make?
> >
> > Thank you for your help.
> >
> > Teddy,
> > teddy.fcc.ro [EMAIL PROTECTED]
> >
> >
>
>
> -- 
>
> saludos,
>
>
>   J. Alejandro Ceballos Z.   |
>   ---+---
>   http://alejandro.ceballos.info |
>[EMAIL PROTECTED] |  "A menudo la razón
>   ---+  comete errores,
>  |  pero nunca
>  |  lo hace a conciencia."
>  |
>  |   -- Josh Billings
>
>
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




special characters

2003-12-23 Thread Octavian Rasnita
Hi all,

I want to create some web pages that use special characters for foreign
languages (romanian), like staîâSTAÎÂ.

Please tell me what can I do to make them show right in the visitors'
browser.
I've seen that if I just print them, they appear like a question mark
instead (?).

I've seen that other sites can print them right and I don't know how.

Is there an HTTP header I need to set?
Or are there any special Apache settings I need to make?

Thank you for your help.

Teddy,
teddy.fcc.ro [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Fork

2003-12-09 Thread Octavian Rasnita
Thank you.
Yes I am forking more process from a CGI script because I want to let them
run on the server then end loading the current page immediately.

Can you give me a short example about how I should create that loop?

Thank you.

- Original Message - 
From: "Wiggins d Anconia" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, December 08, 2003 6:58 AM
Subject: Re: Fork


>
>
> > Hi all,
> >
> > Please tell me how could I fork more child processes.
> > I want to fork let's say 10 child processes.
> >
> > I know that I can do something like the following, but I am wondering if
> > there is a clearer method:
> >
> > if (my $pid = fork) {
> > #parent
> >
> > if(my $pid2 = fork) {
> > #parent 2
> >
> > if (my $pid3 = fork) {
> > #parent3
> > }
> > elsif(defined $pid3) {
> > #child3
> > }
> > }
> > elsif(defined $pid2) {
> > #child2
> > }
> > }
> > elsif(defined $pid) {
> > #child1
> > }
> >
> > But this method is very confusing if I want to fork more child
processes,
> > and I want to let the user choose how many processes wants.
> >
> > Thank you.
> >
>
> How about a loop?  Storing the PIDs to an array/hash?  Are you really
> forking processes from a CGI script?
>
> http://danconia.org
>
> --
> Boycott the Sugar Bowl! You couldn't pay me to watch that game.
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Fork

2003-12-08 Thread Octavian Rasnita
Hi all,

Please tell me how could I fork more child processes.
I want to fork let's say 10 child processes.

I know that I can do something like the following, but I am wondering if
there is a clearer method:

if (my $pid = fork) {
#parent

if(my $pid2 = fork) {
#parent 2

if (my $pid3 = fork) {
#parent3
}
elsif(defined $pid3) {
#child3
}
}
elsif(defined $pid2) {
#child2
}
}
elsif(defined $pid) {
#child1
}

But this method is very confusing if I want to fork more child processes,
and I want to let the user choose how many processes wants.

Thank you.


Teddy,
teddy.fcc.ro[EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: hit counter

2003-11-12 Thread Octavian Rasnita
As I said, I don't know.

- Original Message - 
From: "Andrew Gaffney" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 11, 2003 8:55 PM
Subject: Re: hit counter


> Wouldn't these have the same effect?
>
> Octavian Rasnita wrote:
> > I don't know, but this is not the right way.
> >
> > You need to open each image in perl with open(), read the content of the
> > file, then print each content one after another.
> >
> > - Original Message - 
> > From: "Andrew Gaffney" <[EMAIL PROTECTED]>
> >
> >>So, if I were to do 'cat 1.gif 2.gif 3.gif 4.gif > 1234.gif' at the
> >
> > command line, I'd get
> >
> >>a GIF that displays '1234' if each of the original file contains a
number?
> >>
> >>Octavian Rasnita wrote:
> >>
> >>>Open each image file and print their content one after another and they
> >
> > will
> >
> >>>be printed right.
> >>>Don't forget to use the right HTTP header for printing an image
> >
> > (image/gif).
> >
> >>>And don't forget to open the files using binmode if you are under
> >
> > Windows.
> >
> >>>But your program will be totally useless for the blind visitors that
> >
> > won't
> >
> >>>be able to read that image on the screen.
> >>>A better idea would be to use server side includes and print a text hit
> >>>counter, or use Javascript to include the text generated by a CGI
script
> >
> > if
> >
> >>>your server doesn't accept SSI.
> >>>
> >>>Teddy
> >>>
> >>>
> >>>- Original Message - 
> >>>From: "Andrew Gaffney" <[EMAIL PROTECTED]>
> >>>To: "Jon Barnhardt" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> >>>Sent: Tuesday, November 11, 2003 7:58 PM
> >>>Subject: Re: hit counter
> >>>
> >>>
> >>>
> >>>
> >>>>That will work, but I'd like to combine them into one image if
possible.
> >>>>
> >>>>Jon Barnhardt wrote:
> >>>>
> >>>>
> >>>>>name your gifs 1.gif, 2.gif 3.gif 4.gif, etc
> >>>>>
> >>>>>once you have your number stored in a variable (hit count), split it
> >>>
> >>>into an array then loop through the array and append the .gif to the
> >
> > number
> >
> >>>and write the path to page as an image source.
> >>>
> >>>
> >>>>>Logic:
> >>>>>
> >>>>>myvariable = 12536<-- hit count amount
> >>>>>myarray = myvariable split by number
> >>>>>for i = 0 to end of array
> >>>>>"" & myarray(i) & ".gif"
> >>>>>next
> >>>>>
> >>>
> >>>
> >>
> >>-- 
> >>Andrew Gaffney
> >>
> >>
> >>-- 
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
>
>
> -- 
> Andrew Gaffney
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: hit counter

2003-11-11 Thread Octavian Rasnita
I don't know, but this is not the right way.

You need to open each image in perl with open(), read the content of the
file, then print each content one after another.

- Original Message - 
From: "Andrew Gaffney" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 11, 2003 9:27 PM
Subject: Re: hit counter


> So, if I were to do 'cat 1.gif 2.gif 3.gif 4.gif > 1234.gif' at the
command line, I'd get
> a GIF that displays '1234' if each of the original file contains a number?
>
> Octavian Rasnita wrote:
> > Open each image file and print their content one after another and they
will
> > be printed right.
> > Don't forget to use the right HTTP header for printing an image
(image/gif).
> > And don't forget to open the files using binmode if you are under
Windows.
> >
> > But your program will be totally useless for the blind visitors that
won't
> > be able to read that image on the screen.
> > A better idea would be to use server side includes and print a text hit
> > counter, or use Javascript to include the text generated by a CGI script
if
> > your server doesn't accept SSI.
> >
> > Teddy
> >
> >
> > - Original Message - 
> > From: "Andrew Gaffney" <[EMAIL PROTECTED]>
> > To: "Jon Barnhardt" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Tuesday, November 11, 2003 7:58 PM
> > Subject: Re: hit counter
> >
> >
> >
> >>That will work, but I'd like to combine them into one image if possible.
> >>
> >>Jon Barnhardt wrote:
> >>
> >>>name your gifs 1.gif, 2.gif 3.gif 4.gif, etc
> >>>
> >>>once you have your number stored in a variable (hit count), split it
> >
> > into an array then loop through the array and append the .gif to the
number
> > and write the path to page as an image source.
> >
> >>>Logic:
> >>>
> >>>myvariable = 12536<-- hit count amount
> >>>myarray = myvariable split by number
> >>>for i = 0 to end of array
> >>>"" & myarray(i) & ".gif"
> >>>next
> >>>
> >
> >
>
>
> -- 
> Andrew Gaffney
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: hit counter

2003-11-11 Thread Octavian Rasnita
Open each image file and print their content one after another and they will
be printed right.
Don't forget to use the right HTTP header for printing an image (image/gif).
And don't forget to open the files using binmode if you are under Windows.

But your program will be totally useless for the blind visitors that won't
be able to read that image on the screen.
A better idea would be to use server side includes and print a text hit
counter, or use Javascript to include the text generated by a CGI script if
your server doesn't accept SSI.

Teddy


- Original Message - 
From: "Andrew Gaffney" <[EMAIL PROTECTED]>
To: "Jon Barnhardt" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, November 11, 2003 7:58 PM
Subject: Re: hit counter


> That will work, but I'd like to combine them into one image if possible.
>
> Jon Barnhardt wrote:
> > name your gifs 1.gif, 2.gif 3.gif 4.gif, etc
> >
> > once you have your number stored in a variable (hit count), split it
into an array then loop through the array and append the .gif to the number
and write the path to page as an image source.
> >
> > Logic:
> >
> > myvariable = 12536<-- hit count amount
> > myarray = myvariable split by number
> > for i = 0 to end of array
> > "" & myarray(i) & ".gif"
> > next
> >


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Determining different computers with the same IP

2003-11-07 Thread Octavian Rasnita
Hi all,

I heard that it is possible to differentiate 2 computers of 2 different web
page visitors that have the same IP address.

I know that each computer is sending some information in %ENV variable, but
is there any other method to differentiate them?
The information from %ENV can be changed so I cannot rely on it.

Thank you very much!

Teddy,
teddy.fcc.ro [EMAIL PROTECTED]


---
Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV AntiVirus.
Xnet automatically scans all messages for viruses using RAV AntiVirus.

Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate variantele lor.
Va rugam sa luati in considerare ca exista un risc de fiecare data cand deschideti
fisiere atasate si ca MobiFon nu este responsabila pentru nici un prejudiciu cauzat
de virusi.

Disclaimer: RAV AntiVirus may not be able to detect all new viruses and variants.
Please be aware that there is a risk involved whenever opening e-mail attachments
to your computer and that MobiFon is not responsible for any damages caused by
viruses.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to fork a process?

2003-11-05 Thread Octavian Rasnita
Hi all,

I've tried the following code:

#!/perl/bin/perl -w

use strict;

$| = 1;

print "Content-type: text/html\n\n";

my $pid=fork;

if ($pid) {
print "parent\n";
exit 0;
}
else {
⊂
}

sub sub {
sleep(100);
open(OUT, ">>f:/teddy/.txt") or die "Can't write to .txt - $!";
print OUT "test";
close OUT;
}


This script should fork the child process which after waiting 100 seconds it
should print a test text in a file.
The problem is that if I run the script from a web browser it waits for 100
seconds before it finishes.

If I add:

close STDOUT; close STDIN; close STDERR;

...The script ends immediately, but the child process is not executed at
all.

I am trying to make it work under Windows and Linux.

Help!

I've discovered that I can make what I want if I create 3 scripts.
1. Just exec the second perl script with exec("perl script2.pl");

2. Forks a child process and in the child process exec() the third perl
script.
3. Just does what I want (the time consuming script).

Is there a method to do this without needing 3 scripts?
I would like to do it with only  1 ...or 2.


Thank you.

Teddy,
teddy.fcc.ro [EMAIL PROTECTED]


---
Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV AntiVirus.
Xnet automatically scans all messages for viruses using RAV AntiVirus.

Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate variantele lor.
Va rugam sa luati in considerare ca exista un risc de fiecare data cand deschideti
fisiere atasate si ca MobiFon nu este responsabila pentru nici un prejudiciu cauzat
de virusi.

Disclaimer: RAV AntiVirus may not be able to detect all new viruses and variants.
Please be aware that there is a risk involved whenever opening e-mail attachments
to your computer and that MobiFon is not responsible for any damages caused by
viruses.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Finding the current path

2003-10-27 Thread Octavian Rasnita
Thank you, but this is not doing what I want.
I would like to find the current directory from where I run the script, not
the path of that script.

I can do it by running the pwd command line probably, but I need to run this
under Windows.

Thanks.

- Original Message - 
From: "Wiggins d'Anconia" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, October 26, 2003 7:12 PM
Subject: Re: Finding the current path


> Octavian Rasnita wrote:
> > Hi all,
> >
> > Does anyone know if it is possible to find out the path in which a perl
> > program is launched?
> >
> > For example, I am in /var/www and I run the following command:
> >
> > perl /home/script.pl
> >
> > And I want it to give me the result:
> >
> > /var/www
> >
> > Thank you very much.
> >
> >
>
> Check out FindBin should be standard on newer Perls.
>
> perldoc FindBin
>
> I think this will provide what you want...
>
> http://danconia.org
>
>


---
Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV AntiVirus.
Xnet automatically scans all messages for viruses using RAV AntiVirus.

Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate variantele lor.
Va rugam sa luati in considerare ca exista un risc de fiecare data cand deschideti
fisiere atasate si ca MobiFon nu este responsabila pentru nici un prejudiciu cauzat
de virusi.

Disclaimer: RAV AntiVirus may not be able to detect all new viruses and variants.
Please be aware that there is a risk involved whenever opening e-mail attachments
to your computer and that MobiFon is not responsible for any damages caused by
viruses.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Finding the current path

2003-10-27 Thread Octavian Rasnita
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.

If the current path is:
/var/www
(This path is shown by pwd command).

and the script is in:
/home/script.pl

if I run:
perl /home/script.pl

if the script will print $0, it will print:
/home/script.pl

But I want it to print:
/var/www
(Meaning the current directory).

Now, I could run pwd and get what I want, but in fact I need to run this
program under Windows.

Thanks.

Teddy

- Original Message - 
From: "Charles K. Clarkson" <[EMAIL PROTECTED]>
To: "'Octavian Rasnita'" <[EMAIL PROTECTED]>
Sent: Sunday, October 26, 2003 6:40 PM
Subject: RE: Finding the current path


> Teddy,
>
>  It should be part of $0.
>
> HTH,
>
> Charles K. Clarkson
> -- 
> Head Bottle Washer,
> Clarkson Energy Homes, Inc.
> Mobile Home Specialists
> 254 968-8328
>
>


---
Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV AntiVirus.
Xnet automatically scans all messages for viruses using RAV AntiVirus.

Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate variantele lor.
Va rugam sa luati in considerare ca exista un risc de fiecare data cand deschideti
fisiere atasate si ca MobiFon nu este responsabila pentru nici un prejudiciu cauzat
de virusi.

Disclaimer: RAV AntiVirus may not be able to detect all new viruses and variants.
Please be aware that there is a risk involved whenever opening e-mail attachments
to your computer and that MobiFon is not responsible for any damages caused by
viruses.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Finding the current path

2003-10-26 Thread Octavian Rasnita
Hi all,

Does anyone know if it is possible to find out the path in which a perl
program is launched?

For example, I am in /var/www and I run the following command:

perl /home/script.pl

And I want it to give me the result:

/var/www

Thank you very much.

Teddy,
teddy.fcc.ro [EMAIL PROTECTED]


---
Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV AntiVirus.
Xnet automatically scans all messages for viruses using RAV AntiVirus.

Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate variantele lor.
Va rugam sa luati in considerare ca exista un risc de fiecare data cand deschideti
fisiere atasate si ca MobiFon nu este responsabila pentru nici un prejudiciu cauzat
de virusi.

Disclaimer: RAV AntiVirus may not be able to detect all new viruses and variants.
Please be aware that there is a risk involved whenever opening e-mail attachments
to your computer and that MobiFon is not responsible for any damages caused by
viruses.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Installing modules

2003-10-16 Thread Octavian Rasnita
Hi all,

Does anyone know how could I install the DBI and DBD::mysql modules under
Red Hat if I don't have root rights?

Thanks.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Execute an application

2003-10-15 Thread Octavian Rasnita
You cannot do that because if you want to run a program in a web browser
that program should not print a graphical interface, but an HTML document,
or at least it should print a proper Content-type, like text/html for
example.

- Original Message - 
From: "steve" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 15, 2003 12:39 AM
Subject: Execute an application


> I have written an perl script to execute another file, which happens to
> be a gui application - gedit.  gedit is a text editor in RedHat 9.
> That's not the real application I want to run, but it serves it's
> purpose for testing - the real application I want to execute is a kylix
> gui application I wrote.
>
> So here's my perl script:
>
> #!/usr/bin/env perl
> print "Content-type: text/html\n\n";
> exec("sudo gedit & > /dev/null 2>/dev/null");
>
> Works great when ran from gnome-terminal with line like:  perl myscript
>
> I need to execute this script from a web page, through a browser.
> When I browse to this page in the cgi-bin directory, gedit does not show
>   up and I get an error in my Apache error log directory:
>
> [Tue Oct 14 13:13:30 2003] [error] [client 127.0.0.1] (gedit:17268):
> Gtk-WARNING **: cannot open display:
>
> How can I get this to work?  Thanks.
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Email with attachment and HTML email

2003-10-07 Thread Octavian Rasnita
Hi all,

I know to use the Net::SMTP module, but I would like to send an email which
has a fiew file attached and to be an HTML type because I want to include an
image in it.

Do you know which perl module can help me doing that?

Thank you.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: SSI in subdomains

2003-09-25 Thread Octavian Rasnita
Try putting a space after the last " like:



- Original Message - 
From: "Ramon Chavez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 25, 2003 9:37 PM
Subject: SSI in subdomains


> Hello all.
>
> I have a problem.
> I have subdomain and want to include some SSI in the webpages, but it
> doesn't seem to work
>
> I have this:
> subdomain.domain.com
>
>  that is actually stored in
> domain.com/subdomain/
>
> If I try to run a SSI from an HTML file calling a script from the cgi-bin,
> say
> subdomain.domain.com/index.shtml
>
> I get an error message, saying something like:
>'Can't locate file path-to/domain.com/subdomain/cgi-bin/script.pl'
>
> I have tried both ways:
>
> 
> 
>
> and haven't worked. I'm using '/' before cgi-bin to send the command to
the
> root, but still get the same message
>
> So, I decided to create a cgi-bin directory in 'domain.com/subdomain/' and
> uploaded the script there.
>
> Now. If I run the script as
>www.domain.com/subdomain/cgi-bin/script.pl
>
> Everything runs fine
> But if I run it as
>  subdomain.domain.com/cgi-bin/script.pl
> It doesn't work and sends a Permission denied message
>
> This way I can run
> domain.com/subdomain/index.shtml
>
> and get the correct answer. But I can't run
> subdomain.domain.com/index.shtml
>
> Which is bad because my reason to have the subdomain is to get people
there
> instead of going through www.domain.com.
>
>
> The only way I have found to make subdomain.domain.com/index.shtml to work
> is to have a copy of script.pl in both directories:
> domain.com/cgi-bin
> domain.com/subdomain/cgi-bin
>
> wich seems absurd to me. Specially if this script is supposed to wite to a
> file in the same directory.
>
> How can I make a SSI call work from a subdomain???
> Am I missing something???
> Can you help me???
>
> Any comment will be appreciated.
>
> -rm-
>
>
>
>
>
>
>
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Help wanted regading approch for displaying live scores

2003-09-23 Thread Octavian Rasnita
You will need to refresh the entire page.
Or as you said, you can use iframes.

- Original Message - 
From: "parvez mohamed" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 23, 2003 10:43 AM
Subject: Help wanted regading approch for displaying live scores


> Hi,
>   I am building a application in which i need to
> display live stock market prices with out the user
> presing the refresh button. Its similer to live game
> scores. 
> 
> I have tryed using something like this simple script :
> 
> #!/usr/bin/perl
> chop ($current_date = `/bin/date`);
> print "Content-type: text/html", "\n\n";
> print "", "\n";
> print "Effects of Browser
> Caching", "\n";
> print "";
> print "", $current_date, "", "\n";
> print "", "\n";
> 
> This refreshes the whole page 
> i need to refresh only some fields not the whole page 
> I can use floating frames for this but i dont think
> its good solution 
> 
> Is there any thing else that i can try 
> plase what ever idea u have 
> 
> Thanks in advance,
> Parvez
> 
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Capturing At Compile Time

2003-09-17 Thread Octavian Rasnita
Are you sure it is a binary file?
But anyway, a perl program can be made to be an executable that doesn't need
perl to run it.
Download Active State Perl Developer Kit from www.activestate.com for this.
The file is not compiled, but the perl interpreter is included in the
executable file with the perl program, and the other libraries.

There is a program named perlcc that should compile a perl program, but it
doesn't work.

- Original Message - 
From: "essential quint" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, September 17, 2003 10:24 AM
Subject: Capturing At Compile Time


> Greets,
>
> Awhile back I downloaded a script that was "protected" before purchase.
> When I opened it to look at the code the script was in binary format, not
> perl's pre-interpreted language, so I think they must have captured it at
> compile time.  Can anyone tell me how this is done?  It seemed a neat way
to
> protect one's code.
>
> Also, is there a way to "cross" compile perl into other languages, like,
for
> instance, if you wanted to get your Perl code translated from Perl into C?
> I've heard that is possible, but I've never seen it actually done.
>
> Thanks,
>
> quint
>
> _
> Use custom emotions -- try MSN Messenger 6.0!
> http://www.msnmessenger-download.com/tracking/reach_emoticon
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: File Permissions

2003-09-07 Thread Octavian Rasnita
Read:

perldoc -f chmod

- Original Message - 
From: "Greenhalgh David" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, September 07, 2003 9:08 AM
Subject: File Permissions


> Hi All,
> 
> I have a script which, amazingly, is doing exactly what it is supposed 
> to do. It is taking user input, processing it and, over several 
> iterations of the script, building a text file on the server. The text 
> file itself is used as the input to a Java applet.
> 
> All works fine on my local machine, but on the remote server the applet 
> bombs out with a file permission error. How do I set the permissions on 
> an output file, and what permissions should I use to ensure that a text 
> file stored on the server (in a different directory to the script) can 
> be properly used by the applet? (664 works fine on the local machine, 
> the remote server is perfectly happy about me setting permission, but 
> refuses to tell me what they are when I ask, I've given up being 
> surprised by it...)
> 
> Dave
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Addendum] Stripping HTML from a text file.

2003-09-05 Thread Octavian Rasnita
It doesn't work because you check for the beginning and the end  tags
in the same line, but you have splitted the text in more lines, and the
 can be found in a line but the  tag on another line probably.


You can use something like this:

$html =~ s|]*>.*?]*>||si;

So you don't need to check each line separately.

It works for the  head tag but it doesn't work for all the tags, because you
might have a page like this:


a1
a2
a3
b1


...


b3


If you will want to delete everything from  until its corresponding
 it is more complicated because if you will use that simple regular
expression it will delete until the first  but not until the second
one.


- Original Message - 
From: "Sara" <[EMAIL PROTECTED]>
To: "Sara" <[EMAIL PROTECTED]>; "Hanson, Rob" <[EMAIL PROTECTED]>;
"'Wiggins d'Anconia'" <[EMAIL PROTECTED]>
Cc: "beginperl" <[EMAIL PROTECTED]>
Sent: Wednesday, September 03, 2003 4:08 PM
Subject: [Addendum] Stripping HTML from a text file.


> Okay, when I finally implemented this, again its not working ... any
ideas?
> simple regex like s///g; is working but not this one?
>
> 
> #!/usr/bin/perl
>
> use LWP::Simple;
>
> print "Content-type: text/html\n\n";
>
> $url = 'http://yahoo.com';
>
> $html = get($url);
>
> @html = split(/\n/,$html);
>
> foreach $line(@html) {
>
> chomp ($line);
>
> $line =~ s|.*?<\/head>||s;
>
> print "$line\n";
>
> }
> #
>
>
>
> Thanks for any input.
>
> Sara.
>
>
>
> - Original Message -
> From: "Sara" <[EMAIL PROTECTED]>
> To: "Hanson, Rob" <[EMAIL PROTECTED]>; "'Wiggins d'Anconia'"
> <[EMAIL PROTECTED]>
> Cc: "beginperl" <[EMAIL PROTECTED]>
> Sent: Wednesday, September 03, 2003 4:34 PM
> Subject: Re: Stripping HTML from a text file.
>
>
> : Thanks a lot Hanson,
> :
> : It worked for me.
> :
> : Yep, you are right "The regex way is good for quick and dirty HTML
work."
> :
> : and especially for the newbies like me :))
> :
> : Sara.
> :
> :
> : - Original Message -
> : From: "Hanson, Rob" <[EMAIL PROTECTED]>
> : To: "'Wiggins d'Anconia'" <[EMAIL PROTECTED]>; "'Sara'"
> : <[EMAIL PROTECTED]>
> : Cc: "beginperl" <[EMAIL PROTECTED]>
> : Sent: Friday, September 05, 2003 5:55 AM
> : Subject: RE: Stripping HTML from a text file.
> :
> :
> : : > Or maybe I misunderstood the question
> : :
> : : Or maybe I did :)
> : :
> : : > HTML::TokeParser::Simple
> : :
> : : I agree... but only if you are looking for a strong permanant
solution.
> : The
> : : regex way is good for quick and dirty HTML work.
> : :
> : : Sara, if you need to keep the  tags, then you could use this
> : modified
> : : version...
> : :
> : : # untested
> : : $text = "...";
> : : $text =~ s|().*?()|$1$2|s;
> : :
> : : ...Or if you wanted to keep the  tag...
> : :
> : : # untested
> : : $text = "...";
> : : $text =~ s|().*?.*?.*?()|$1$2$3|s;
> : :
> : : Rob
> : :
> : : -Original Message-
> : : From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED]
> : : Sent: Thursday, September 04, 2003 8:48 PM
> : : To: 'Sara'
> : : Cc: beginperl
> : : Subject: Re: Stripping HTML from a text file.
> : :
> : :
> : : Won't this remove *everything* between the given tags? Or maybe I
> : : misunderstood the question, I thought she wanted to remove the "code"
> : : from all of the contents between two tags?
> : :
> : : Because of the complexity and variety of HTML code, the number of
> : : different tags, etc. I would suggest using an HTML parsing module for
> : : this task. HTML::TokeParser::Simple has worked very well for me in the
> : : past.  There are a number of examples available. If this is what you
> : : want and you get stuck on the module then come back with questions.
> : : There are also the base modules such as HTML::Parser, etc. that the
one
> : : previously mentioned builds on, among others check CPAN.
> : :
> : : http://danconia.org
> : :
> : : Hanson, Rob wrote:
> : : > A simple regex will do the trick...
> : : >
> : : > # untested
> : : > $text = "...";
> : : > $text =~ s|.*?||s;
> : : >
> : : > Or something more generic...
> : : >
> : : > # untested
> : : > $tag = "head";
> : : > $text =~ s|<$tag[^>]*?>.*?||s;
> : : >
> : : > This second one also allows for possible attributes in the start
tag.
> : You
> : : > may need more than this if the HTML isn't well formed, or if there
are
> : : extra
> : : > spaces in your tags.
> : : >
> : : > If you want something for the command line you could do this...
> : : >
> : : > (Note: for *nix, needs modification for Win [untested])
> : : > perl -e '$x=join("",<>);$x=~s|.*?||s' myfile.html >
> : : > newfile.html
> : : >
> : : > Rob
> : : >
> : : >
> : : > -Original Message-
> : : > From: Sara [mailto:[EMAIL PROTECTED]
> : : > Sent: Wednesday, September 03, 2003 6:32 AM
> : : > To: beginperl
> : : > Subject: Stripping HTML from a text file.
> : : >
> : : >
> : : > I have a couple of text files with html code in them.. e.g.
> : : >
> : : > -- Text File

Getting the partial content from a cgi sccript

2003-08-29 Thread Octavian Rasnita
Hi all,

A few days ago I was asking what makes a server allow returning a partial
content (when using the Range HTTP header).

There were some discussions that the core of the server might decide that,
that some modules of the server (mod_cgi and mod_php...) decide that, or
that the CGI program can be created in such a way so its content can be
returned partially.

I've tested a little using a cgi program made in perl and a php program that
print a few characters, and their content needed to be returned partially.
I've made then a cgi program in perl that should get the partial content of
those files.

Well, using Apache 2.0.4 under Windows let me download both files partially
with the specified ranges, without doing anything special in the server
settings nor in the cgi script. I just used the Range HTTP header.

Probably it doesn't depend on the server modules, or probably my server
modules supports this, or the web server core is responsable for that.

However, I don't think that there is a setting somewhere where we can choose
if we want the server return partial content in order to allow resuming
downloads.

teddy.fcc.ro
[EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: fetching text/html

2003-08-29 Thread Octavian Rasnita
Yes you can. Use the LWP module.

teddy.fcc.ro
[EMAIL PROTECTED]
- Original Message - 
From: "Ling F. Zhang" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 29, 2003 7:32 AM
Subject: fetching text/html


it is possible to fetch the result of a cgi/aps/cf
script at some address and then save it to a perl
string (or array?)
Can I request like a browser does
http://somesite/somescript.cgi
and get the html code in return, perhaps with a
content type header?

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: automated file removal / cache clearing

2003-08-28 Thread Octavian Rasnita
But why forking more processes?

The cgi program might check which of the files need to be deleted, then
create a temporary lock file, then it could fork a process that will delete
those files.
The next visitor will come and execute the same cgi script, but it will see
the lock file and it won't delete any file.

In fact, if the web site has many visitors, the script could be put on a
script which is not so often executed by all visitors.
Or that script could check and start deleting files only after a period of
time, let's say... 10 minutes, 1 hour... etc.

teddy.fcc.ro
[EMAIL PROTECTED]
- Original Message -
From: "drieux" <[EMAIL PROTECTED]>
To: "cgi cgi-list" <[EMAIL PROTECTED]>
Sent: Thursday, August 28, 2003 6:58 PM
Subject: Re: automated file removal / cache clearing



On Wednesday, Aug 27, 2003, at 14:22 US/Pacific, Octavian Rasnita wrote:

> Or if you don't want to depend on Unix's cron and want your program to
> do
> everything, you can set it so each time a new visitor comes to your
> site,
> checks which files are not needed, and delete them.
> You can use fork to avoid putting the visitors to wait until the
> program is
> doing its background job.
[..]

at first blush that CAN seem to be an interesting
idea - but in the worst case one can have N connections,
each of which has generated N forked children to
walk through M possible files... and one starts
asking one's self,

is this an order N square or N factorial solution?

while in the worst case the cron job based solution
is merely an order N problem...



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: automated file removal / cache clearing

2003-08-27 Thread Octavian Rasnita
Or if you don't want to depend on Unix's cron and want your program to do
everything, you can set it so each time a new visitor comes to your site,
checks which files are not needed, and delete them.
You can use fork to avoid putting the visitors to wait until the program is
doing its background job.

teddy.fcc.ro
[EMAIL PROTECTED]
- Original Message -
From: "drieux" <[EMAIL PROTECTED]>
To: "cgi cgi-list" <[EMAIL PROTECTED]>
Sent: Wednesday, August 27, 2003 8:46 PM
Subject: Re: automated file removal / cache clearing



On Wednesday, Aug 27, 2003, at 07:18 US/Pacific, Shahar Evron wrote:
[..]
> I'm working on a CGI program that creates some user-specific
> file on the server when accessed. is there a good way to make
> sure theese files are cleared when they're no longer needed -
> IE if a file in a specific directory was not accessed for 5 minutes,
> delete it.
[..]

I hate to suggest the alternative, but why not
use a 'cookie' to cache that information on
the user's side?



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Counter triggered on download

2003-08-25 Thread Octavian Rasnita
This is a pretty good method, but it is not so good because the visitors
won't be able to use a Download manager to download the file.
Or better said, they won't be able to resume the download.

I am not sure, I will be testing this soon, but maybe a solution for this
problem could be specifying the Content-length of this file as a HTTP
header.

This way the browsers and the download managers will be able to send the
"Range" HTTP header and the web server will accept it.

But as I said, I am not sure yet.

teddy.fcc.ro
[EMAIL PROTECTED]
- Original Message -
From: "fliptop" <[EMAIL PROTECTED]>
To: "Merrill Oakes" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 11:29 PM
Subject: Re: Counter triggered on download


On Wed, 20 Aug 2003 at 13:29, Merrill Oakes opined:

MO:I have a link to a PDF file on a web page.  I want to count how many
MO:times that someone clicks on the link (i.e. downloads the PDF).  The
MO:easy way (at least for me) would be to make them go to a "download page"
MO:first, and I could put a counter in the page, BUT this requires an extra
MO:step for the user.
MO:
MO:SO, is there any way to:#1. monitor how many a times a file has been
MO:downloaded, or maybe #2. have them click on a link (that is really a cgi
MO:script, that then increments the counter then starts the download/open
MO:of the PDF?  Of course this last method will disable the ability to do a



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: elsif issues ....still

2003-08-21 Thread Octavian Rasnita
Yes, it should be used

... == 1

without quoting the numbers.

teddy.fcc.ro
[EMAIL PROTECTED]
- Original Message -
From: "Lile, James AZ2 (VAW-115)" <[EMAIL PROTECTED]>
To: "'Catriona Wordsworth'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Friday, August 22, 2003 6:34 AM
Subject: RE: elsif issues still


Someone correct me if I am wrong, the numbers in quotes are being read as
strings and not numbers, or numbers not strings.
The == works with numbers, and the quotes are for strings. I think that the
way you have it set up, the number one is returning true when the $variable
is defined.

respectfully,
James


-Original Message-
From: Catriona Wordsworth [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 20, 2003 8:03 AM
To: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Counter triggered on download

2003-08-21 Thread Octavian Rasnita
Put the link to a cgi script which makes an HTTP forward using the
"Location=$url\n\n" header or print an HTML page which use an HTML meta
refresh.
This way the visitors may use a download manager to download the PDF file,
and you can count the downloads.

teddy.fcc.ro
[EMAIL PROTECTED]
- Original Message -
From: "Merrill Oakes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 20, 2003 8:29 PM
Subject: Counter triggered on download




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: right click help please?

2003-08-20 Thread Octavian Rasnita
This is not possible.

teddy.fcc.ro
[EMAIL PROTECTED]
- Original Message -
From: "Catriona Wordsworth" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 20, 2003 7:38 AM
Subject: right click help please?


Can anyone assist me with how to change the right click menu.  When someone
right clicks the html page, the menu there gives the option to "view source"
I would still like to keep this there but have it password protected so that
only I can view the source.

any ideas on this one??

thanks & regards

Cat


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: disable back button

2003-08-20 Thread Octavian Rasnita
You cannot disable the back button and the keyboard hotkey for this task
from a perl script.
You might need to use a client side program, like a Javascript one.

However, you can make a page not to cache, and to expire immidiately, and
this way if a visitor will press the back button the page won't be shown
automaticly.
However, they will be asked if they want to resend the data to the server
and if the visitors will answer 'yes', the browser will resend it with no
problem.
You need to use this method, and also check on the server that the data was
not submitted for a second time.

To print the http headers for not allowing caching and to set the expiration
date to immidiately expire, use something like:

print <
...

EOF

teddy.fcc.ro
[EMAIL PROTECTED]
- Original Message -
From: "Catriona Wordsworth" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 20, 2003 7:38 AM
Subject: disable back button


Hi guys,

pretty simple stuff I hope, but can someone tell me how to disable the back
button in my perl script?

thanks & regards

Cat



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: perl script as binary

2003-08-14 Thread Octavian Rasnita
No, you don't need to add any dll files (at least with ActiveState Perl
Developer kit).
The perl interpreter is included in the .exe file by default. If you want
you can choose to not include it and only in that case the perl.dll file
needs to be  used.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
[EMAIL PROTECTED]



- Original Message -
From: "Jonathan E. Hogue" <[EMAIL PROTECTED]>
To: "'Sven Bentlage'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, August 14, 2003 3:09 PM
Subject: RE: perl script as binary


I've had some luck with perl2exe in the past. If I remember correctly,
you also have to deliver a couple of .dll's with the executable. Can you
turn the app into a web app? You might have more luck with that.
http://www.indigostar.com/perl2exe.htm

-Original Message-
From: Sven Bentlage [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 8:28 AM
To: [EMAIL PROTECTED]
Subject: perl script as binary



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Why executable?

2003-08-14 Thread Octavian Rasnita
Oh, but I guess this is a little security improvement, not?
But now... another related question.

If the shebang line is not needed by the web server (if I will define an
action to run perl in httpd.conf), is the shebang line used for something
else?

I've tried chmodding the perl script to 755, and I've tried running it with:

$ script.pl

...but it didn't want to run, telling me that there is no command script.pl,
even though the script has a shebang line in it.

Oh, do you know if I can specify the action for running .pl files and .cgi
files with perl in a .htaccess file?

Thanks.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Kristofer Hoch" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 11, 2003 5:04 PM
Subject: Re: Why executable?


This is what I do for security on my webserver.  I don't have the
shebang line in my scripts.  The webserver has a list of approved perl
script extensions.  When it runs across a file with this extension, the
web server executes it with perl.  Otherwise, it treats the file as if
it is text/html.

Kristofer.
--- zentara <[EMAIL PROTECTED]> wrote:
> On Mon, 11 Aug 2003 11:33:40 +0300, [EMAIL PROTECTED] (Octavian
> Rasnita)
> wrote:
>
> >Hi all,
> >
> >Does anyone know why the perl scripts need to have the execute
> permission
> >under Unix?
> >
> >I am asking this because I've seen that the PHP files don't need
> this
> >permission.
> >
> >Couldn't perl just read a text file (doesn't matter if it has an
> execute
> >permission or not), interpret it and execute it just like PHP does
> with its
> >programs?
>
> perl scripts can be done the same way
>
> You can take any perl script, and remove the shebang line, chmod it
> to
> 644 , and run it like "perl scriptname"
>
> The way PHP is setup, the PHP interpreter is executable and calls
> it's
> readonly scripts.
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


=
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GIT d s+:++ a C++ UL++ US+ P+++ L++
W+++ w PS PE t++ b+ G e r+++ z
--END GEEK CODE BLOCK--

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Why executable?

2003-08-14 Thread Octavian Rasnita
Hmm, are you telling that I can create a perl file and name it file.html,
file.php, or even file.asp, and use a shebang line in it, then it will be
parsed as a perl file?
Or I need to use extensions that are not set in the server's conf file to be
parsed as other types?

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Randal L. Schwartz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Kristofer Hoch" <[EMAIL PROTECTED]>
Sent: Monday, August 11, 2003 7:35 PM
Subject: Re: Why executable?


> "Kristofer" == Kristofer Hoch <[EMAIL PROTECTED]> writes:

Kristofer> This is what I do for security on my webserver.  I don't have the
Kristofer> shebang line in my scripts.  The webserver has a list of approved
perl
Kristofer> script extensions.  When it runs across a file with this
extension, the
Kristofer> web server executes it with perl.  Otherwise, it treats the file
as if
Kristofer> it is text/html.

And if you are required to include that "extension" as part of your
URL, you are actually *decreasing* the security of your webserver, not
increasing it.

You should never be able to guess the implementation language by
looking at a URL.  Wrong.  Wrong.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Why executable?

2003-08-14 Thread Octavian Rasnita
Hi all,

Does anyone know why the perl scripts need to have the execute permission
under Unix?

I am asking this because I've seen that the PHP files don't need this
permission.

Couldn't perl just read a text file (doesn't matter if it has an execute
permission or not), interpret it and execute it just like PHP does with its
programs?

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Selecting using regular expressions

2003-08-14 Thread Octavian Rasnita
Hi all,

I want to select all the content of a table from a file using regular
expressions (and not a module).
Can you give me some hints about how can I do this?

For example I have the following text:


..
..
 ... ...


As you see, I could find more other tables included in this table and I
usually don't know how many are they nor at what level they are included.

Thank you for any hints.

Of course, I am not expecting this selection to be possible with a single
regular expression line, but... who knows.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Perl line breaks

2003-08-14 Thread Octavian Rasnita
It depends how is set the web server to execute the programs that will
process the CGI scripts.
By default Apache is set to need the shebang line and it doesn't use the
registry settings, but this can be changed.

...and you don't need to print the HTML header in the BEGIN {} block.
You can just print it at the top of the perl program or in the middle of the
program but before anything else is printed.


Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Jonathan Hogue" <[EMAIL PROTECTED]>
To: "Mike Harrison" <[EMAIL PROTECTED]>; "'Andrew Brosnan'"
<[EMAIL PROTECTED]>; "Mike Harrison" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, August 05, 2003 4:21 AM
Subject: RE: Perl line breaks



>2. My first line in the perl program is: #!perl -w (being a Windows-based
>server, it doesn't require the full path.  The -w to warn of
errors/mistakes
>etc.)

I think in Windows, -w isn't enough. The #!perl line is ignored in most
windows installations/configurations , and the file association is used
instead.

Therefore, you should do this explicately.
use warnings;

Also, with some webservers doing the following as your first line in the
script will catch almost all errors. (Works in IPlanet, but not Apache. Not
sure about Windows)
BEGIN { print "Content-Type: Text/HTML\n\n"; }




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Perl line breaks

2003-08-14 Thread Octavian Rasnita
What web server is installed on that computer?
Some web servers need to use non parsed header scripts (NPH) and I heard
that this is the case with MS IIS if this is the web server.

The line break is not very important for perl scripts under Windows. I use
only the Unix end of line (lf) under Windows for my perl scripts and they
work fine.
I don't know if they would be working the same if I will be using Mac end of
lines, but with Unix end of line they work fine.

I guess you should send that script to the list...

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Mike Harrison" <[EMAIL PROTECTED]>
To: "'Andrew Brosnan'" <[EMAIL PROTECTED]>; "Mike Harrison"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, August 05, 2003 3:07 AM
Subject: RE: Perl line breaks


Hi Andrew,

1. Yes, I am using the same headers as the perl program that works, so don't
think it is that - I will check that there is a blank line between the
'Content-Type:...' line and the next.

2. My first line in the perl program is: #!perl -w (being a Windows-based
server, it doesn't require the full path.  The -w to warn of errors/mistakes
etc.)

I will need to wait till tonight before sending some of the perl program and
header info...

Cheers,
Mike.


-Original Message-
From: Andrew Brosnan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 05 August, 2003 10:03 AM
To: Mike Harrison
Cc: [EMAIL PROTECTED]
Subject: Re: Perl line breaks


On 8/5/03 at 9:32 AM, [EMAIL PROTECTED] (Mike Harrison)
wrote:

> Hello all,
>
> Well, I have spent the last few nights messing around trying to work
> out why one of my PERL programs doesn't work.

s/Perl/PERL/

> With one program, I am getting an error message as follows:
>
> CGI Error The specified CGI application misbehaved by not returning a
> complete set of HTTP headers. The headers it did return are:

How are you creating your headers? Perhaps you could show that here.

>
> My question is:  Are line breaks important with PERL programs

With headers they are:
print "Content-Type: text/html\n\n" #<-- blank line required

> does anybody know why I am getting this error?

Maybe Perl does. Did you ask?:
use warnings;



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Mail::Send question

2003-08-11 Thread Octavian Rasnita
What mail module can be used to send email messages with attachments?
I would prefer a module included in the perl package by default.

Thanks.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Wiggins d'Anconia" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 05, 2003 2:59 AM
Subject: Re: Mail::Send question




Camilo Gonzalez wrote:
> Todd W. wrote:
>
>> "Camilo Gonzalez" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PROTECTED]
>>
>>
 Definitely avoid this if possible, there are numerous mail message
 modules, one of them is bound to provide what you need.

>>>
>>> Why is sendmail held in such low regard by this group?
>>>
>>>
>>
>>
>> Most on this list will agree sendmail is one of the Internet's first
>> "killer
>> apps". But because interfacing directly with the sendmail binary can be
>> confusing and bug prone there are modules on the CPAN that use
>> sendmail as
>> the transport mechanism. These modules abstract sendmail's intricacies
>> from
>> the user, providing a simple API to send mail. Therefore, modules are the
>> preferred way to send mail from a perl program.
>>
>> Todd W.
>>
>>
>>
>>
>>
> I sometimes wonder if all this shielding of intricacies is necessarly a
> good thing. Shouldn't I know how to use sendmail? I guess I'm a DIY kind
> of guy and I want to know how sendmail works. Fine, if a module makes it
> all easier, I'll certainly use it. But I want to know how the
> abstraction occurs. What happens if the module I'm using in lieu of
> sendmail is buggy and I have no idea why or how to circumvent the
> problem? Do I have control issues?
>
>

At the very least these are the right questions to be asking. It really
depends on your situation if you are developing an application that is
intimately tied to sending email then it is a good thing that you know
how to call sendmail, and its intricacies. More important than that is
probably how to build an RFC compliant mail message. If this is your
situation then maybe a module is not right, however if your situation is
doing computationally intensive queries on a bio/genetic database, then
who cares how the message goes out that contains the output as long as
it gets where it is going, in this case the algorithms for generating
the content are far more important and time is better spent on them.

That is the other beautiful thing about Perl modules (at least the ones
on CPAN) they are open source so you can see how they work if you have
the time.

When we recently re-architected our app the first step I took was
looking into mail sending modules, logging modules, and cryptography
modules. I installed all of the variants I could find, became at least
proficient with each so that I could accomplish the smallest task that
mimiced my end goal and constructed a list of pros and cons for each. In
the case of cryptography (gnupg/pgp) the modules that were available
ranged from mediocre to very good, but none fit the specific
requirements of *my* project, so I built my own, but for mail I found
that there were at least two that provided all of the functionality (and
much much more) I needed and so I used one of them.

In general I have found that there is a middle area where a module is
least likely to fulfill my need, and by this I mean in complexity. The
more or less complex a task then usually a module can be found that
accomplishes the goal, it is the middle ground where a module may not be
robust enough to accomplish the task or may have different requirements
than mine that usually one can't be found that is just right. For the
very complex (like mail) assuming a module exists at all, usually it is
better than what I could accomplish in the span of time alotted so I
will choose to use it.  Most often for simple tasks a module doesn't
have to do much and may even be among the standard module base, for
instance copying a file across filesystem boundaries. A relatively easy
task that could be coded over and over, but with the File::Copy module
so accessible why bother

Just some thoughts...

http://danconia.org


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Perl line breaks

2003-08-07 Thread Octavian Rasnita
This code is working fine under Windows, but maybe you have made some
mistakes in your subroutine that  prints the header...

You don't need to print so many separate lines using the print "...";
function.

You can use:

print <


EOF

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Mike Harrison" <[EMAIL PROTECTED]>
To: "'Octavian Rasnita'" <[EMAIL PROTECTED]>; "Jon Hogue" <[EMAIL PROTECTED]>
Cc: "'Andrew Brosnan'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, August 06, 2003 2:24 AM
Subject: RE: Perl line breaks


I was trying to find a log file to look at.  I guess half the problem is I
am using a hosting service, and it is on a Microsoft IIS server (Windows
NT-based I think, but definitely not UNIX).  I will have to ask the hosting
admin where I might find a log file...

Here is the part of the perl script that I start printing things to the
browser (see previous message for the html.pm script that contains the
HTML_header and HTML_ender subroutines):

my $header = 'Successful update';
my $msg = "Your preferences have been updated
successfully...";

# Finally, put up a HTML document announcing that the update was successful.
&HTML_header($header);
print "\n";
print "\n";
print "$msg\n";
print "Return to the Account Management
page\n";
print "\n";
&HTML_ender;

Note that I have also tried using print qq| ... | code as well.

I am now getting a CGI error message along the lines of
Cannot find a string terminator '"' in ... line ... (the line above starting
with print "... ".  I can't find a problem with that line???

Thanks for your help so far guys!  I am losing a bit of sleep on this one :(
Regards,
Mike.


-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 06 August, 2003 2:30 AM
To: Jon Hogue
Cc: Mike Harrison; 'Andrew Brosnan'; [EMAIL PROTECTED]
Subject: Re: Perl line breaks


For troubleshooting a script you can take a look in the server's log file
and you will find there any error.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Jon Hogue" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>
Cc: "Mike Harrison" <[EMAIL PROTECTED]>; "'Andrew Brosnan'"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, August 05, 2003 4:19 PM
Subject: Re: Perl line breaks



>
>...and you don't need to print the HTML header in the BEGIN {} block.
>You can just print it at the top of the perl program or in the middle of
the
>program but before anything else is printed.

if something is dieing in a module you are loading, you will never know
about it because it will never get to the Content-Type and therefore never
send anything good to your browser. if you use a BEGIN block, you might
catch things that happen in modules you load. i wouldn't recommend doing
that for your normal script, but it is a useful troubleshooting tool.






-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Perl line breaks

2003-08-05 Thread Octavian Rasnita
For troubleshooting a script you can take a look in the server's log file
and you will find there any error.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Jon Hogue" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>
Cc: "Mike Harrison" <[EMAIL PROTECTED]>; "'Andrew Brosnan'"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, August 05, 2003 4:19 PM
Subject: Re: Perl line breaks



>
>...and you don't need to print the HTML header in the BEGIN {} block.
>You can just print it at the top of the perl program or in the middle of
the
>program but before anything else is printed.

if something is dieing in a module you are loading, you will never know
about it because it will never get to the Content-Type and therefore never
send anything good to your browser. if you use a BEGIN block, you might
catch things that happen in modules you load. i wouldn't recommend doing
that for your normal script, but it is a useful troubleshooting tool.





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Preserve line endings via ftp

2003-08-04 Thread Octavian Rasnita
If you set the transfer method to binary, the file is sent as it is, without
changing anything.
If you set it to ascii, the end of line character is set to lf for
Unix/Linux, crlf for Windows, and cr for Mac.

If your FTP program or the FTP library you use is not doing this correctly,
this means that it could have a bug because  it might not recognize well the
operating system and put the correct end of line.

But transfer the files in binary mode, then change the end of line to be
the correct end of line character for your system... if it is not possible
otherwise.


Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Peter Fleck" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, August 04, 2003 7:41 PM
Subject: RE: Preserve line endings via ftp


Setting the transfer type to binary didn't work.

Reading perldoc Net::FTP did:

ASCII is the default
type, and indicates that the sender of files will
translate the ends of lines to a standard representation
which the receiver will then translate back into their
local representation.

So I kept the unix line endings on the file and ftp'd to the Novell
server and the DOS line endings appeared over there.

For the record, this worked with both 'binary' and 'ascii' translations.


>
>On Mon, 4 Aug 2003 10:47:42 -0500, Peter Fleck <[EMAIL PROTECTED]> wrote:
>
>>  Greetings,
>>
>>  I'm using Net::FTP to move a file from a Linux server to a Novell
>>  server. Before I move the file, I have perl change all the line
>>  endings from unix-based to DOS-based. The line endings seem to get
>>  lost during the ftp process and end up as unrecognized characters (at
>>  least when viewing the text file from my Mac).
>>
>>  Trying to figure out how to change this so I can preserve those endings.
>
>Try setting the transfer type to binary. There is a 'binary' method...
>
>http://danconia.org
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


--
Peter Fleck
Webmaster | University of Minnesota Cancer Center
Dinnaken Office Bldg.
925 Delaware St. SE
Minneapolis, MN  55414
612-625-8668 | [EMAIL PROTECTED] | www.cancer.umn.edu
Campus Mail: MMC 806

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to display multiple web pages depending on

2003-07-29 Thread Octavian Rasnita
If this is a problem, you can use always $show = 50; ... for example.
This way you will let the visitors choose only the number of records that
should be skipped.

But I don't think that this is a problem because either way you do your
page, the visitor can create a program using the LWP library and get your
pages one by one, then combine them, parse them and steal all the data from
them.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Wiggins d'Anconia" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 29, 2003 6:12 AM
Subject: Re: How to display multiple web pages depending on


Octavian Rasnita wrote:
> It is not very hard.
>
> You can use an sql statement like this:
>
> my $sth = $dbh->prepare("select id, name, age, bla from table order by
name
> limit ?, ?");
> $sth->execute($skip, $show);
>
> You can get the number of rows you want to skip ($skip) and the number of
> rows you want to show ($show) using the CGI package like:
>
> USE  CGI;
> my $q = new CGI;
> my $skip = $q->param('skip');
> my $show = $q->param('show');
>
> You can check first the total number of rows that could be displayed, then
> you can compare, and if the total number of rows is bigger than the $skip
+
> $show, meaning the latest record printed in the current page, then you can
> print a "Next" link, and ... do the same with the "previous" link
>
>

This works well depending on the case. If the fact that you have a lot
of data is valuable in itself, or if your server is subject to heavy
loads, DOS attacks, etc. then you may not want to provide the method to
determine the number to select as an argument as anyone could choose an
arbitrarily high number to get all of the data then just use a parser to
"steal" your data, or if you have lots of data to overload your db with
multiple selects of all of the data, etc.

Just something to keep in mind otherwise I like this approach and use
something very similar,

http://danconia.org

>
> - Original Message -
> From: "Dennis Stout" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Monday, July 28, 2003 5:39 PM
> Subject: Re: How to display multiple web pages depending on
>
>
>
>>I want to write a subroutine to select the contain of MySQL database and
>>display the result on the browser.
>>But I'm not sure how to get it create multiple pages if the list exceeds
>>a given number; say 50, and create a link to the next page: like "Next"
>>or "1 2 3". I think it should be easy - but I've never seen codes like
>>that before.
>
>
> The idea is you create a ranged loop.
>
> for (x..x+y) {
>   #blah
> }
>
> #blah is where you put all your code for retrieving lines from the SQL
dbase
> and HTMLize them and return them.
>
> x is obtained through CGI params
>
> my $q = new CGI;
> my $start = $q->param('start');
>
> x+y is obtained however
>
> 1-
> my $end = $start + $q->param('amount_per_page');
> 2-
> my $end = $start + 50;
>
> whichever.
>
> Then;
>
> for ($start..$end) {
> #grab from db, htmllize, append to scalar variable...
> }
>
>
> print < 
> 
> $scalar_from_for_loop
> 
> 
> EOF
>
> and, yeah...
>
> Should put you on the right track.  I wrote my own customized interface to
> SQL
> (actually its an interface to the normal DBI interface, heh..) so I didn't
> write that portion since what I use would not at all be like what you
would
> use.
>
> Dennis
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to display multiple web pages depending on

2003-07-28 Thread Octavian Rasnita
It is not very hard.

You can use an sql statement like this:

my $sth = $dbh->prepare("select id, name, age, bla from table order by name
limit ?, ?");
$sth->execute($skip, $show);

You can get the number of rows you want to skip ($skip) and the number of
rows you want to show ($show) using the CGI package like:

USE  CGI;
my $q = new CGI;
my $skip = $q->param('skip');
my $show = $q->param('show');

You can check first the total number of rows that could be displayed, then
you can compare, and if the total number of rows is bigger than the $skip +
$show, meaning the latest record printed in the current page, then you can
print a "Next" link, and ... do the same with the "previous" link


Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Dennis Stout" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, July 28, 2003 5:39 PM
Subject: Re: How to display multiple web pages depending on


> I want to write a subroutine to select the contain of MySQL database and
> display the result on the browser.
> But I'm not sure how to get it create multiple pages if the list exceeds
> a given number; say 50, and create a link to the next page: like "Next"
> or "1 2 3". I think it should be easy - but I've never seen codes like
> that before.

The idea is you create a ranged loop.

for (x..x+y) {
  #blah
}

#blah is where you put all your code for retrieving lines from the SQL dbase
and HTMLize them and return them.

x is obtained through CGI params

my $q = new CGI;
my $start = $q->param('start');

x+y is obtained however

1-
my $end = $start + $q->param('amount_per_page');
2-
my $end = $start + 50;

whichever.

Then;

for ($start..$end) {
#grab from db, htmllize, append to scalar variable...
}


print <

$scalar_from_for_loop


EOF

and, yeah...

Should put you on the right track.  I wrote my own customized interface to
SQL
(actually its an interface to the normal DBI interface, heh..) so I didn't
write that portion since what I use would not at all be like what you would
use.

Dennis


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: PHP vs Perl

2003-07-28 Thread Octavian Rasnita
Of course I will remain subscribed and I am not gonna start learning PHP
immediately.
I am thinking to learn it because in my country there are only 2 books for
learning perl in my native language and even though I don't need them, there
are very few perl programmers and almost no jobs for perl developers.
There are even some programmers that just heard about perl but they don't
even know too well what it is, and they are good programmers in their
languages.

My problem is that I am used to work under Windows where no compiler is
installed by default and where some CPAN modules don't even compile under
this OS, and I cannot just jump and use Linux because Linux is not an
operating system too accessible for the blind, and I am totally blind.
Unfortunately I cannot try to solve this problem and start creating an
accessible version of Linux then creating perl programs under this OS.

Perl is great because OF CPAN also, but there are very many modules that
require Linux, some of them don't even tell this but the modules don't even
want to compile under this OS.

I am not trying to convince somebody that PHP or Java is better than perl,
but I am just trying to see what makes those programming languages so... "en
vogue".

For example a programmer in Java can create not only java servlets or java
server pages, but they can also create java applets and desktop programs
with a graphical interface while this is not possible with perl.
Internet Explorer, the most used browser can display java applets, but it
doesn't support perl scripts and those perl scripts cannot create a
graphical interface in the browser.
perl can create descktop programs with a graphical interface using the Tk
modules, but those modules are not accessible at all for the blind. They use
some strange classes that print the form like a picture on the screen while
Java programs can be made accessible with Java Access Bridge.

Well, see, these are perl problems, but perl doesn't have a company like Sun
Microsystems to fight to solve them, and it doesn't have so many advertisers
either.
For example, after installing Apache under Windows, by default PHP is set to
be accepted after instalation, but perl is not set and we need to add the
"AddHandler" lines in the httpd.conf file in order to make it work.

It is very clear that Apache is promoting PHP and there are not very many
companies that promote perl.
I've started to find (very strange) web hosting providers in my country that
offer PHP support and space for free and some of them unlimited traffic, but
they don't offer perl support at all.

I am not sure that PHP is used more than perl now, but after 5 years... it
will be used more than perl for sure.

Which could be the solutions?
- To have some Tk classes that are accessible for people with dissabilities.
- To be able to have the programs compiled as binaries (.exe under Windows)
without needing to embed the perl interpreter in the code like with perlapp,
or to have a kind of runtime environment - the perl interpreter installed
separately, but without any other unneeded modules.
- to have a very good development environment for programmers (I don't need
it, but new programmers in this language is searching for such a thing) and
it doesn't exist.
(I've tried comodo of ActiveState, but it is not accessible for the blind
like other programming languages environments)
- To have precompiled modules for Windows and for other operating systems
for much more packages than ActiveState has now.
- To have a set of kind of standard modules for creating, editing and
reading more file types that are precompiled and which can be installed
easier and a set of modules for working on the web, comunicating with more
merchant accounts,  shopping carts...
- to promote packages that contain perl, Apache, MySQL and possibly other
tools for programmers, because most programmers that test their programs
locally need them.
...

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Todd W." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 28, 2003 5:21 AM
Subject: Re: PHP vs Perl



"Octavian Rasnita" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I think the reason why PHP is used more and more much than Perl is that
for
> CGI related programs it is much simpler to use than perl.

Octavian , you haven't _proved_ that PHP is used more than perl.

> For example it has a set of libraries for the most used functions in a CGI
> program, for example SSL support, a module for reading and creating PDF
> files, modules for accessing some payments operators for shopping carts,
> etc.
> Those modules can be created in perl, but even if some of those modules
> exists for perl, they don't work  very well. I've tried to use the modules
&g

Re: PHP vs Perl

2003-07-27 Thread Octavian Rasnita
Of course you're almost right, but exactly this is a problem. A language
which I need to fight a lot with in order to find the right syntax for doing
something is not a very clear and easy to use programming language.
I like more the perl way than needing to learn very many functions names,
like when working with PHP or Visual Basic, but I like that PHP can be
installed as a package with the most used libraries, I also like that there
are some prebuild packages that contain Apache, MySQL and PHP configured in
such a way that they all work very nice.
There is no such a thing for Perl.
It is not very easy to install support for SSL, or the library  for creating
images for perl, while for PHP is much easier.
...

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Scot Robnett" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, July 27, 2003 8:35 PM
Subject: RE: PHP vs Perl


I think there are a couple of myths that need to be cleared up from that
post.

First, the idea that PDF manipulation and secure payment modules "don't work
very well" in Perl. If one has had difficulty in making the modules work for
them, it does not necessarily mean that the module is at fault - in some
cases it might be, but typically I've found that when a module isn't working
for me, I've usually missed something.

Second, the idea that most of the new work can be found in PHP and ASP is
not necessarily the case. The tech industry has taken a hit over the past
few years, and if you're looking at the job boards like Monster, maybe most
of what you *see* is slanted toward Microsoft technology. PHP and ASP are
pushed at corporations because somebody at a high level in the chain has
been told these are the widgets they should use. Trust me, I worked for one
of the major telecom players for 6 years, and I've seen how the buzzwords
work themselves into the hiring process.

However, in my business (I deal with small to medium-sized companies),
they're not concerned about what technology I use as long as it works. So
far, the language that makes most of my projects work is Perl.



-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 26, 2003 1:38 PM
To: [EMAIL PROTECTED]
Subject: Re: PHP vs Perl


I think the reason why PHP is used more and more much than Perl is that for
CGI related programs it is much simpler to use than perl.
For example it has a set of libraries for the most used functions in a CGI
program, for example SSL support, a module for reading and creating PDF
files, modules for accessing some payments operators for shopping carts,
etc.
Those modules can be created in perl, but even if some of those modules
exists for perl, they don't work  very well. I've tried to use the modules
for creating a PDF document under Windows, but with no success.
It is pretty hard to install some of the perl modules under Windows because
most of them need to be compiled, need a compiler to be installed, etc.

With PHP it is much simpler to work and I can see this even though I don't
know PHP at all yet.

The motivation for new perl learners is not very big because most of the
jobs can be found in PHP/ASP and only after that in perl/Cold Fusion.

I hope Perl 6 will have much more standard modules and the modules from CPAN
will be able to be installed without compiling them with a local compiler.
We should keep in mind that even if the most web servers are running under
Unix/Linux, most computer users and possibly web developers are working
under Windows and the CPAN modules should be all compatible with Windows
also,  and not only with Linux.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Todd W." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 24, 2003 11:26 PM
Subject: Re: PHP vs Perl



<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> > One of the coolest answers is at:
> >
> >http://us2.php.net/manual/en/faq.languages.php#faq.languages.perl
> >
> > where it notes that Perl is a complicated language that comes from
> > a time before the web whereas PHP was built specifically for
> > the web side of the game... Great!
> >
>
> Interesting read, though this still rings true for me "PHP is easier to
integrate into existing HTML than Perl." They see it as a bonus, I see it as
a hinderance for a multiple person operation.  Situation..
>

I was thinking the same thing when I read that. Swap the first occurence of
'PHP' with the first occurence of 'Perl' in the paragraph and you have a
perfectly formulated reason of why you should use perl over PHP !!??!!

It says, 

Re: PHP vs Perl

2003-07-27 Thread Octavian Rasnita
This is the reason I've began to learn perl and not PHP, but for CGI
programs I found that PHP might be easier.
I know that PHP is much more limited even for CGI programs than perl, but
for simple tasks it is much better.
And... most CGI programs are not extremly complicated.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "zentara" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 27, 2003 7:43 PM
Subject: Re: PHP vs Perl


On Wed, 26 Feb 2003 21:38:08 +0200, [EMAIL PROTECTED] (Octavian Rasnita)
wrote:

>I think the reason why PHP is used more and more much than Perl is that for
>CGI related programs it is much simpler to use than perl.

I don't mess around with php, but I do follow the discussions of it's
merits vs. perl on http://perlmonks.org.

I've been able to synthesize this from all the discussions:

PHP will give you the same performance benefits as using mod-perl.

PHP's drawback is that you are learning a language that can only be
used for web programming.

So well written mod-perl is comparable to PHP. I think the allure of PHP
is that it is probably easier for a beginner to learn, but it is a
dead-end, because you can't use it outside of web programming.
And as most perl programmers know, web programming is only a tiny
part of the usefulness of perl.sysadmin scripts, text processing,
task automation,etc.





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: PHP vs Perl

2003-07-26 Thread Octavian Rasnita
I don't say that mine is bigger than yours because perl is the only
programming language I know and I found out that I also need to know a
little C if I want to compile some perl modules that give a lot of errors.
I don't know PHP at all, but I found out that I could create the same thing
with PHP without needing me to know other programming languages.

In fact I also want to know why PHP is used more than Perl and this is
obviously.
I see less and less CGI files ending with .cgi or with .pl or /cgi-bin/
directories in the path of the URLS, but more and more I can see .php and
.jsp.

If we say that perl don't have any problem it will be used less and less
without having any problem.
I think that we should point out which are its problems because maybe they
can be solved.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Wiggins d'Anconia" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 27, 2003 1:05 AM
Subject: Re: PHP vs Perl


Octavian Rasnita wrote:

> I think the reason why PHP is used more and more much than Perl is that
for
> CGI related programs it is much simpler to use than perl.
> For example it has a set of libraries for the most used functions in a CGI
> program, for example SSL support, a module for reading and creating PDF
> files, modules for accessing some payments operators for shopping carts,
> etc.
> Those modules can be created in perl, but even if some of those modules
> exists for perl, they don't work  very well. I've tried to use the modules
> for creating a PDF document under Windows, but with no success.
> It is pretty hard to install some of the perl modules under Windows
because
> most of them need to be compiled, need a compiler to be installed, etc.
>
> With PHP it is much simpler to work and I can see this even though I don't
> know PHP at all yet.
>
> The motivation for new perl learners is not very big because most of the
> jobs can be found in PHP/ASP and only after that in perl/Cold Fusion.
>
> I hope Perl 6 will have much more standard modules and the modules from
CPAN
> will be able to be installed without compiling them with a local compiler.
> We should keep in mind that even if the most web servers are running under
> Unix/Linux, most computer users and possibly web developers are working
> under Windows and the CPAN modules should be all compatible with Windows
> also,  and not only with Linux.
>

This is the same kind of canned response that is the reason why this is
a flame war topic and was met with such jest immediately after being
asked.

1) Still not possible to prove that PHP is used more than Perl, which
also makes it impossible to prove it isn't

2) All of the modules you stated exist for PHP, exist for Perl, many of
them probably before those for PHP were developed. CPAN is the envy of
all languages, ask a Java developer familar with Perl sometime about how
they feel about CPAN...

3) What modules have you used that didn't work very well?  Ignorance
with respect to a module's interface does not prove poor performance.
Most modules that I have encountered have all worked as they claimed and
solved the goals' that they were designed for.

4) ActiveState has a very good list of modules available in a binary
format and that list is growing continuously, and most modules (at least
those that would be used on the web) are available from ActiveState, or
either without a compiler (though make is needed) or will compile under
windows with the proper free utilities. Laziness with regards to
installing modules doesn't indicate they don't or won't work.

5) From my time spent in the job market I would say it is pretty well
divided among all of the languages, especially since most postings read
something like "6 years of experience in Perl, CGI, ASP, PHP, Oracle,
COBOL"  (love that last one) which is a very poor indicator of the
actual market...

6) I feel sorry for the development house (and their clients) that
develops their site on a different system than it will be served (and I
don't mean a developer sitting at a Windoze machine ssh'd into the
server since that can't count because in that case they don't need the
modules locally).  Which means that if they are serving on Windows they
know what is available and are more likely able to get something to work
(I mean they are developers they ought to have a compiler available on
their own platform and know how to use it).  On Linux/*nix of course
this is mostly moot... (and there is 60+% of us on that platform)...

7) Let's not even mention coldfusion...

Now we were having a very nice (albeit weird) discussion about MVC and
pixies, let's not turn this into the typical mine is bigger than your's
discussion

http://danconia.org


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  1   2   3   4   >