Re: perl / MySql application overview question

2003-08-14 Thread Wiggins d'Anconia
Hughes, Andrew wrote: I have a multi-table MySQL database that holds different pieces of information that will all be displayed on a web page template. The general principle is that non web people will be able to populate web pages through an admin panel. The data in all of the MqSQL tables will

Re: Perl line breaks

2003-08-14 Thread Camilo Gonzalez
Yech, what a mess. I think you may need to escape the question mark and or dots. In any case, why try to escape such an unwieldy string? Why not use a heredoc? Laziness is the mark of a good programmer. Mike Harrison wrote: I was trying to find a log file to look at. I guess half the problem i

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 Windo

Re: Flock and Sleep

2003-08-14 Thread Oliver Schnarchendorf
On Fri, 8 Aug 2003 02:32:05 +0500, Sara wrote: > open(NUMBER,">>data.txt"); > flock (NUMBER, 2); > close (NUMBER); > closing a file automatically removes the lock?? The answer is yes. When you close files they will automatically un-locked. One thing though, you might want to use the fcntl module

Re: Regex and Email address.

2003-08-14 Thread Wiggins d'Anconia
Would be interesting to see which is faster, there is that whole regex engine thing. Of course to say that there are no letters isn't strictly fair because you would need two lines of comments stating what you are doing ;-)... depending on the context... http://danconia.org Hall, Scott wrote:

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 pr

RE: Perl line breaks

2003-08-14 Thread Mike Harrison
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

RE: Urgent Question (Deployed code gone wrong!)

2003-08-14 Thread [EMAIL PROTECTED]
good question. here are some sample scripts which should help... the first one asks, how many elements are in a list if they are all undef #!/usr/local/bin/perl if ( (undef, undef) == 0 ) { print 'it is 0' } run this, and you'll see that it prints 'it is 0'. here's a second one that tests what

perl script as binary

2003-08-14 Thread Sven Bentlage
Hi everyone! I`m looking for a way to "compile" a perl script into an executable binary for a WIN2000 system (no(!) perl installed). Is there a way to get this working? Thanks for your help in advance Sven -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PR

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 th

Re: Urgent Question (Deployed code gone wrong!)

2003-08-14 Thread Greenhalgh David
eBay, Thanks. I learnt something there. Equally, thanks to Bob, nice solution which I also didn't know. Dave -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Why executable?

2003-08-14 Thread fliptop
On Mon, 11 Aug 2003 at 22:36, Octavian Rasnita opined: [snip] OR:I've tried chmodding the perl script to 755, and I've tried running it OR:with: OR: OR:$ script.pl OR: OR:...but it didn't want to run, telling me that there is no command OR:script.pl, even though the script has a shebang line in it

Re: Why executable?

2003-08-14 Thread zentara
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

Re: Regex and Email address.

2003-08-14 Thread Wiggins d'Anconia
Sara wrote: Simple Regex problem How you will convert $email = "[EMAIL PROTECTED]"; TO $email = "[EMAIL PROTECTED]"; using Regex. Well this isn't necessarily a regex issue, TMTOWTDI, my $email = '[EMAIL PROTECTED]'; $email = substr($email, 0, (index($email,'@')+2)); print "Email: $email

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

Re: Selecting using regular expressions

2003-08-14 Thread Wiggins d'Anconia
Octavian Rasnita wrote: 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? Uh, use a module. For example I have the following text: .. .. ... ... As you see, I co

Urgent Question (Deployed code gone wrong!)

2003-08-14 Thread Greenhalgh David
A quick question about a while loop. I have a simple code that searches database for all entries and puts one of the fields into a select box on the output page. However, due to a mistake in my untaint routine (which I've fixed) if a visitor entered their name in Japanese characters, the entry

Re: Why executable?

2003-08-14 Thread Ovid
And as a word of caution, some like to add '.' to their path in order to save typing an extra two letters ('./' in front of the file name). Don't do this, though, as this is a major security hole. Using google to search for 'current directory path linux security hole' for many examples of this

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

RE: perl / MySql application overview question

2003-08-14 Thread Hughes, Andrew
Thanks for the detailed answer. I have dealt with JOIN clauses briefly in the past, but not in this context. I will have to revisit on my own. As far as grabbing the unique id, I am definitely going to use the DBI module for contacting MySQL. When I am looking at your piece of code, I had a few

Installing a module from CPAN

2003-08-14 Thread David Granas
Hi, Im trying to install the Graphics-Simple module from CPAN on ActivePerl but can't seem to get it to work. I ran the PPM install Graphics-Simple which worked ok, but then I tried to run the test program gt1.pl and it gave me an error about not having the Gtk module. I then went to CPAN to

RE: Perl line breaks

2003-08-14 Thread Jonathan Hogue
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 u

Re: Why executable?

2003-08-14 Thread Randal L. Schwartz
> "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 extensi

RE: Regex and Email address.

2003-08-14 Thread Hall, Scott
Regexes are always more fun :) How else can you write a program with almost no letters. $email =~ s/(?<[EMAIL PROTECTED]).*$/.../; perldoc perlre search for 'look-behind' Scott -Original Message- From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 05, 2003 10:36 PM

Re: Perl line breaks

2003-08-14 Thread Jon Hogue
...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 ge

RE: perl script as binary

2003-08-14 Thread Jonathan E. Hogue
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 [ma

RE: Regex and Email address.

2003-08-14 Thread Hall, Scott
Comments?? Who needs comments? My code is 'self-documenting' LOL Scott PS: The regex engine is your friend. -Original Message- From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 8:08 PM To: Hall, Scott Cc: [EMAIL PROTECTED] Subject: Re: Regex and Email

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, an

RE: perl script as binary

2003-08-14 Thread Bob Showalter
Sven Bentlage wrote: > Hi everyone! > > I`m looking for a way to "compile" a perl script into an executable > binary for a WIN2000 system (no(!) perl installed). > > Is there a way to get this working? I use ActiveState's PerlApp for this. It's really very nice. It bundles everything into a sing

RE: Urgent Question (Deployed code gone wrong!)

2003-08-14 Thread Bob Showalter
Greenhalgh David wrote: > A quick question about a while loop. > > I have a simple code that searches database for all entries and puts > one of the fields into a select box on the output page. However, due > to a mistake in my untaint routine (which I've fixed) if a visitor > entered their name i

Re: Why executable?

2003-08-14 Thread Kristofer Hoch
> You should never be able to guess the implementation language by > looking at a URL. Wrong. Wrong. I couldn't agree more. None of my scripts are executed directly...IE there is not script called 'index.pl'. Alternatly, I use HTML::Mason for dynamic web content. The Mason handler calls the s

Re: Why executable?

2003-08-14 Thread Camilo Gonzalez
Okay then, how should scripts be called? Let's say I'm using a form. What would the action be? Kristofer Hoch wrote: You should never be able to guess the implementation language by looking at a URL. Wrong. Wrong. I couldn't agree more. None of my scripts are executed directly...IE there

Re: Why executable?

2003-08-14 Thread Randal L. Schwartz
> "Octavian" == Octavian Rasnita <[EMAIL PROTECTED]> writes: Octavian> Hmm, are you telling that I can create a perl file and name Octavian> it file.html, file.php, or even file.asp, and use a shebang Octavian> line in it, then it will be parsed as a perl file? Octavian> Or I need to use exte

Premature end of script headers Linux with Fat32 filesystem

2003-08-14 Thread Tim Brom
I dual-boot my computer and I have three partitions, an NTFS partition for Windows XP Pro, an ext3 filesystem for Linux (Red Hat Linux 9.0) and a Fat32 filesystem for my data (because FAT32 is the only filesystem both OS's play nicely with). I keep the data that I want shared stored on this FAT

perl / MySql application overview question

2003-08-14 Thread Hughes, Andrew
I have a multi-table MySQL database that holds different pieces of information that will all be displayed on a web page template. The general principle is that non web people will be able to populate web pages through an admin panel. The data in all of the MqSQL tables will be entered by the user

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/

Flock and Sleep

2003-08-14 Thread Sara
(sub get_number { open(NUMBER,">>data.txt"); flock (NUMBER, 2); Do blah blah blah close (NUMBER); closing a file automatically removes the lock?? or should I have to unlock it by placing flock (NUMBER, 8); close (NUMBER); My second question is how I can delay the execution of a script (If two

Regex and Email address.

2003-08-14 Thread Sara
$recipient_email = [EMAIL PROTECTED]; When you send email using yahoo groups, it will show the recpient mail address after sending mail like this... Mail successfully sent to [EMAIL PROTECTED] anybody can help me how to do it? that it will hide the domain except for showing one character after @

Re: Regex and Email address.

2003-08-14 Thread Sara
Simple Regex problem How you will convert $email = "[EMAIL PROTECTED]"; TO $email = "[EMAIL PROTECTED]"; using Regex. Thanks, Sara. - Original Message - From: gregg To: Sara Cc: [EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 6:59 AM Subject: Re: Regex and Ema