Re: [Clarification] input validation and persistency module for (mod_perl) web apps?

2005-10-28 Thread John Doe
John Doe am Donnerstag, 27. Oktober 2005 17.12: [...] > Some of the tasks always to be solved in an interactive webapp: > > a) validate/sanitize user input > b) differentiate between persistent parameter values and "volatile" ones > (the latter meaning a value only used along one request/answer) >

Re: Die without textoutput?

2005-10-28 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > Hi! Hello, > When die is used, there is message something like: > > x doesn't exist as an environment variable > Died at lsh.pl line 510, line 6. > Childprocess complete > > I just want the current process to die without giving any output to > screen, something like

Re: Die without textoutput?

2005-10-28 Thread gustav
> [EMAIL PROTECTED] wrote: >> Hi! > > Hello, > >> When die is used, there is message something like: >> >> x doesn't exist as an environment variable >> Died at lsh.pl line 510, line 6. >> Childprocess complete >> >> I just want the current process to die without giving any output to >> screen, so

How to put brackets in a string given substrings

2005-10-28 Thread Wijaya Edward
Dear Sirs, I have the following problem. I am trying to put the bracket in a string given the set of its substrings. Those bracketed region is "bounded" by the given substrings. Like this, given input "String" and it's "substrings" String 1.CCCATCTGTCCTTATTTGCTG 2.ACCCATCTGTCCTTGGCCAT 3.CCAC

help slurping a file

2005-10-28 Thread Renee Halbrook
Hi, I'm not sure if this is the correct group to post this question to. If there is a better forum for this kind of question, please let me know. I am trying to slurp a file that was written on Mac OSX, using a standard text editor. I am developing on a windows machine, and running my scripts on a

Re: Die without textoutput?

2005-10-28 Thread J.Peng
hi, you can redefined the $SIG{__DIE__} handle to do that. such as: $SIG{__DIE__}=\&yourdie; sub yourdie{ ... die; } > Hi! > > When die is used, there is message something like: > > x doesn't exist as an environment variable > Died at lsh.pl line 510, line 6. > Childprocess complete > > I j

Re: Die without textoutput?

2005-10-28 Thread John Doe
J.Peng am Freitag, 28. Oktober 2005 11.27: > hi, > you can redefined the $SIG{__DIE__} handle to do that. > such as: > > $SIG{__DIE__}=\&yourdie; > sub yourdie{ > ... > die; > } Or, to avoid a second die: chomsky ~/ramsch $ perl -le '$SIG{__DIE__}=sub {exit(1)}; \ die "explore the reason your

about running unix command in perl script

2005-10-28 Thread ZHAO, BING
Hi, Is there a way to run unix command in perl? To be specific, for the ftp command: 1.ftp ftp.rcsb.org 2.cd /pub/pdb/data/structures/divided/pdb/ 3.cd nx 4.get pdb1nxc.ent.Z 5.bye

Re: How to put brackets in a string given substrings

2005-10-28 Thread John W. Krahn
Wijaya Edward wrote: > > I have the following problem. > I am trying to put the bracket in a string given the set of its substrings. > Those bracketed region is "bounded" by the given substrings. > Like this, given input "String" and it's "substrings" > > String > 1.CCCATCTGTCCTTATTTGCTG > 2

about man page

2005-10-28 Thread ZHAO, BING
Hi: what is manpage? Where is it locate in cpan? to be specific, how do I get to cron manpage? thank you all. best -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Die without textoutput?

2005-10-28 Thread Hao Chen
Do you mean that you don't want the line number and file evealed? Llama said, If you don't want the line number and file revealed, make sure that the dying words have a newline on the end. That is, another way you could use die is in a line like this, with a trailing newline: die "Not enough arg

Re: about running unix command in perl script

2005-10-28 Thread John W. Krahn
ZHAO, BING wrote: > Hi, Hello, > Is there a way to run unix command in perl? > To be specific, for the ftp command: > 1.ftp ftp.rcsb.org > 2.cd /pub/pdb/data/structures/divided/pdb/ > 3.cd nx > 4.get pdb1nxc.ent.Z > 5.bye > I need to automate this process to ftp get the file pdb1nxc.ent.Z. perld

Re: about running unix command in perl script

2005-10-28 Thread Dermot Paikkos
Have a look at Net::FTP. It can do all that your asking. I think it's part of the standard distribution. perldoc Net::FTP hth. Dp. On 28 Oct 2005 at 3:37, ZHAO, BING wrote: > Hi, > Is there a way to run unix command in perl? > To be specific, for the ftp command:

Re: about running unix command in perl script

2005-10-28 Thread John Doe
ZHAO, BING am Freitag, 28. Oktober 2005 12.37: > Hi, > Is there a way to run unix command in perl? > To be specific, for the ftp command: > 1.ftp ftp.rcsb.org > 2.cd /pub/pdb/data/structures/divided/pdb/ > 3.cd nx >

Re: help slurping a file

2005-10-28 Thread John W. Krahn
Renee Halbrook wrote: > Hi, Hello, > I'm not sure if this is the correct group to post this question to. If there > is a better forum for this kind of question, please let me know. > > I am trying to slurp a file that was written on Mac OSX, using a standard > text editor. > I am developing on a

RE: about running unix command in perl script

2005-10-28 Thread José Pedro Silva Pinto
Yes Example: system("ftp ftp.rcsb.org ; /pub/pdb/data/structures/divided/pdb/ ; cd nx ; get pdb1nxc.ent.Z "); By José Pinto -Original Message- From: ZHAO, BING [mailto:[EMAIL PROTECTED] Sent: sexta-feira, 28 de Outubro de 2005 11:37 Cc: beginners@perl.org Subject: about running uni

Re: about man page

2005-10-28 Thread John Doe
ZHAO, BING am Freitag, 28. Oktober 2005 12.43: > Hi: > what is manpage? "man page" is an abbreviation of "manual page". They are usually (besides info pages etc.) part of installed software in *NIX environments. Not available on Windoze (I heard it must be especially userfriendly,

Re: about man page

2005-10-28 Thread John W. Krahn
ZHAO, BING wrote: > Hi: Hello, > what is manpage? It is the collection of programs and data files that Unix systems use to store the documentation on the programs and commands that are supplied with the system. On the command line type 'man' followed by the name of the command to get informatio

Re: Die without textoutput?

2005-10-28 Thread John W. Krahn
[EMAIL PROTECTED] wrote: >>[EMAIL PROTECTED] wrote: >> >>>When die is used, there is message something like: >>> >>>x doesn't exist as an environment variable >>>Died at lsh.pl line 510, line 6. >>>Childprocess complete >>> >>>I just want the current process to die without giving any output to >>>

search and replace in html text

2005-10-28 Thread Matthias Leopold
hi i want to search for a pattern in html text and replace only those occurences that are not enclosed inside <> (html tag, not perl operator). i was thinking of something like $string =~ s/$pattern/test for <> or similar; else replace/ge; another way could be splitting $string into an array,

Re: about running unix command in perl script

2005-10-28 Thread Dan Klose
On Fri, 2005-10-28 at 03:37 -0700, ZHAO, BING wrote: > Hi, > Is there a way to run unix command in perl? > To be specific, for the ftp command: > 1.ftp ftp.rcsb.org > 2.cd /pub/pdb/data/structures/divided/pdb/ > 3.cd

Re: search and replace in html text

2005-10-28 Thread Jeff 'japhy' Pinyan
On Oct 28, Matthias Leopold said: i want to search for a pattern in html text and replace only those occurences that are not enclosed inside <> (html tag, not perl operator). It's easiest to use a real HTML parser. Otherwise, you'll probably get false positives and what-not. $string =~ s/

Re: help slurping a file-- Solved -- Thanks for responses

2005-10-28 Thread Renee Halbrook
Hi, Thanks for responding to my email. It looks like I had a typo in my explanation of the slurping problem. Thanks for catching that. Actually, I had the correct input field separator in my code, and simply miswrote it in my explanation. The perldoc is always a good place to start. I was using th

Re: help slurping a file-- Solved -- Thanks for responses

2005-10-28 Thread Jeff 'japhy' Pinyan
On Oct 28, Renee Halbrook said: My perl interpreter display does not recognize "\r" for a newline character for standard out, so it simply printed the same line over on top of the previous line, making it look like it was only reading one line total. The slurping was working fine, but the displa

Re: help slurping a file-- Solved -- Thanks for responses

2005-10-28 Thread Xavier Noria
On Oct 28, 2005, at 15:09, Jeff 'japhy' Pinyan wrote: On Oct 28, Renee Halbrook said: My perl interpreter display does not recognize "\r" for a newline character for standard out, so it simply printed the same line over on top of the previous line, making it look like it was only reading o

Re: help slurping a file-- Solved -- Thanks for responses

2005-10-28 Thread Renee Halbrook
> In Mac OS X the newline is \012 and that is what "\n" is eq to. I was > told in MacPerl (for MacOS pre X) the underlying codes of \n and \r > were switched (wrt to the rest of platforms), but still \n is the > logical newline everywhere. --The specs the file was created from: Filemaker versi

finding the first non digit character in a string

2005-10-28 Thread Bowen, Bruce
I see where you can test for a match in a string of data using the If ( ) statement, but can you use it with an 'index' statement? The data may look like this: $DD = "5000|SIHHTEXT" I've tried $d = index($DD, m/[^\d]/); $d = index($DD, /[^\d]/); $d = index($DD, [^\d]); n

Re: help slurping a file-- Solved -- Thanks for responses

2005-10-28 Thread Xavier Noria
On Oct 28, 2005, at 15:29, Renee Halbrook wrote: In Mac OS X the newline is \012 and that is what "\n" is eq to. I was told in MacPerl (for MacOS pre X) the underlying codes of \n and \r were switched (wrt to the rest of platforms), but still \n is the logical newline everywhere. --The specs

Re: finding the first non digit character in a string

2005-10-28 Thread Adriano Ferreira
On 10/28/05, Bowen, Bruce <[EMAIL PROTECTED]> wrote: > The data may look like this: > $DD = "5000|SIHHTEXT" > I've tried $d = index($DD, m/[^\d]/); > $d = index($DD, /[^\d]/); > $d = index($DD, [^\d]); C doesn't work with regexes. But you can use C $ perl -e '$DD = "5000|

Re: finding the first non digit character in a string

2005-10-28 Thread Jeff 'japhy' Pinyan
On Oct 28, Bowen, Bruce said: I see where you can test for a match in a string of data using the If ( ) statement, but can you use it with an 'index' statement? The index() function is for finding a string in another string. Patterns (regexes) are not allowed. $DD = "5000|SIHHTEXT" I've

Re: Is this script safe?

2005-10-28 Thread Jay Savage
On 10/27/05, John W. Krahn <[EMAIL PROTECTED]> wrote: > Dermot Paikkos wrote: > > Hi, > > > > I wanted a script that would rename files from lower to upper case. I > > have something but I am a bit worried about going live with it as I > > can imagine there is plenty of room for error and I really

Re: help slurping a file

2005-10-28 Thread JupiterHost.Net
Hello, My question is, why can't I slurp in the entire file? Because you're fiddling with things that ought not be fiddled with ;p (IE $\) instead: use File::Slurp; my @lines = read_file($file); or you can use Perl 6's slurp() via a Perl6 module (perl6::Slurp maybe ???) see cpan for det

Re: Is this script safe?

2005-10-28 Thread John Doe
Jay Savage am Freitag, 28. Oktober 2005 16.05: [...] > But none of the advice here has untainted $name. From my answer: >This will find files and paths containing a lower character. >You probably meant > >if ($name =~/^[a-z]+$/) { > >respectively, since -T expects untainting by a catche

Re: help slurping a file

2005-10-28 Thread Xavier Noria
On Oct 28, 2005, at 16:16, JupiterHost.Net wrote: Hello, My question is, why can't I slurp in the entire file? Because you're fiddling with things that ought not be fiddled with ;p (IE $\) instead: use File::Slurp; my @lines = read_file($file); Wrong, that code assumes $file has th

Re: How to put brackets in a string given substrings

2005-10-28 Thread Edward WIJAYA
Dear John, Thanks so much for your life saving response. There are one minor issue I still couldn't solve. It is the fact that when the bounded region marked by the array may occur more than once. (See example no. 7 and 8 in my code below) To disambiguate the situation, I can give the array tha

Re: Is this script safe?

2005-10-28 Thread Dermot Paikkos
On 28 Oct 2005 at 10:05, Jay Savage wrote: > On 10/27/05, John W. Krahn <[EMAIL PROTECTED]> wrote: > > Dermot Paikkos wrote: > > > Hi, > > > > > > I wanted a script that would rename files from lower to upper case. I > > > have something but I am a bit worried about going live with it as I > > > c

Re: Is this script safe?

2005-10-28 Thread Jay Savage
On 10/28/05, Dermot Paikkos <[EMAIL PROTECTED]> wrote: > > === Here what I have now == > #!/usr/bin/perl -Tw > # upper.pl > > # Upper case all lowercase file in a given directory. > > > use File::Copy; > use strict; > > my $dir = shift; > my $found = 0; You also need to untaint $d

Input Example Errata -- How to put brackets ....

2005-10-28 Thread Edward WIJAYA
Dear John, Just small correction in the input sample. my @ar5 = qw(GTATG-4 TGGGT-1); should be this: my @ar5 = qw(GTATG-4 TGGGT-7); In short they are already ordered. -- Regards, Edward WIJAYA SINGAPORE -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PR

Re: Is this script safe?

2005-10-28 Thread Jay Savage
On 10/28/05, John Doe <[EMAIL PROTECTED]> wrote: > Jay Savage am Freitag, 28. Oktober 2005 16.05: > [...] > > But none of the advice here has untainted $name. > > From my answer: > > >This will find files and paths containing a lower character. > >You probably meant > > > >if ($name =~/^[a-

Re: help slurping a file

2005-10-28 Thread JupiterHost.Net
Xavier Noria wrote: use File::Slurp; my @lines = read_file($file); Wrong, that code assumes $file has the runtime platform conventions, which is not the case. OK sorry, sheesh... missed the part about it being a screwy file. Can you change the crewy line ending to a normal one then us

grep help request

2005-10-28 Thread David Gilden
Hello, I am stuck with this issue. How do get each substring (the names in this case) and then upper case them. This does not work just yet Possible data: mike smith john h. hamilton g. bush hendric etc.. #!/usr/bin/perl $SendersName = " dave middlename gilden "; $SendersName =~

problem using a module

2005-10-28 Thread jm
i'm modifying a script to run on a sun box that i do not have privileges to install modules in the normal perl paths. subsequently i installed DBI.pm into a modules subdir under my home dir. below are the 2 relevant lines: use lib "$ENV{HOME}/modules/DBI"; our $mysql_dbh = DBI->connect("DBI:my

Re: problem using a module

2005-10-28 Thread Wiggins d'Anconia
jm wrote: > i'm modifying a script to run on a sun box that i do not have > privileges to install modules in the normal perl paths. subsequently > i installed DBI.pm into a modules subdir under my home dir. below are > the 2 relevant lines: > > > use lib "$ENV{HOME}/modules/DBI"; > > our $mysq

Re: grep help request

2005-10-28 Thread Jay Savage
On 10/28/05, David Gilden <[EMAIL PROTECTED]> wrote: > Hello, > > I am stuck with this issue. > How do get each substring (the names in this case) and then upper case them. > This does not work just yet > > Possible data: > mike smith > john h. hamilton > g. bush > hendric > > etc.. >

Re: problem using a module

2005-10-28 Thread Xavier Noria
On Oct 28, 2005, at 21:28, jm wrote: i'm modifying a script to run on a sun box that i do not have privileges to install modules in the normal perl paths. subsequently i installed DBI.pm into a modules subdir under my home dir. below are the 2 relevant lines: use lib "$ENV{HOME}/modules/DBI"

Re: problem using a module

2005-10-28 Thread jm
On 10/28/05, Wiggins d'Anconia <[EMAIL PROTECTED]> wrote: > > That seems like a very odd error. One thing I do notice is that you are > including "DBI" in the path to 'use lib'. This would have to mean that > the DBI module lives in "$ENV{HOME}/modules/DBI/DBI.pm". Is that the > case? Or should yo

Re: problem using a module

2005-10-28 Thread Wiggins d'Anconia
jm wrote: > On 10/28/05, Wiggins d'Anconia <[EMAIL PROTECTED]> wrote: > > >>That seems like a very odd error. One thing I do notice is that you are >>including "DBI" in the path to 'use lib'. This would have to mean that >>the DBI module lives in "$ENV{HOME}/modules/DBI/DBI.pm". Is that the >>cas

Re: problem using a module

2005-10-28 Thread jm
> > Yep. Your best bet is to use CPAN to install the module. One of its > configuration parameters will allow you to specify a prefix of where to > install modules, specifically 'makepl_arg'. > > Check the archives of this list or google for further information. How > to install modules into a non-

Re: problem using a module

2005-10-28 Thread Xavier Noria
On Oct 28, 2005, at 21:59, jm wrote: On 10/28/05, Wiggins d'Anconia <[EMAIL PROTECTED]> wrote: That seems like a very odd error. One thing I do notice is that you are including "DBI" in the path to 'use lib'. This would have to mean that the DBI module lives in "$ENV{HOME}/modules/DBI/D

Re: How to put brackets in a string given substrings

2005-10-28 Thread John W. Krahn
Edward WIJAYA wrote: > Dear John, > > Thanks so much for your life saving response. > There are one minor issue I still couldn't solve. > > It is the fact that when the bounded region marked > by the array may occur more than once. > (See example no. 7 and 8 in my code below) > > To disambiguate

Re: grep help request

2005-10-28 Thread John Doe
David Gilden am Freitag, 28. Oktober 2005 20.55: > Hello, > > I am stuck with this issue. > How do get each substring (the names in this case) and then upper case > them. This does not work just yet > > Possible data: > mike smith > john h. hamilton > g. bush > hendric > > etc.. > > >

Dir Command to an array

2005-10-28 Thread andrewmchorney
Hello I would like to execute a dir */s command in windows and save the output into an array. I know I can do this in perl by doing executing the following command in a perl script: @allfiles = `find / -print`; How can do this in windows: Thanks, Andrew -- To unsubscribe, e-mail: [EMAIL PR

RE: Dir Command to an array

2005-10-28 Thread Timothy Johnson
The dir command has a /b switch that can be used to get just the filenames which can be useful for this kind of thing. If you literally just want an array with the result, then my @allfiles = `dir * /s`; should do the trick. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PR

Re: Dir Command to an array

2005-10-28 Thread Chris Devers
On Fri, 28 Oct 2005 [EMAIL PROTECTED] wrote: > I would like to execute a dir */s command in windows and save the > output into an array. I know I can do this in perl by doing executing > the following command in a perl script: > > @allfiles = `find / -print`; You can, but you shouldn't. The

Re: grep help request -- data fields max size

2005-10-28 Thread David Gilden
Thanks Jay, For your recommendation, is there a way I can limit the size, something like: [\w\.-]{1,50} or should I do that I bring in the data for first time? Have a great weekend! Dave Ft. Worth, Tx [ www.coraconnection.com ] > It's going to be a whole lot easier, and probably just as fast

Perl/sh/bash scripts and emacs

2005-10-28 Thread Marilyn Sander
Not sure how much of a beginner question this is. I've been searching mail archives and can't find anything about it. I've embarrassed myself by giving advice based on my reading of the Camel book, but the advice doesn't work. In the "Camel" book "Programming Perl", Chapter 19 is a chapter on u