Re: Some questions

2001-07-31 Thread Gabor Szabo

Hi Martin,

You should start learning regular expressions
e.g. by typing 
perldoc perlre

or probably better with one of the Perl Books. Probably Learning Perl
3rd edition can be a good choice though I have seen only the 2nd yet.
and now your examples:

 
 I want to know what this lines can mean. I have a lot of lines like that
 to
 understand.
 
 s/à/a/g
replace all occurance of à by a  in the variable $_

 
 $qte1 =~ /\s*//g ;
replace al white spaces (spac, tab) in the string in $qte1

 $usager =~ s/-/_/g ;
replace dash by underscore

 $ppa =~ /o/i
this does not mean anything on its own (but in an if statement it
would return TRUE if the string in $ppa conatins either o or O

regards
-- Gabor

 
 Thanks a lot
 Martin
 
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
-- 
Gabor Szabo
http://www.tracert.com/  
Web site monitoring
Web application development 
Perl training


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




Re: getch()

2001-07-11 Thread Gabor Szabo

$c = getc(STDIN);
or in shorter way
$c = getc;

then 
ord($c);
returns the ascii value

so in short
ord(getc());

-- Gabor

On 2001.07.11 17:14 Thomas Jakub wrote:
 In c++, there is a functio, getch(), which returns the
 variable of the key you pressed - like enter would be
 13.  How could I do this in perl?
 
 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail
 http://personal.mail.yahoo.com/
 
 
-- 
Gabor Szabo
http://www.tracert.com/
Web backend development
Phone: +972-(0)54-624648





Re: multiple threads

2001-07-11 Thread Gabor Szabo



 if a program spawns multiple children, does that mean
 it has multiple threads?  

no, that means is has multiple processes
you'll be able to see them (if you are fast enough :)
by typing 

ps axuw

on the command prompt of your UNIX system

Perl isn't too good at threading

-- Gabor

-- 
Gabor Szabo
http://www.tracert.com/
Web backend development
Phone: +972-(0)54-624648





Re: Errors

2001-07-10 Thread Gabor Szabo


 #1 - tried that and still getting the ISE, so it must be a compiler error
 ... I didn't know all of those tips - that will help me with this problem
 (and w/ future ones, too) - now if I could just find out what the
 compiler
 problem is ... the syntax checks out ... I can't telnet  execute the
 script
 in their environment.

if your script compiles on windows but (probably) not on the UNIX machine
then

1) are you sure you are upload the file as ascii file ? (not binary)

2) maybe you are trying tu use a module that is not on that system
3) try to put __END__ in your script , the compiler will ignore the rest of
the
file so you might be able to see exatly where is the line that causes the
problem

-- Gabor
 

-- 
Gabor Szabo
http://www.tracert.com/
Web backend development
Phone: +972-(0)54-624648





Re: Shifting bits

2001-07-09 Thread Gabor Szabo

you can also type in

perldoc perlop 

and search for bitwise in the file
or you can also search bitwise on

www.perldoc.com

there you can find explanation on how these things work.

-- Gabor

On 2001.07.09 20:26 Camilo Gonzalez wrote:
 Yes,
 
  and 
 
 -Original Message-
 From: Brian Jackson [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 09, 2001 12:26 PM
 To: [EMAIL PROTECTED]
 Subject: Shifting bits
 
 
 Unfortunately I don't have any Perl books available to me at this time
 and I am trying to find the answer to this on the web, but have had no
 luck thus far...does anyone know if there is a shift operator in Perl
 that allow me to shift bits.
 
 



Re: cgi help

2001-07-05 Thread Gabor Szabo

It is most likely the missing first line :

make sure you print this as the first line of the output 
print Content-type: text/html\n\n;
then comes your HTML output

or better yet use the following:

use CGI;
my $q=new CGI;
print $q-header;


read about the CGI module by typing
perldoc CGI on you command line

and check your script by executing it from the command line.

-- Gabor
www.tracert.com


On 2001.06.23 22:58 Michael P. Carel wrote:
 
 Hi there, Is there any one who can help with my problem regarding perl
 cgi's.
 I've encountering problemwith my webpages when i execute my cgi prog,
 heres
 my error messages in my page:
 
 Internal Server Error
 The server encountered an internal error or
 misconfiguration and was unable to complete
 your request.
 Please contact the server administrator,
  root@localhost and inform them of the time the error occurred,
 and anything you might have done that may have
 caused the error.
 More information about this error may be available
 in the server error log.
 
 Please help me.
 
 mike
 
 



Re: Again : Including other files

2001-06-28 Thread Gabor Szabo

Hi Rajeev,

it is the approach of perl4: without modules, 
You can use this but it will be better for you if created a module 
(or modules) from the included file and use that module.
the performance difference is neglectable compared to the runtime of a
script.

see 
perldoc perlmod


-- Gabor


Rajeev Rumale wrote:
 
 Hi,
 
 I have a similar situation in my project.  I have created a file like
 mylib.pl and I put all my subroutines into it.
 
 In every page which I use i just add a line require  mylib.pl  IT works
 fine for me.
 
 I would like to know
 1. if this approch is Good
 2. Is their any performance problem compared to writing the subs directly in
 main.
 3. Is there any better approch.
 
 with regards
 
 Rajeev Rumale

-- 
Gabor Szabo
http://www.tracert.com/
Web backend development
Phone: +972-(0)54-624648