Need basic commands on perl programming
Good day: What are the basic comands in creating a perl programs, do i have to do it in a text editor or in a /usr/bin directory where perl is installed. I have a perl here with Version 5.6.0 and can you give me a simple program for just a guide?.. Thank you and more power. reggy __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need basic commands on perl programming
You will find a good tutorial for the first steps in CGI-programming in Perl at http://www.lies.com/begperl/ Cheers Stephan -- Dipl.-Chem. Stephan Tinnemeyer Lindenallee 20 24105 Kiel Germany -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need basic commands on perl programming
Reggy, The first line is #!/usr/local/bin/perl. You can add -w = warning or -T = taint (#!/usr/local/bin/perl -w) Then you can add 'use strict'. Jerry reggy patagan wrote: Good day: What are the basic comands in creating a perl programs, do i have to do it in a text editor or in a /usr/bin directory where perl is installed. I have a perl here with Version 5.6.0 and can you give me a simple program for just a guide?.. Thank you and more power. reggy __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.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: Re: Need basic commands on perl programming
Not the best stuff in the world but it will get you started with a lot of the basics. Forms, directories, cookies. Stuff like that. GoTo: http://cgi.resourceindex.com/Documentation/ GL, Mark Bergeron -Original Message- From: Jerry Preston[EMAIL PROTECTED] To: reggy patagan[EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Date: Fri Dec 07 04:06:47 PST 2001 Subject: Re: Need basic commands on perl programming Reggy, The first line is #!/usr/local/bin/perl. You can add -w = warning or -T = taint (#!/usr/local/bin/perl -w) Then you can add 'use strict'. Jerry reggy patagan wrote: Good day: What are the basic comands in creating a perl programs, do i have to do it in a text editor or in a /usr/bin directory where perl is installed. I have a perl here with Version 5.6.0 and can you give me a simple program for just a guide?.. Thank you and more power. reggy __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.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] ___ GO.com Mail Get Your Free, Private E-mail at http://mail.go.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using custom modules
On Friday 07 December 2001 12:49, fliptop wrote: Gerry Jones wrote: I want to use a module I have created and stored in cgi-bin directory. It holds a few commonly used functions. I remember having done this before, but can't remember how I got it to work, and my error log says the module did not return a true value. Somebody please save me from wading through all the documentation. make sure your module returns a true value. for example: package Foo; use strict; use SomeOtherModule; sub bar { ...some code here... } sub baz { ...more code... } 1;# all modules should return true __END__ sound of hand smacking forhead Thanks ;-) Gerry. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Perl shopping cart with MySQL and Cookie
I am seeking for Perl shopping cart script which is use Mysql and cookie. Simple one. And MySQL must not have many tables. I really need it. Best Regards, Sodoo, __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: graphic manipulation program
www.imagemagick.org Just read the first paragraph on the home page; it's exactly what I need. Thank-you very much! :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: graphic manipulation program
On Fri, 7 Dec 2001, Carl Franks wrote: Could someone advise me on a program to use. I want to use a command-line program to resize .jpegs, and specify compression. I've not found anything suitable so far. The GD module looks promising, but I can't find useful documentation for it. Check out ImageMagick! I think there is also a module for the Gimp, so you can write Perl-Fu scripts. -- Brett -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
From html to Perl back to html
Hello, I know this is probably a really newbie question. But then again I am really a newbie. I am trying to make a form where user input gets output back to another html form. My script is not erroring out so my log files is clean. But I am missing something in my script and have looked for the answers through google but I must be typeing in the wrong search words. here is a copy of my form on the html page. form action=/cgi-bin/hello.pl method=get blockquotebTitle of site:/binput name=title type=text/blockquote input type=Submit name=Submit value=Submitinput type=reset /form here is the script I'm sending it to : #!/usr/bin/perl print Content-type: text/html\n\n; print html\n; print body bgcolor=\blue\ text=\white\\n; print centerh1; print \$FORM{'$title'}\; print /h1/center\n; print /body\n/html\n; and here is the output I'm getting : html body bgcolor=blue text=white centerh1/h1/center /body /html Any ideas where I'm going wrong ? I am not afraid to RTFM if I knew where TFM was :-) Thanks, Mark -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: From html to Perl back to html
Mark Jervis Sr. wrote: I am trying to make a form where user input gets output back to another html form. My script is not erroring out so my log files is clean. But I am missing something in my script and have looked for the answers through google but I must be typeing in the wrong search words. here is a copy of my form on the html page. form action=/cgi-bin/hello.pl method=get blockquotebTitle of site:/binput name=title type=text/blockquote input type=Submit name=Submit value=Submitinput type=reset /form here is the script I'm sending it to : #!/usr/bin/perl print Content-type: text/html\n\n; print html\n; print body bgcolor=\blue\ text=\white\\n; print centerh1; print \$FORM{'$title'}\; print /h1/center\n; print /body\n/html\n; and here is the output I'm getting : you need to read in and parse the query string. try reading perldoc CGI -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl shopping cart with MySQL and Cookie
Just in case you were wondering why you are not getting many/any responses to your inquiry. This is a list for people LEARNING how to write CGI programs. If you have a specific question, you will normally get many answers. However, you are looking for a complete solution. You may want to try searching on Google or look at www.cgi-resources.com for the script that you seek. Have a great day! Brent Sodbayar BadarchTo: [EMAIL PROTECTED] fallen_mongol@cc: yahoo.com Subject: Perl shopping cart with MySQL and Cookie 12/07/01 07:54 AM I am seeking for Perl shopping cart script which is use Mysql and cookie. Simple one. And MySQL must not have many tables. I really need it. Best Regards, Sodoo, __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.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: Need basic commands on perl programming
I personally really like this site as well http://www.cgi101.com/class/ It does a great job getting you set up and going. Have fun Jeremy [EMAIL PROTECTED] On Friday 07 December 2001 07:06 am, you wrote: Reggy, The first line is #!/usr/local/bin/perl. You can add -w = warning or -T = taint (#!/usr/local/bin/perl -w) Then you can add 'use strict'. Jerry reggy patagan wrote: Good day: What are the basic comands in creating a perl programs, do i have to do it in a text editor or in a /usr/bin directory where perl is installed. I have a perl here with Version 5.6.0 and can you give me a simple program for just a guide?.. Thank you and more power. reggy __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.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: Need basic commands on perl programming
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Reggy Patagan) wrote: Good day: What are the basic comands in creating a perl programs, do i have to do it in a text editor or in a /usr/bin directory where perl is installed. I have a perl here with Version 5.6.0 and can you give me a simple program for just a guide?.. Thank you and more power. I see that people gave you some answers already so I'll just toss out another suggestion: the documentation for CGI.pm is at http://stein.cshl.org/WWW/CGI/ and there are plenty of example scripts there as well. print pack H*, 4a75737420416e6f74686572204d61635065726c204861636b65722c0d; -- Scott R. Godin| e-mail : [EMAIL PROTECTED] Laughing Dragon Services |web : http://www.webdragon.net/ It is not necessary to cc: me via e-mail unless you mean to speak off-group. I read these via nntp.perl.org, so as to get the stuff OUT of my mailbox. :-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Next 10 Results Help Needed
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Randal L. Schwartz) wrote: One of my very first WT columns... http://www.stonehenge.com/merlyn/WebTechniques/col02.html .. too bad I've already written my *last* WT column, to appear in Feb 2002, because the magazine is terminating. :( Cheers Randal, :-) Sorry to hear about that, but I did have one question... is anything stopping you from continuing the series writing them on your own and posting them to your website other than the financial incentive? :) print pack H*, 4a75737420416e6f74686572204d61635065726c204861636b65722c0d; -- Scott R. Godin| e-mail : [EMAIL PROTECTED] Laughing Dragon Services |web : http://www.webdragon.net/ It is not necessary to cc: me via e-mail unless you mean to speak off-group. I read these via nntp.perl.org, so as to get the stuff OUT of my mailbox. :-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Need to use #
In my code I need to use the number symbol # I know this is a symbol to use for commenting out code is there a work around so that I can use this symbol in a certain part of my code without the program ignoring everything after it? Thanks, Mark -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Here is how I am trying to use the #
This is the block of code giving me errors when I am trying to use the # I am also getting an error saying missing right bracket. This is the only if statement in my code so maybe this will help those of you who tried to help see the problem. if($textcolor eq custom) { print text=\/#$txtcustom\; { else { print text=\$textcolor\; } Thanks, Mark BTW Kudos on having a great learning tool such as this forum. I have a lot more code and a lot less questions due to this forum. :-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Here is how I am trying to use the #
-Original Message- From: Mark Jervis Sr. [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 4:35 PM To: [EMAIL PROTECTED] Subject: Here is how I am trying to use the # This is the block of code giving me errors when I am trying to use the # I am also getting an error saying missing right bracket. This is the only if statement in my code so maybe this will help those of you who tried to help see the problem. if($textcolor eq custom) { print text=\/#$txtcustom\; { This left brace should be a right brace. That's your problem. The hash mark is fine, since it's in quotes. else { print text=\$textcolor\; } Additional comments: In the line if($textcolor eq custom) What is custom? Is that a function or a string? If a function, write custom(), if a string, quote it like 'custom'. You should always add the line use strict; to catch this kind of thing. With this line: print text=\/#$txtcustom\; You can avoid escaping the quotes by using the qq() quoting mechanism, a la: print qq[ text=/#$txtcustom]; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Fwd: RE: Passing variables
Ron, I think you meant to send this to the list, too :) I don't know ksh, so I am terribly familiar with what's going on there, but it doesn't look terribly difficult. I still don't know if you need anything returned to the user. If you don't and these programs don't take long to run, you could use the multiple argument form of system. system( $program, $client, $stagger, $start ); If you need the return data, you could use backticks. You state that you verify the input, I would just caution you that this is *very* dangerous. I'm sure there are other ways to do this, but you're heading into administrative territory and that's not my strong suit. Someone else on the list is probably better prepared to answer this. Cheers, Curtis --- Yacketta, Ronald [EMAIL PROTECTED] wrote: Date: Fri, 07 Dec 2001 18:18:54 -0500 From: Yacketta, Ronald [EMAIL PROTECTED] Subject: RE: Passing variables To: [EMAIL PROTECTED] I am collecting information from the enduser (tester) to run a System Load test. The user will enter the # of clients to run, the client # to start at, the stagger time, sleep time, Engine server and the Diag script sleep time. The info inputted will be verified and one of 4 scripts will be called. all_fastatart all_sleepystart mixed_faststart mixed_sleepystart The all scripts have a single test within it that requires the # clients, client start number, stagger time and sleep time. The mixed script has 7 tests that require the same info as the all, BUT each test will have its own set of client #, client start # , stagger time and sleep time. here is an example of the old .ksh I am converting #!/usr/bin/ksh if [ $# != 2 ] then echo You must supply a run # and Engine hostname on the command line... echo echo i.e. $0 1 wb0300ux137 echo Valid Engine servers are: echo 4500 NodeB (wb0300ux137) echo 3500 NodeB (mc0300ux219) echo exit 255 fi RunNumber=$1 ENGHost=$2 set -x cd /apps/VQXengine/trg/ltt/scripts ClientDiag.pl $1 60 sleep 120 cd ../beta_scripts nohup run_ACF2_VQ $ENGHost all_VALUTEST_wValidate_D40.scr 1500 1 120 1 21 sleep 15 nohup run_ACF2_VQ $ENGHost PActive_0299.scr 25 1501 200 175 21 sleep 15 nohup run_ACF2_VQ $ENGHost PActive_0005.scr 55 1526 200 80 21 sleep 10 nohup run_ACF2_VQ $ENGHost IMP1_1_143.scr 25 1581 175 160 21 sleep 10 nohup run_ACF2_VQ $ENGHost IMP1_5.scr 25 1606 45 150 21 sleep 10 nohup run_ACF2_VQ $ENGHost IMP1_14.scr 40 1631 75 150 21 sleep 6 nohup run_ACF2_VQ $ENGHost Valid01Unit_wTradeIn.scr 35 1671 250 100 21 set +x in line above (run_ACF2_VQ $ENGHost all_VALUTEST_wValidate_D40.scr 1500 1 120 1) $ENGHOST needs to be supplied by the tester, as well as the 4 numeric values after the test (all_VALUTEST_wValidate_D40.scr) these values are not static, they change from test to test... -Ron = Senior Programmer Onsite! Technology (http://www.onsitetech.com/) Ovid on http://www.perlmonks.org/ __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Oops! Re: Fwd: RE: Passing variables
Please ignore. Sent to wrong list and this is my apology :) --- Curtis Poe [EMAIL PROTECTED] wrote: Ron, I think you meant to send this to the list, too :) I don't know ksh, so I am terribly familiar with what's going on there, but it doesn't look terribly difficult. I still don't know if you need anything returned to the user. If you don't and these programs don't take long to run, you could use the multiple argument form of system. system( $program, $client, $stagger, $start ); If you need the return data, you could use backticks. You state that you verify the input, I would just caution you that this is *very* dangerous. I'm sure there are other ways to do this, but you're heading into administrative territory and that's not my strong suit. Someone else on the list is probably better prepared to answer this. Cheers, Curtis = Senior Programmer Onsite! Technology (http://www.onsitetech.com/) Ovid on http://www.perlmonks.org/ __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
almost there
body bgcolor=Blue text=custom link=White alink=White vlink=White Ok here is what it is returning. I fixed the code to this: if($textcolor eq custom) { print text=\$textcolor\; } else{ print text=\$txtcustom\; } when textcolor equals custom thats what it's returning rather than reading the else statement. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: almost there
Mark, It's not clear to me what you're wanting to do from your posting. One comment though if you don't mind... you can avoid the backslash character and in this case make the code more legible by using Perl's 'custom quotes' feature. For example, text=\$textcolor\ can be rewritten as qq| text=$textcolor| The way it works is that by saying 'qq' plus a character, you acheive the same effect as using double quotes. Using 'q' plus a character works just like single quotes, i.e. uninterpreted character string. The character you chose to follow the 'qq' is up to you and you only need to be sure to delimit both ends of the string with that character. There's an exception if you decide to use parens or square or curly brackets or angle brackets then the start and end delimiters must be the start and end of these... which might be clear as mud so I'll give an example: qq( text=$textcolor) Marty At 06:56 PM 12/7/01 -0500, Mark Jervis Sr. wrote: body bgcolor=Blue text=custom link=White alink=White vlink=White Ok here is what it is returning. I fixed the code to this: if($textcolor eq custom) { print text=\$textcolor\; } else{ print text=\$txtcustom\; } when textcolor equals custom thats what it's returning rather than reading the else statement. Website Creation Made SIMPL(tm) http://face2interface.com/Home/Demo.shtml WebSafe Color Picker -- http://face2interface.com/Websafe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: almost there
I need to have perl return a # some how I am having my code write to a webpage. In the webpage I need to be able to change colors of the page and text. While yes it is possible and it is working to use default names of colors such as white, red, blue ect. I would also like the code to be able to use custom colors such as #BE9292. Howver the code is doing strange things when it either has to write # from what I enter on the web page because then it writes it as %23BE9292 or if I call it from the perl script and only enter BE9292 as a color then the script stops there and gets caught in a loop because to perl # is for comments.. I am looking for the work around so that perl will know I am trying to use and return the # as part of my code rather than as a comment indicator. Thanks, Mark At 07:17 PM 12/7/01 -0500, you wrote: Mark, It's not clear to me what you're wanting to do from your posting. One comment though if you don't mind... you can avoid the backslash character and in this case make the code more legible by using Perl's 'custom quotes' feature. For example, text=\$textcolor\ can be rewritten as qq| text=$textcolor| The way it works is that by saying 'qq' plus a character, you acheive the same effect as using double quotes. Using 'q' plus a character works just like single quotes, i.e. uninterpreted character string. The character you chose to follow the 'qq' is up to you and you only need to be sure to delimit both ends of the string with that character. There's an exception if you decide to use parens or square or curly brackets or angle brackets then the start and end delimiters must be the start and end of these... which might be clear as mud so I'll give an example: qq( text=$textcolor) Marty At 06:56 PM 12/7/01 -0500, Mark Jervis Sr. wrote: body bgcolor=Blue text=custom link=White alink=White vlink=White Ok here is what it is returning. I fixed the code to this: if($textcolor eq custom) { print text=\$textcolor\; } else{ print text=\$txtcustom\; } when textcolor equals custom thats what it's returning rather than reading the else statement. Website Creation Made SIMPL(tm) http://face2interface.com/Home/Demo.shtml WebSafe Color Picker -- http://face2interface.com/Websafe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: almost there
At 07:48 PM 12/7/01 -0500, you wrote: At 07:25 PM 12/7/01 -0500, Mark Jervis Sr. wrote: I am having my code write to a webpage. In the webpage I need to be able to change colors of the page and text. After you determine the colors, why not just code print qq|body bgcolor=#$bgcolor text=#$text|; Because the code is using either default settings of bgcolor=white (which is not my preference but something the Boss(aka old lady) wants me to do because she can't understand hex colors) or it is using hex numbers of bgcolor=#BE9292 which is her favorite color therefore she doesn't care she just knows #BE9292 is her favorite web color. I would also like the code to be able to use custom colors such as #BE9292. I wouldn't use that color code in particular, see my websafe color faq at http://face2interface.com/MYD/Developer_Tips/WebSafe_Colors.shtml for the reasons why this might be a bad idea. Specifying colors with their hex code though is totally cool. I understand web safe colors. However this program is being run on an in house server and on all local machines. All the machines can see 16 million colors so for this program this is an acceptable way of doing it. :-) But thanks anyways and I did bookmark that page looks like a great tool for me to use in the future. :-) Howver the code is doing strange things when it either has to write # from what I enter on the web page because then it writes it as %23BE9292 That's because you are getting the raw input where special characters are represented by an ASCII transliteration of their hex codes. Sorry if that's a mouthful, but the short answer may be to check out the input fetching code examples on http://thecgibin.com/quickcode/getInput.shtml. or if I call it from the perl script and only enter BE9292 as a color then the script stops there and gets caught in a loop because to perl # is for comments.. Hmm, I'd like to the see the specific code Mark. I generally don't run into problems with Perl mistaking a '#' comment delimiter with a '#' being used in a character string or other part of the code. I mean it can happen, but if you post your code maybe we can figure out what will work. My problem was I wasn't working my code out on paper first. I had to go back to basics and write down in order what I wanted the code to do. This taught me a valueable lesson on always writing out the code on paper first before trying to code it. Yes this step is a time consumer but I found out today it could have been a time saver. Hopefully others will read this and learn what I learned today also. :-) Thanks for the help though Marty :-) Your way of doing the quotes is going to be a time saver for me in the future. :-) Your webpage is terrific as a source of knowledge also. :-) Thanks, Mark Marty Website Creation Made SIMPL(tm) http://face2interface.com/Home/Demo.shtml WebSafe Color Picker -- http://face2interface.com/Websafe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Explanation of what I was doing wrong
I am writing what I did wrong so others can see and learn. here is my code I sent out earlier. As you can see from the code I had it backwards. If custom was chosen on the web page I wanted it to use a custom color by way of hex code. However my code tells the program if custom is chosen use $textcolor which is returning the word custom therefore making my text tag in my body tag look like: body text=custom Instead of body text=#BE9292 if($textcolor eq custom) { print text=\$textcolor\; } else{ print text=\$txtcustom\; } The correct code is as follows: if($textcolor eq custom) { print text=\$txtcustom\; } else{ print text=\$textcolor\; } I didn't find this until I worked it out step by step on paper. --- I was taught this by a guru. I should have listened. LOL. But Thanks for the help anyways guys and gals:-) Mark -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: generating an xml file
At 00:24 08/12/01, you wrote: the permissions on the XML file are set as -rw -rw -r-- and it's owned by root The perl script is owned by root When it's being run from a Web page, it's (probably) being run by the 'httpd' user, so you might need to alter your permissions to allow that user to write the target file. best, Mo Mo Holkar Undying King Games [EMAIL PROTECTED] http://www.ukg.co.uk -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: perl script to remove control M's
Since emacs is being used why not using emacs' buildin serep function? Macro: M- ;; beginning-of-buffer M-% ;; query-replace C-q ;; quoted-insert C-m ;; newline 2*RET ;; newline ! ;; self-insert-command Stefan -Original Message- From: _brian_d_foy [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 5:46 PM To: [EMAIL PROTECTED] Subject: Re: perl script to remove control M's In article OFC37CFF55.39E829E6-ON86256B1A.004E73D7@com, [EMAIL PROTECTED] (Brent Michalski) wrote: I always like to simply use: perl -pi -e 's/\r//' filename(s) you have to be careful with that though because it's not portable. \r means different things to different OSes :) perl -pi -e 's/\cM//' filename(s) -- brian d foy [EMAIL PROTECTED] - Perl services for hire CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
stripping out non-numbers
what would the regex be for stripping out non-numeric characters from a string? I am trying to format phone numers in a standard way, so i want to strip out all the extras people enter like . - ( ) [space] any help appreciated! thanks, rory -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Socketpair problem!
hello there, I'm having some trouble using the socketpair. In the program attached, the STDIN, STDOUT, and STDERR of the child process has been redirected. The child process is running a copy of some interactive program (the parent process is suppose to read the prompt form the child process and disply it in the STDOUT). When I run it, nothing appeared, it seems the whole process is blocked for some reason. Why? I also have another question. Is it possible to output to a binary file? If writing to a binary file is possible, how do you read from the file? Thanks in advance for your time and help. Virginia calcInput.pl Description: Perl program -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: stripping out non-numbers
$var =~ s/[^0-9]//g; -Original Message- From: rory o'connor To: perl Sent: 12/6/2001 7:15 PM Subject: stripping out non-numbers what would the regex be for stripping out non-numeric characters from a string? I am trying to format phone numers in a standard way, so i want to strip out all the extras people enter like . - ( ) [space] any help appreciated! thanks, rory -- 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]
how to automatically put 'membernames' in the msg posted.
Could members here provide me with some lead with regards to the following :- I've seen many homepages that requires 'members' to login with their password and membername, they could then browse the pages at their own sweet time (browse here, there and everywhere), but when they post a msg, their 'membernames' automatically appears in their post. This is to prevent imposters. How could this be done. Thanks _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Working with Perl Modules
Do you have Active State's perl? The package is available using PPM from their repository, and shouldn't need any compilation. -Original Message- From: Sharat Hegde [mailto:[EMAIL PROTECTED]] Sent: 07 December 2001 06:45 To: [EMAIL PROTECTED] Subject: Working with Perl Modules Hello, I have been using Perl for some time but have not yet used the Perl modules. I wanted to start off with the HTML::Template module - it will save me a lot of effort if I can use it. I need to get this working on Windows (where I do my development) as well as on my 3rd party shared host (where I do not have control over directories in my domain). I have downloaded the template files to my Windows desktop but I am unable to make the module. I do not have a C compiler or the make utility. I downloaded the GNU make, but I think I will need to compile this with a C compiler which I do not have (-: So the question is: how do I get the Perl module running on my Windows desktop as well as on the 3rd party shared host. Thanks in advance. With Regards, Sharat _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- 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:Write to a file problem
HI, I have a file which ends by: host clin09 {hardware ethernet 00:80:9F:2E:3F:5E; filename /bootp/linux/pre3.1/alize/startup.txt;} } I have a perl tk application where a user types a MAc Adress in an entry the variable is $_Globals{MAC_ADDRESS} . I wanted to replace what's come after hardware ethernet ie in this case 00:80:9F:2E:3F:5E by what the user entered. I have this code: my $newline2=qq{host clin09 {hardware ethernet $_Globals{MAC_ADDRESS};\n filename /bootp/linux/pre3.1/alize/startup.txt;}\n}; open (VIEUX, $_Globals{DHCPDCONF}) or die je ne peux ouvrir $_Globals{DHCPDCONF} :$!; open(NOUVEAU, $nouveau) or die je ne peux ouvrir $nouveau : $!; while ($line = VIEUX) { if ($line =~ /^host clin09/) { print NOUVEAU $newline2 or die je ne peux écrire dans $nouveau : $!; } } close (VIEUX); close (NOUVEAU); But it didn't work could help me please Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: stripping out non-numbers
what would the regex be for stripping out non-numeric characters from a string? I am trying to format phone numers in a standard way, so i want to strip out all the extras people enter like . - ( ) [space] any help appreciated! thanks, rory As Japhy suggested for a similar question. Use tr/// : $x = sadf24sad234zsd234; $x =~ tr/0-9//cd; Jenda === [EMAIL PROTECTED] == http://Jenda.Krynicky.cz == There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain. I can't find it. --- me -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: next step
From: [EMAIL PROTECTED] This is a question for Perl programmers in the field. I would like to hear your advice in my next step. I work presently in a DOS - windows environment. I program Perl in DOS. It is pretty straight Perl scripts. Besides some DBI, and a sprinkle of CGI, it's mainly straight Perl. I learnt Perl, and took an excellent course in NYU in advanced Perl ('use' versus 'require,' type globs, tie scalar, oop, CGI, DBI etc.) I have not mastered them, but it opened me up to the big stuff. My question is how do I stay in Perl, and make myself more marketable. I want to advance financially. Most Perl jobs are not for straight Perl. Do I need to take Unix, Java, JavaScript, HTML, or none of the above (or all). (I know very few languages besides Perl.) Well ... you've seen the adverts, so you know what is wanted ;-) This really depends on what you like and what is your background. You may become an admin with Perl skills (Microsoft certificate on Win2k would help), a web programmer (you should learn HTML, JavaScript, some more database stuff, maybe if you are going to stay on Windows ASPs (just in case), COM (you can write those in Perl)), a database admin/programmer (courses on Oracle or MS SQL). Really there is no single advice. Tell us what would you want to end up doing ... Courses are expensive, so what do you think? (No attachments please.) And do you really need them? I've always learned more from manuals and my own experiments. Of course sometimes the courses may be helpfull especialy if you are starting to learn something totaly new, but I'd always think twise it I need them. On the other hand I have to admit that I've never been to a real course. Even when we were asked to write an application in Oracle and neither me nor my coleague have ever seen it before we made it without the course (and were pretty angry on the management that originaly promised to send us to a course). Jenda === [EMAIL PROTECTED] == http://Jenda.Krynicky.cz == There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain. I can't find it. --- me -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Working with Perl Modules
Dear Rod, Yes and No. On one of my installations, I am using Active Perl and on the other I use the Windows Core Perl version, which I downloaded some time back. I need to get the package running on both the machines. Also, I need to get this running on my web server which is Linux. Regards, Sharat From: Crowder, Rod [EMAIL PROTECTED] To: 'Sharat Hegde' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: Working with Perl Modules Date: Fri, 7 Dec 2001 10:32:16 - Do you have Active State's perl? The package is available using PPM from their repository, and shouldn't need any compilation. -Original Message- From: Sharat Hegde [mailto:[EMAIL PROTECTED]] Sent: 07 December 2001 06:45 To: [EMAIL PROTECTED] Subject: Working with Perl Modules Hello, I have been using Perl for some time but have not yet used the Perl modules. I wanted to start off with the HTML::Template module - it will save me a lot of effort if I can use it. I need to get this working on Windows (where I do my development) as well as on my 3rd party shared host (where I do not have control over directories in my domain). I have downloaded the template files to my Windows desktop but I am unable to make the module. I do not have a C compiler or the make utility. I downloaded the GNU make, but I think I will need to compile this with a C compiler which I do not have (-: So the question is: how do I get the Perl module running on my Windows desktop as well as on the 3rd party shared host. Thanks in advance. With Regards, Sharat _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- 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] _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Write to a file problem
Jorge, You need to open and write all that you want to a new file: open(NOUVEAU, $nouveau) or die je ne peux ouvrir $nouveau : $!; open(new_NOUVEAU, + $nouveau_new) or die je ne peux ouvrir $nouveau_new : $!; while ($line = VIEUX) { last if ($line =~ /^host clin09/); print new_NOUVEAU $line; } print new_NOUVEAU $line; print NOUVEAU $newline2 or die je ne peux écrire dans $nouveau : $!; close (new_NOUVEAU); close (NOUVEAU); then delete $nouveau and rename $nouveau_new to $nouveau. Jerry Jorge Goncalvez wrote: HI, I have a file which ends by: host clin09 {hardware ethernet 00:80:9F:2E:3F:5E; filename /bootp/linux/pre3.1/alize/startup.txt;} } I have a perl tk application where a user types a MAc Adress in an entry the variable is $_Globals{MAC_ADDRESS} . I wanted to replace what's come after hardware ethernet ie in this case 00:80:9F:2E:3F:5E by what the user entered. I have this code: my $newline2=qq{host clin09 {hardware ethernet $_Globals{MAC_ADDRESS};\n filename /bootp/linux/pre3.1/alize/startup.txt;}\n}; open (VIEUX, $_Globals{DHCPDCONF}) or die je ne peux ouvrir $_Globals{DHCPDCONF} :$!; open(NOUVEAU, $nouveau) or die je ne peux ouvrir $nouveau : $!; while ($line = VIEUX) { if ($line =~ /^host clin09/) { print NOUVEAU $newline2 or die je ne peux écrire dans $nouveau : $!; } } close (VIEUX); close (NOUVEAU); But it didn't work could help me please 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]
System COmmand's in Perl
how can i execute system commands in perl just like how i would do it while on console ..e.g tail -f /var/log/messages ..that kinda thing...as you can see the OS type we talking about here is *NIX .. thanx _ Be different Get yourself a Globenetcafe.net email ID Uganda's Newest internet cafe www.globenetcafe.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
System COmmand's in Perl
how can i execute system commands in perl just like how i would do it while on console ..e.g useradd -m user_name -s /bin/false ..that kinda thing...as you can see the OS type we talking about here is *NIX .. thanx _ Be different Get yourself a Globenetcafe.net email ID Uganda's Newest internet cafe www.globenetcafe.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: System COmmand's in Perl
system tail -f /var/log/messages; or exec tail -f /var/log/messages; Craig David Lubowa [EMAIL PROTECTED] 12/07/01 07:45AM how can i execute system commands in perl just like how i would do it while on console ..e.g tail -f /var/log/messages ..that kinda thing...as you can see the OS type we talking about here is *NIX .. thanx _ Be different Get yourself a Globenetcafe.net email ID Uganda's Newest internet cafe www.globenetcafe.net -- 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:Regex help
I have this line in a file : host clin09 { hardware ethernet 00:80:9F:2E:3F:5E I have this code: While . if ($line =~ /^host clin09/){ system(q{perl -i.orig -pe s/00:80:9F:2E:3F:5E/$_Globals{MAC_ADDRESS}/ c:\\cygwin\\etc\\dhcpd\\dhcpd.conf}) or die; } It works but now I wanted that 00:80:9F:2E:3F:5E to be a variable . I wanted to have this: if ($line =~ /^host clin09/){ system(q{perl -i.orig -pe s/$MAC_ADR/$_Globals{MAC_ADDRESS}/ c:\\cygwin\\etc\\dhcpd\\dhcpd.conf}) or die; } How can I check $MAC_ADR which is what there is after hardware ethernet in the file with a regex. MAny Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: System COmmand's in Perl
Hi David, you can use either system or `` , for example : system(ls -F /var /tmp/t.tmp); or $tmp = `ls -F /var /tmp/t.tmp`; -Djoko- www.dnet.net.id - It is said that the lonely eagle flies to the mountain peaks while the lowly ant crawls the ground, but cannot the soul of the ant soar as high as the eagle? - - Original Message - From: David Lubowa [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 07, 2001 7:45 PM Subject: System COmmand's in Perl how can i execute system commands in perl just like how i would do it while on console ..e.g tail -f /var/log/messages ..that kinda thing...as you can see the OS type we talking about here is *NIX .. thanx _ Be different Get yourself a Globenetcafe.net email ID Uganda's Newest internet cafe www.globenetcafe.net -- 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 MySQL DBI
Friday, December 07, 2001, 5:18:38 AM, Aaron Shurts wrote: AS Okay, I was the one that asked the crazy question about the weird join, AS but I got that figured out. Now I have a problem. AS while( ($login, $existingemail, $areacode, $prefix, $rest) = $sth-fetchrow_array ()) AS { AS print $login,$existingemail,$areacode-$prefix-$rest\n; AS } AS That code is inside my foreach statement, but existingemail is an AS optional field. If there is no email address given, I would like to AS print out NO EMAIL PROVIDED. How do I do this within my while loop. AS When this report is run, it is piped to a csv file so that it can easily AS be imported into Excel. Thanks in advance for the help. you could do while(( $a, $b, $c) = ...) { $b ||= NO EMAIL; ... } which says if $b is false, then assign it 'NO EMAIL'. this is a nice generic little way for setting up default values. the only issue with it is if $b already contains a false value that you want to keep (eg 0) it will be overwritten, although with email addresses that's not a problem. perl 6 is going to have //= which does the same thing as ||= but only assigns if $b is undef. -- Best regards, Daniel Bershere's Formula for Failure: There are only two kinds of people who fail: those who listen to nobody... and those who listen to everybody. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Finding 'probable' duplicate records
Carl, I don't have a lot of Perl-specific advice, but if it's possible to dependably parse each line into the component fields (last name, first name, street address, etc.), you could apply some intelligent guesses using the various fields. If this is possible, here's what worked pretty well for me with a mailing list database I once worked on: * Compare last names using the Soundex algorithm (which translates similarly spelled names into the same code value; I believe there a perlmod or two for this). * Create a database of common first name equivalencies (ie. Robert = Bob, etc) and compare first names by these values. (Per your example, you would also want to consider initials as a possible match to any first name starting with that letter.) * Parse the street address into numbers, street names, and street labels (Street, St., Road, etc.), and consider any address with the same street name and zip code or city as a possible match, regardless of the numbers. Even better, compare street names using Soundex too. Hope this helps. I'll leave the Perl code for this as an exercise for the reader! :-) - John -Original Message- From: Carl Rogers [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 8:33 PM To: [EMAIL PROTECTED] Subject: Finding 'probable' duplicate records Good day; Let me start off by saying that by just reading this list, I've received a lot of great information that I have been able to put to use (Now that I've flattered all you gurus) I have code that finds true (exact) duplicates in records: while (INFILE) { if (not $seen{$_}) { $seen{$_} = 1; print OUTFILE; } else { # this record is a duplicate } } I've gone so far as to manipulate $_ so as to remove \W globally and make it uppercase (so that Mr Zorkoff and MR ZORKOFF gets flagged as a duplicate). This works well also. What I'd like to do now next, if it's possible, is to catch items like the following: Mr. Tom Zorkoff 123 Elm St. NE Chicago, Illinois Mr. T. Zorkoff 123 Elm Street North East, Chicago, IL To do this, I'm hoping there is a way I can calculate the number of differences between line 1 and line 2 and use a percentage to determine if it should be considered unique or not. I don't understand how (or if) $_ could tell that $seen{$_} is a potential candidate, then go so far as counting the differences between the two. My thought is that I could get a scalar value for a substitution (i.e.: $result = () = $_ =~ /$seen{$_}/g; or something like that??), but I'm afraid that as soon as there is a single difference between the two, $result will be 0 (false). Am I barking up a beanstalk??? I hope this makes sense. Any and all help is greatly appreciated. Thanks, Carl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message may contain information which is private, privileged or confidential and is intended solely for the use of the individual or entity named in the message. If you are not the intended recipient of this message, please notify the sender thereof and destroy / delete the message. Neither the sender nor Sappi Limited (including its subsidiaries and associated companies) shall incur any liability resulting directly or indirectly from accessing any of the attached files which may contain a virus or the like. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: System COmmand's in Perl
On Fri, Dec 07, 2001 at 07:59:53AM -0500, Craig wrote: system tail -f /var/log/messages; or exec tail -f /var/log/messages; or `tail -f /var/log/messages` Although this won't fork your program and -f means it follows the file updates. For this you can use the CPAN module File::Tail -- Frank Booth - Consultant Parasol Solutions Limited. (www.parasolsolutions.com) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to automatically put 'membernames' in the msg posted.
Reference that I just happened across on my desk: CGI Programming with Perl, O'Reilly, Chapter 11, Maintaining State. The three methods discussed are Query String and Extra Path Information (what I discussed below), Hidden Fields, and Client-Side Cookies. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 8:32 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: how to automatically put 'membernames' in the msg posted. I imagine that you are speaking of sites which record session information on the server. The pages pass a session ID or some other identifying information with each internal link, often by appending something like ?id=123456789 to the end of each URL after the user logs in. To do this, you need to be using some kind of server side language like ASP, JSP, servlets, or other CGI programs. Perl will also work of course. I don't have any references for you off the top of my head, but I'm sure there's a wealth of information on-line, as well as in books. - John -Original Message- From: Leon [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 5:28 AM To: [EMAIL PROTECTED] Subject: how to automatically put 'membernames' in the msg posted. Could members here provide me with some lead with regards to the following :- I've seen many homepages that requires 'members' to login with their password and membername, they could then browse the pages at their own sweet time (browse here, there and everywhere), but when they post a msg, their 'membernames' automatically appears in their post. This is to prevent imposters. How could this be done. Thanks _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com This message may contain information which is private, privileged or confidential and is intended solely for the use of the individual or entity named in the message. If you are not the intended recipient of this message, please notify the sender thereof and destroy / delete the message. Neither the sender nor Sappi Limited (including its subsidiaries and associated companies) shall incur any liability resulting directly or indirectly from accessing any of the attached files which may contain a virus or the like. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Finding 'probable' duplicate records
Hey John; Thanks for the help At 08:44 AM 12/7/2001 -0500, [EMAIL PROTECTED] wrote: Carl, I don't have a lot of Perl-specific advice, but if it's possible to dependably parse each line into the component fields (last name, first name, street address, etc.), you could apply some intelligent guesses using the various fields. If this is possible, here's what worked pretty well for me with a mailing list database I once worked on: * Compare last names using the Soundex algorithm (which translates similarly spelled names into the same code value; I believe there a perlmod or two for this). I've never heard of this (my ignorance is showing, I know), but I think this is more granular than I need. I was hoping that I could find a way to say 'Compare two strings (the fields within the strings aren't important). If string B has 17 common characters out of 20 in string A, you might want to consider that a match'. Don't know if that's do-able or not.. hoping someone out there may be able to tell me if it's been done before. I guess what I'm trying to do, is figure out how to play with (manipulate) $seen{$_} -1, $seen{$_}, and/or $seen{$_}+1 or at least find out how to get their values. In the meantime, I'll see what I can find on Soundex. Thanks again for the assistance. Carl -Original Message- From: Carl Rogers [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 8:33 PM To: [EMAIL PROTECTED] Subject: Finding 'probable' duplicate records Good day; Let me start off by saying that by just reading this list, I've received a lot of great information that I have been able to put to use (Now that I've flattered all you gurus) I have code that finds true (exact) duplicates in records: while (INFILE) { if (not $seen{$_}) { $seen{$_} = 1; print OUTFILE; } else { # this record is a duplicate } } I've gone so far as to manipulate $_ so as to remove \W globally and make it uppercase (so that Mr Zorkoff and MR ZORKOFF gets flagged as a duplicate). This works well also. What I'd like to do now next, if it's possible, is to catch items like the following: Mr. Tom Zorkoff 123 Elm St. NE Chicago, Illinois Mr. T. Zorkoff 123 Elm Street North East, Chicago, IL To do this, I'm hoping there is a way I can calculate the number of differences between line 1 and line 2 and use a percentage to determine if it should be considered unique or not. I don't understand how (or if) $_ could tell that $seen{$_} is a potential candidate, then go so far as counting the differences between the two. My thought is that I could get a scalar value for a substitution (i.e.: $result = () = $_ =~ /$seen{$_}/g; or something like that??), but I'm afraid that as soon as there is a single difference between the two, $result will be 0 (false). Am I barking up a beanstalk??? I hope this makes sense. Any and all help is greatly appreciated. Thanks, Carl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message may contain information which is private, privileged or confidential and is intended solely for the use of the individual or entity named in the message. If you are not the intended recipient of this message, please notify the sender thereof and destroy / delete the message. Neither the sender nor Sappi Limited (including its subsidiaries and associated companies) shall incur any liability resulting directly or indirectly from accessing any of the attached files which may contain a virus or the like. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Confirmation...
In article 01ad01c17ee7$dcbfff80$5960a9cb@nothing, [EMAIL PROTECTED] (Leon) wrote: This /([\d.]*)\/.*/g works irregardless whether your ip is 206.48.16.3/12345 or src=206.48.16.3/12345 it doesn't work at all, actually. -- brian d foy [EMAIL PROTECTED] - Perl services for hire CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Deleting a line
Hi everybody! somebody know how i can delete a line of a text file? i'm tryng some like this /^line1/d but i don't know the sintxs to execute some like this and i don't know if between / can be a variable ($_) Thak's all _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
renaming files - fatuous newbie query
Ok team, here's the deal. I am *not* a programmer or a sysadmin, so be gentle. ;) Here is the code--checked it out in perldoc -q. Wow, it works... My platform: Windows 2000 #! perl -w use strict; use File::Copy; move(file1.txt, file3.txt); That's great, but I have umpteen scores of files that are named nm*.html and nm*.gif. I need to iterate the code to go through the directory and change the file names. How do i go about finding the code to do this. I tried perldoc -q iteration (and branching; and etc...) Stumped and need some advice please... BTW: I get the list in digest format, so if you do reply please 'cc' me. Thank you all very much. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Deleting a line
Depending on what you are after, there is a number of ways from one-liners to whatever. In most basic form, you will need to open file to read, another file to write. Using the regex or some type of test to determine if a line is to be re-written to the file or not. pseudo code: open(FILEIN, $filein) || die unable to open $filein: $!; open(FILEOUT,$fileout) || die unable to open $fileout: $!; while ( FILEIN) { next if ( /linetodlete/ ); # if line equals this, then get next line print FILEOUT $_; } close(FILEIN); close(FILEOUT); Wags ;) -Original Message- From: Mark Mclogan [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 08:34 To: [EMAIL PROTECTED] Subject: Deleting a line Hi everybody! somebody know how i can delete a line of a text file? i'm tryng some like this /^line1/d but i don't know the sintxs to execute some like this and i don't know if between / can be a variable ($_) Thak's all _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- 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: renaming files - fatuous newbie query
On Fri, Dec 07, 2001 at 11:41:05AM -0500, McCarney, wrote: Ok team, here's the deal. I am *not* a programmer or a sysadmin, so be gentle. ;) Here is the code--checked it out in perldoc -q. Wow, it works... My platform: Windows 2000 #! perl -w use strict; use File::Copy; opendir (I,'somedir') or die Ack $!\n; for (grep{ /nm.*\.html/ }readdir I){ s/\..*//; # remove suffix move($_.txt, $_.txt); } That's great, but I have umpteen scores of files that are named nm*.html and nm*.gif. You want to change the names of gifs too? grep /nm.*\.(gif)|(html)/ for recursing dirs try Find::File Stumped and need some advice please... BTW: I get the list in digest format, so if you do reply please 'cc' me. Noted ;0) -- Frank Booth - Consultant Parasol Solutions Limited. (www.parasolsolutions.com) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Deleting a line
Hi every body! I don't know how i can delete a line of a file. Some body know? Thnk's _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Working with Perl Modules
Does just copying a module work? Some of the modules have, for lack of a better term, 'text' embeded into them, and the package has so many other files that must have some purpose. I'm just worried about copying a module and having pieces missing... Peter Scott [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... At 12:27 PM 12/7/2001 +, Lanceo wrote: I am also using both and this morning tried to use make, to no avail. Someone else gave me the tip to try perl -V:make to see what version of make my installs use, one returns with 'make=nmake;' so I tried nmake instead... but neither make nor nmake are recognized as valid programs in dos. I have read a whole bunch of installation instructions, from CPAN and ActiveState, and there is no way the installation of modules should be this complicated, they just tell you to unzip the archive into a directory, go there and run Makefile.PL (which works for me) and then: make make test make install But none of my attempts to get make to work have succeeded. I am getting pretty frustrated trying to get this (probably very simple) install process to work! One word -Argh! =8-) Well, you're not going to get far in Perl without a make program, so I suggest you get one. Someone on this list should be able to tell you where to find it. Try the ActiveState FAQ. However, in the case of this module, you won't need it. All you need to do is copy the module into the right place. Go to the root of your ActiveState perl, descend into the site\lib directory, create a directory called HTML if there isn't one already, and copy the Template.pm file from the download there. Similar procedure on Unix with the site_perl directory. Rod Crowder [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Do you have Active State's perl? The package is available using PPM from their repository, and shouldn't need any compilation. -Original Message- From: Sharat Hegde [mailto:[EMAIL PROTECTED]] Sent: 07 December 2001 06:45 To: [EMAIL PROTECTED] Subject: Working with Perl Modules Hello, I have been using Perl for some time but have not yet used the Perl modules. I wanted to start off with the HTML::Template module - it will save me a lot of effort if I can use it. I need to get this working on Windows (where I do my development) as well as on my 3rd party shared host (where I do not have control over directories in my domain). I have downloaded the template files to my Windows desktop but I am unable to make the module. I do not have a C compiler or the make utility. I downloaded the GNU make, but I think I will need to compile this with a C compiler which I do not have (-: So the question is: how do I get the Perl module running on my Windows desktop as well as on the 3rd party shared host. Thanks in advance. With Regards, Sharat _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- 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] Peter Scott [EMAIL PROTECTED] http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to delete a hash entry
I've got hash and I want to completely remove one or more entries from the list. I tried undef, but that removes the value and not the key. %list = ( first = 1, second = 2, third = 3 ) How can I remove $list{second} completely so the following loop only reports first and third? foreach $k (keys %list) { print $k=$list{$k}\n; } Thanks --Chuck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to delete a hash entry
On Fri, 7 Dec 2001, Tomasi, Chuck wrote: I've got hash and I want to completely remove one or more entries from the list. I tried undef, but that removes the value and not the key. %list = ( first = 1, second = 2, third = 3 ) How can I remove $list{second} completely so the following loop only reports first and third? perldoc -f delete -- Brett http://www.chapelperilous.net/ You may call me by my name, Wirth, or by my value, Worth. - Nicklaus Wirth -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to delete a hash entry
From: Tomasi, Chuck [EMAIL PROTECTED] I've got hash and I want to completely remove one or more entries from the list. I tried undef, but that removes the value and not the key. %list = ( first= 1, second = 2, third = 3 ) How can I remove $list{second} completely so the following loop only reports first and third? How do you delete something from a hash? Well ... erm ... you delete it. delete $list{second}; Jenda === [EMAIL PROTECTED] == http://Jenda.Krynicky.cz == There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain. I can't find it. --- me -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Working with Perl Modules
At 04:24 PM 12/7/01 +, Lanceo wrote: Does just copying a module work? Not in general. I applied my amazing powers of perception in this case and took an educated guess that you could get away with it for HTML::Template. This offer does not apply to all modules, void where prohibited and in Tennessee, free shipping only within the Continental United States, do not engage motor while safety shield is removed. Some of the modules have, for lack of a better term, 'text' embeded into them, and the package has so many other files that must have some purpose. I'm just worried about copying a module and having pieces missing... Peter Scott [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... At 12:27 PM 12/7/2001 +, Lanceo wrote: I am also using both and this morning tried to use make, to no avail. Someone else gave me the tip to try perl -V:make to see what version of make my installs use, one returns with 'make=nmake;' so I tried nmake instead... but neither make nor nmake are recognized as valid programs in dos. I have read a whole bunch of installation instructions, from CPAN and ActiveState, and there is no way the installation of modules should be this complicated, they just tell you to unzip the archive into a directory, go there and run Makefile.PL (which works for me) and then: make make test make install But none of my attempts to get make to work have succeeded. I am getting pretty frustrated trying to get this (probably very simple) install process to work! One word -Argh! =8-) Well, you're not going to get far in Perl without a make program, so I suggest you get one. Someone on this list should be able to tell you where to find it. Try the ActiveState FAQ. However, in the case of this module, you won't need it. All you need to do is copy the module into the right place. Go to the root of your ActiveState perl, descend into the site\lib directory, create a directory called HTML if there isn't one already, and copy the Template.pm file from the download there. Similar procedure on Unix with the site_perl directory. Rod Crowder [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Do you have Active State's perl? The package is available using PPM from their repository, and shouldn't need any compilation. -Original Message- From: Sharat Hegde [mailto:[EMAIL PROTECTED]] Sent: 07 December 2001 06:45 To: [EMAIL PROTECTED] Subject: Working with Perl Modules Hello, I have been using Perl for some time but have not yet used the Perl modules. I wanted to start off with the HTML::Template module - it will save me a lot of effort if I can use it. I need to get this working on Windows (where I do my development) as well as on my 3rd party shared host (where I do not have control over directories in my domain). I have downloaded the template files to my Windows desktop but I am unable to make the module. I do not have a C compiler or the make utility. I downloaded the GNU make, but I think I will need to compile this with a C compiler which I do not have (-: So the question is: how do I get the Perl module running on my Windows desktop as well as on the 3rd party shared host. Thanks in advance. With Regards, Sharat -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Opening a URL
Hi! How can i open a URL in PERL? open URL?? shnnk. Over _ Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Opening a URL
On Fri, 2001-12-07 at 17:19, Juan Manuel Espinoza wrote: How can i open a URL in PERL? With the 'LWP' modules. In this case, putting the HTML to Google's front page in $content: use LWP::Simple; my $content = get( http://www.google.com/; ) or die $!; Hope this helps, - ~C. -- Chris Ball E-mail: [EMAIL PROTECTED] Web Programmer Web : www.fastsearch.com Fast Web Media Ltd Try : www.alltheweb.com 12th Floor Sunlight House, Quay Street, Manchester M3 3JZ, UK. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Opening a URL
On Fri, 7 Dec 2001, Juan Manuel Espinoza wrote: How can i open a URL in PERL? open URL?? LWP::Simple has an easy way to open URLs: use LWP::Simple; my $URL = 'http://www.amazon.com'; my $html = get $URL; You can get this from CPAN. Or you can do more elaborate stuff using HTTP::* modules. -- Brett http://www.chapelperilous.net/ The mosquito exists to keep the mighty humble. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Suggestions For Flexible Text Output
Hi all, I have a script that gathers information from system commands and log files. There is a potential for 5 different command line switches to be used, that will determine the amount and types of information returned. Basicaly, which ever command line option the user uses, there will be a matching Heading and the actual output to the command. I'm trying to use the Format/write statements to achieve a *unified* look. However, since there is several possible output possibilities based on the command line options, is there a way I can use 1 or 2 Format statements for all the different options? Is there a module out there that can help? I'm having dificulty getting Format::Text to do what I want. -- Ken Hammer Strategic Projects And Planning University Of Michigan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with replacing hash elements
Here is a shot which works with data provided, but others may see other real problems with it. When it comes to hash and ref to to array within hash, I have not the best understanding. use strict refs; #- # define some variables #- # $notify_file = /usr/local/bin/unix_notify; # open(NOTIFY, $notify_file) or #die $0: cannot open $notify_file: $!\n; # load the notify file into a hash --- while ( DATA ) { chomp; # remove newline char next if /^\s*#/; # skip comments next unless s/^(.*?):\s*//; # look for xxx: format $notify_email{$1} = [ split /;/ ]; } foreach $key ( keys(%notify_email) ) { print the notify code is $key\n; my $MyOffset = 0; foreach my $element ( @{ $notify_email{$key} } ) { if (exists $notify_email{$element}) { # use of splice to replace which may not work correctly if another array, but like said # works with data provided. # splice( @{ $notify_email{$key}}, $MyOffset, 1, (@{ $notify_email{$element} }) ); } $MyOffset++; } } print \n; foreach $key ( keys(%notify_email) ) { print the notify code is $key\n; foreach my $element ( @{ $notify_email{$key} } ) { print $element\n; } } __DATA__ e-internalteam: e-randy;e-joel;e-darren e-randy: [EMAIL PROTECTED] e-joel: [EMAIL PROTECTED] e-darren: [EMAIL PROTECTED] ^--- Script ends here Output: the notify code is e-internalteam [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] the notify code is e-joel [EMAIL PROTECTED] the notify code is e-darren [EMAIL PROTECTED] the notify code is e-randy [EMAIL PROTECTED] -Original Message- From: Epperson, Randall W [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 07:48 To: Perl Beginners list (E-mail) Subject: Problem with replacing hash elements Greetings Here is the format of my notify file: e-internalteam: e-randy;e-joel;e-darren e-randy: [EMAIL PROTECTED] e-joel: [EMAIL PROTECTED] e-darren: [EMAIL PROTECTED] I'm trying to build a hash of arrays that looks like this: e-internalteam [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] e-randy [EMAIL PROTECTED] e-joel [EMAIL PROTECTED] e-darren [EMAIL PROTECTED] Here is my code: #!/usr/bin/perl -w use strict refs; #- # define some variables #- $notify_file = /usr/local/bin/unix_notify; open(NOTIFY, $notify_file) or die $0: cannot open $notify_file: $!\n; # load the notify file into a hash --- while ( NOTIFY ) { chomp; # remove newline char next if /^\s*#/; # skip comments next unless s/^(.*?):\s*//; # look for xxx: format $notify_email{$1} = [ split /;/ ]; } # insure any notify codes are resolved foreach $key ( keys(%notify_email) ) { print the notify code is $key\n; foreach my $element ( @{ $notify_email{$key} } )
SNMP_util help
I am trying to retrieve the mac address from the arp table of another machine using Mike Mitchell's SNMP_util module. When I run the script below i get à) as the result instead of the mac address. I know the snmp daemon is running properly as i can use snmpget from the command line and it gives me no troubles. #!/usr/bin/perl -w use SNMP_util; $ip = 192.168.1.1; $mib = .1.3.6.1.2.1.4.22.1.2.2.$ip; @mac = snmpget(commstring\@localhost, $mib); print @mac; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Working with Perl Modules
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Peter Scott) wrote: At 04:24 PM 12/7/01 +, Lanceo wrote: Does just copying a module work? Not in general. I applied my amazing powers of perception in this case and took an educated guess that you could get away with it for HTML::Template. This offer does not apply to all modules, void where prohibited and in Tennessee, free shipping only within the Continental United States, do not engage motor while safety shield is removed. Some of the modules have, for lack of a better term, 'text' embeded into them, and the package has so many other files that must have some purpose. I'm just worried about copying a module and having pieces missing... Honestly you should just do what the one person who knew what he was talking about suggested. Since you're using activestate, you should use ppm. ppm install HTML::Template Check ActiveState's website for more info. print pack H*, 4a75737420416e6f74686572204d61635065726c204861636b65722c0d; -- Scott R. Godin| e-mail : [EMAIL PROTECTED] Laughing Dragon Services |web : http://www.webdragon.net/ It is not necessary to cc: me via e-mail unless you mean to speak off-group. I read these via nntp.perl.org, so as to get the stuff OUT of my mailbox. :-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Deleting a line
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Mark McLogan) wrote: Hi every body! I don't know how i can delete a line of a file. Some body know? Thnk's perldoc -q delete print pack H*, 4a75737420416e6f74686572204d61635065726c204861636b65722c0d; -- Scott R. Godin| e-mail : [EMAIL PROTECTED] Laughing Dragon Services |web : http://www.webdragon.net/ It is not necessary to cc: me via e-mail unless you mean to speak off-group. I read these via nntp.perl.org, so as to get the stuff OUT of my mailbox. :-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: loopy question
Yes, as long as you don't need the current record otherwise you would need to change the way your loop functions to only read when necessary. Wags ;) -Original Message- From: Wright, Thomas [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 11:23 To: Beginners (E-mail) Subject: loopy question Folks, A questions about loops and files. If I have the following construct: while (FILEA) { $recA = $_ do something; while (FILEB) { $recB = $_; if ($this) { do something2; } elsif ($that) { do something3; last; } else { # the other do something4; last; } } do something5; } When the inner loop is exited, the outer loop continues, then it reenters the inner loop again. opening and closing the files takes place outside of both loops. Question(s?): Will the position in FILEB be held so that reading data from it will pick up where it was left off when exiting the inner loop previously? If not, what happens/where will it be? (implicit close/reopen?) ( I know, I would rather use an array, but the file is too large to load into memory). Thanks, Tom Wright 201.930.7517 -- 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: Using die but not break out of the script
You could use: system (dir $servervolume dirinfo) || ($var = 0); Daryl J. Hoyt Performance Engineer Geodesic Systems 312-832-2010 http://www.geodesic.com mailto:[EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 1:38 PM To: [EMAIL PROTECTED] Subject: Using die but not break out of the script Is there a way to use die but not break the entire script? system (dir $servervolume dirinfo) || die cant get dir info; I want it that if does die to assign a value of zero to a variable? Is that posssible? 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]
Re: Using die but not break out of the script
On Fri, 7 Dec 2001 [EMAIL PROTECTED] wrote: Is there a way to use die but not break the entire script? system (dir $servervolume dirinfo) || die cant get dir info; I want it that if does die to assign a value of zero to a variable? Is that posssible? Yes, you can use die to throw an exception, using eva. The message die prints is put into $@. eval { system (dir $servervolume dirinfo) || die cant get dir info\n; }; if($@) { print ERROR: $@\n; #do other things to recover } -- Brett http://www.chapelperilous.net/ Many people feel that if you won't let them make you happy, they'll make you suffer. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using die but not break out of the script
Friday, December 07, 2001, 7:38:11 PM, [EMAIL PROTECTED] wrote: Is there a way to use die but not break the entire script? system (dir $servervolume dirinfo) || die cant get dir info; I want it that if does die to assign a value of zero to a variable? Is that posssible? how about: $var = system (dir ...); it'll be 0 on success, which isn't quite what you want, but probably just as useful. check perldoc -f system -- Best regards, Daniel -- If you do what you always do, you'll get what you always get -- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: loopy question
Thanks, It is working as expected! -Original Message- From: Wagner-David [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 2:39 PM To: 'Wright, Thomas'; Beginners (E-mail) Subject: RE: loopy question Yes, as long as you don't need the current record otherwise you would need to change the way your loop functions to only read when necessary. Wags ;) -Original Message- From: Wright, Thomas [mailto:[EMAIL PROTECTED]] Sent: Friday, December 07, 2001 11:23 To: Beginners (E-mail) Subject: loopy question Folks, A questions about loops and files. If I have the following construct: while (FILEA) { $recA = $_ do something; while (FILEB) { $recB = $_; if ($this) { do something2; } elsif ($that) { do something3; last; } else { # the other do something4; last; } } do something5; } When the inner loop is exited, the outer loop continues, then it reenters the inner loop again. opening and closing the files takes place outside of both loops. Question(s?): Will the position in FILEB be held so that reading data from it will pick up where it was left off when exiting the inner loop previously? If not, what happens/where will it be? (implicit close/reopen?) ( I know, I would rather use an array, but the file is too large to load into memory). Thanks, Tom Wright 201.930.7517 -- 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: Working with Perl Modules
Aha! I just found out that ActiveState uses the ppm thingy instead of the manual method. I just d/l the latest Win32 ActiveState, installed it and used ppm3. Installation was a breeze. But for two days I have been trying to use make, nmake or dmake. I could not find a reference to make at the AP site, whenever I tried to search, the engine would break. Maybe too many returns... I only noticed the AP helpfile when I did this latest install, and it clearly explains how to install packages in the document. But I still could not get the Perl under NT to run make, nmake or dmake, so I just copied some of the extracted modules over to the server, set them in the path and they *seem* to be working fine. Someone else mentioned that NT does not come with a native compiler, so I will have to install a C compiler to compile the modules before running make. This sounds overly complex, but now that I have the modules working, maybe I am up to it. I have not touched C for a while... Scott R. Godin [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Peter Scott) wrote: At 04:24 PM 12/7/01 +, Lanceo wrote: Does just copying a module work? Not in general. I applied my amazing powers of perception in this case and took an educated guess that you could get away with it for HTML::Template. This offer does not apply to all modules, void where prohibited and in Tennessee, free shipping only within the Continental United States, do not engage motor while safety shield is removed. Some of the modules have, for lack of a better term, 'text' embeded into them, and the package has so many other files that must have some purpose. I'm just worried about copying a module and having pieces missing... Honestly you should just do what the one person who knew what he was talking about suggested. Since you're using activestate, you should use ppm. ppm install HTML::Template Check ActiveState's website for more info. print pack H*, 4a75737420416e6f74686572204d61635065726c204861636b65722c0d; -- Scott R. Godin| e-mail : [EMAIL PROTECTED] Laughing Dragon Services |web : http://www.webdragon.net/ It is not necessary to cc: me via e-mail unless you mean to speak off-group. I read these via nntp.perl.org, so as to get the stuff OUT of my mailbox. :-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question about searching a log file
I am a beginning perl developer and am a little confused I was wondering if anyone out there can give me some direction. My situation is as follows I have a command that generates the a log file with the following information I then need to parse through the page and check to see if TK_DISP_RUNSTATE is anything other then running or TK_END_TIME is not null. the issue that I am confused is how do I compare the information when label is on one line and the value is on the next. The size to the columns is fixed if there is no data in there then it will be filled with spaces. my script need to do this: 1. call the function to generate the log file---done that 2. Read through and file and check for valuesLost 3. If TK_DISP_RUNSTATE is anything other then running or TK_END_TIME is not null send out and email to page myself that the process is running--- Little help here would be nice but I think I got this down If anyone has done something similar to this I would appreciate some help. I am sure it is a simple task but I an inexperience and somewhat confused. Thank you Lance Siebel Enterprise Applications Siebel Server Manager, Version 6.2.1 [10232] ENU Copyright (c) Siebel Systems, Inc. 1995-1998. This software is the property of Siebel Systems, Inc., 1855 South Grant Street, San Mateo, CA 94402-2667. User warrants that any use of this software is governed by the terms and conditions of the Siebel Systems Software License and Services Agreement which has been executed and with which the user agrees to comply. UNAUTHORIZED POSSESSION, DISCLOSURE OR USE OF THIS SOFTWARE OR THE INFORMATION CONTAINED HEREIN IS PROHIBITED BY FEDERAL AND STATE LAW. If you have received this software in error, please notify us by telephone immediately at (650) 295-5000. Type help for list of commands, help topic for detailed help srvrmgr:CHK_SBL_DEV list tasks for server CHK_SBL_DEV component Workflow Monitor Agent SV_NAME CC_ALIAS TK_TASKID TK_PID TK_DISP_RUNSTATE CC_RUNMODE TK_START_TIMETK_END_TIME --- - -- -- --- --- CHK_SBL_DEV WorkMon 59458 647 Running Background 12/06/2001 17:13:11 1 row returned. srvrmgr:CHK_SBL_DEV -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using die but not break out of the script
Just want to say thanks to everyone who responded, this is the first time I have used this list for help, and surprised how fast I got helpful responses. Daniel Gardner daniel@danielgaTo: [EMAIL PROTECTED] rdner.org cc: [EMAIL PROTECTED] Subject: Re: Using die but not break out of the script 12/07/2001 02:52 PM Please respond to Daniel Gardner Friday, December 07, 2001, 7:38:11 PM, [EMAIL PROTECTED] wrote: Is there a way to use die but not break the entire script? system (dir $servervolume dirinfo) || die cant get dir info; I want it that if does die to assign a value of zero to a variable? Is that posssible? how about: $var = system (dir ...); it'll be 0 on success, which isn't quite what you want, but probably just as useful. check perldoc -f system -- Best regards, Daniel -- If you do what you always do, you'll get what you always get -- -- 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]
$searchstring help
hi can anyone tell me how to short this... if($searchstring =~ /A/i or $searchstring =~ /B/i or $searchstring =~ /C/i or $searchstring =~ /D/i or $searchstring =~ /E/i or $searchstring =~ /F/i or $searchstring =~ /G/i or $searchstring =~ /H/i or $searchstring =~ /I/i or $searchstring =~ /J/i or $searchstring =~ /K/i or $searchstring =~ /L/i or $searchstring =~ /M/i or $searchstring =~ /N/i or $searchstring =~ /O/i or $searchstring =~ /P/i or $searchstring =~ /Q/i or $searchstring =~ /R/i or $searchstring =~ /S/i or $searchstring =~ /T/i or $searchstring =~ /U/i or $searchstring =~ /V/i or $searchstring =~ /W/i or $searchstring =~ /X/i or $searchstring =~ /Y/i or $searchstring =~ /Z/i or $searchstring =~ /0/i or $searchstring =~ /1/i or $searchstring =~ /2/i or $searchstring =~ /3/i or $searchstring =~ /4/i or $searchstring =~ /5/i or $searchstring =~ /6/i or $searchstring =~ /7/i or $searchstring =~ /8/i or $searchstring =~ /9/i) { i want something like.. if $searchstring has at least 1 letter or number { commands... } Status []s
Re: $searchstring help
my try: if ($searchstring =~ /^\w+/) {...} I can't beleive you typed all the letters:P Etienne Jesus Is Not Dead wrote: hi can anyone tell me how to short this... if($searchstring =~ /A/i or $searchstring =~ /B/i or $searchstring =~ /C/i or $searchstring =~ /D/i or $searchstring =~ /E/i or $searchstring =~ /F/i or $searchstring =~ /G/i or $searchstring =~ /H/i or $searchstring =~ /I/i or $searchstring =~ /J/i or $searchstring =~ /K/i or $searchstring =~ /L/i or $searchstring =~ /M/i or $searchstring =~ /N/i or $searchstring =~ /O/i or $searchstring =~ /P/i or $searchstring =~ /Q/i or $searchstring =~ /R/i or $searchstring =~ /S/i or $searchstring =~ /T/i or $searchstring =~ /U/i or $searchstring =~ /V/i or $searchstring =~ /W/i or $searchstring =~ /X/i or $searchstring =~ /Y/i or $searchstring =~ /Z/i or $searchstring =~ /0/i or $searchstring =~ /1/i or $searchstring =~ /2/i or $searchstring =~ /3/i or $searchstring =~ /4/i or $searchstring =~ /5/i or $searchstring =~ /6/i or $searchstring =~ /7/i or $searchstring =~ /8/i or $searchstring =~ /9/i) { i want something like.. if $searchstring has at least 1 letter or number { commands... } Status []s -- Etienne Marcotte Specifications Management - Quality Control Imperial Tobacco Ltd. - Montreal (Qc) Canada 514.932.6161 x.4001 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FW: Question about searching a log file
I am a beginning perl developer and am a little confused I was wondering if anyone out there can give me some direction. or at the very least tell me a good site for beginners to get information. it seem like every site is for advanced developers My situation is as follows I have a command that generates the a log file with the following information I then need to parse through the page and check to see if TK_DISP_RUNSTATE is anything other then running or TK_END_TIME is not null. the issue that I am confused is how do I compare the information when label is on one line and the value is on the next. The size to the columns is fixed if there is no data in there then it will be filled with spaces. my script need to do this: 1. call the function to generate the log file---done that 2. Read through and file and check for valuesLost 3. If TK_DISP_RUNSTATE is anything other then running or TK_END_TIME is not null send out and email to page myself that the process is running--- Little help here would be nice but I think I got this down If anyone has done something similar to this I would appreciate some help. I am sure it is a simple task but I an inexperience and somewhat confused. Thank you Lance Siebel Enterprise Applications Siebel Server Manager, Version 6.2.1 [10232] ENU Copyright (c) Siebel Systems, Inc. 1995-1998. This software is the property of Siebel Systems, Inc., 1855 South Grant Street, San Mateo, CA 94402-2667. User warrants that any use of this software is governed by the terms and conditions of the Siebel Systems Software License and Services Agreement which has been executed and with which the user agrees to comply. UNAUTHORIZED POSSESSION, DISCLOSURE OR USE OF THIS SOFTWARE OR THE INFORMATION CONTAINED HEREIN IS PROHIBITED BY FEDERAL AND STATE LAW. If you have received this software in error, please notify us by telephone immediately at (650) 295-5000. Type help for list of commands, help topic for detailed help srvrmgr:CHK_SBL_DEV list tasks for server CHK_SBL_DEV component Workflow Monitor Agent SV_NAME CC_ALIAS TK_TASKID TK_PID TK_DISP_RUNSTATE CC_RUNMODE TK_START_TIMETK_END_TIME --- - -- -- --- --- CHK_SBL_DEV WorkMon 59458 647 Running Background 12/06/2001 17:13:11 1 row returned. srvrmgr:CHK_SBL_DEV -- 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]
Passing variables
Folks, I have just completed a front-end enduser script that will take numerous input values that need to be passed onto other perl scripts depending on the user input. Is there a clean way (other than command line) to pass on the variables from one script to another (the other scripts are called from within the front-end script) Regards, Ron -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing variables
--- Yacketta, Ronald [EMAIL PROTECTED] wrote: Folks, I have just completed a front-end enduser script that will take numerous input values that need to be passed onto other perl scripts depending on the user input. Is there a clean way (other than command line) to pass on the variables from one script to another (the other scripts are called from within the front-end script) Regards, Ron Ron, That's a very difficult question to answer without more information. I can think of a couple of ways of accomplishing what you want, but clean is relative to your needs. Do you need a response from the other programs? Do you just want to start them and have them run in the background with no response? Do you want to transfer control? The most dangerous thing I can think of, off hand, is to use the system command or backticks, but surely those will occur to some :( Those two are really, really easy to get wrong. Even if you get them right, others will happily come behind you and make 'em wrong again :) Forking can make things a bit better there, but not all systems allow that. Can the other scripts possibly be turned into modules? Can you give us better information on the information you are collecting and what you want to do with it? Cheers, Curtis Ovid Poe = Senior Programmer Onsite! Technology (http://www.onsitetech.com/) Ovid on http://www.perlmonks.org/ __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Fwd: RE: Passing variables
Sent this to the wrong list! Sorry. --- Curtis Poe [EMAIL PROTECTED] wrote: Date: Fri, 7 Dec 2001 15:30:59 -0800 (PST) From: Curtis Poe [EMAIL PROTECTED] Reply-to: [EMAIL PROTECTED] Subject: Fwd: RE: Passing variables To: CGI Beginners [EMAIL PROTECTED], Yacketta, Ronald [EMAIL PROTECTED] Ron, I think you meant to send this to the list, too :) I don't know ksh, so I am terribly familiar with what's going on there, but it doesn't look terribly difficult. I still don't know if you need anything returned to the user. If you don't and these programs don't take long to run, you could use the multiple argument form of system. system( $program, $client, $stagger, $start ); If you need the return data, you could use backticks. You state that you verify the input, I would just caution you that this is *very* dangerous. I'm sure there are other ways to do this, but you're heading into administrative territory and that's not my strong suit. Someone else on the list is probably better prepared to answer this. Cheers, Curtis --- Yacketta, Ronald [EMAIL PROTECTED] wrote: Date: Fri, 07 Dec 2001 18:18:54 -0500 From: Yacketta, Ronald [EMAIL PROTECTED] Subject: RE: Passing variables To: [EMAIL PROTECTED] I am collecting information from the enduser (tester) to run a System Load test. The user will enter the # of clients to run, the client # to start at, the stagger time, sleep time, Engine server and the Diag script sleep time. The info inputted will be verified and one of 4 scripts will be called. all_fastatart all_sleepystart mixed_faststart mixed_sleepystart The all scripts have a single test within it that requires the # clients, client start number, stagger time and sleep time. The mixed script has 7 tests that require the same info as the all, BUT each test will have its own set of client #, client start # , stagger time and sleep time. here is an example of the old .ksh I am converting #!/usr/bin/ksh if [ $# != 2 ] then echo You must supply a run # and Engine hostname on the command line... echo echo i.e. $0 1 wb0300ux137 echo Valid Engine servers are: echo 4500 NodeB (wb0300ux137) echo 3500 NodeB (mc0300ux219) echo exit 255 fi RunNumber=$1 ENGHost=$2 set -x cd /apps/VQXengine/trg/ltt/scripts ClientDiag.pl $1 60 sleep 120 cd ../beta_scripts nohup run_ACF2_VQ $ENGHost all_VALUTEST_wValidate_D40.scr 1500 1 120 1 21 sleep 15 nohup run_ACF2_VQ $ENGHost PActive_0299.scr 25 1501 200 175 21 sleep 15 nohup run_ACF2_VQ $ENGHost PActive_0005.scr 55 1526 200 80 21 sleep 10 nohup run_ACF2_VQ $ENGHost IMP1_1_143.scr 25 1581 175 160 21 sleep 10 nohup run_ACF2_VQ $ENGHost IMP1_5.scr 25 1606 45 150 21 sleep 10 nohup run_ACF2_VQ $ENGHost IMP1_14.scr 40 1631 75 150 21 sleep 6 nohup run_ACF2_VQ $ENGHost Valid01Unit_wTradeIn.scr 35 1671 250 100 21 set +x in line above (run_ACF2_VQ $ENGHost all_VALUTEST_wValidate_D40.scr 1500 1 120 1) $ENGHOST needs to be supplied by the tester, as well as the 4 numeric values after the test (all_VALUTEST_wValidate_D40.scr) these values are not static, they change from test to test... -Ron = Senior Programmer Onsite! Technology (http://www.onsitetech.com/) Ovid on http://www.perlmonks.org/ __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = Senior Programmer Onsite! Technology (http://www.onsitetech.com/) Ovid on http://www.perlmonks.org/ __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: $searchstring help
On Fri, Dec 07, 2001 at 04:35:11PM -0500, Maurice Reeves wrote: not quite. \w matches _ also, and he didn't have that in his list. how about $searchstring =~ /^[a-z0-9]+/i; I'm not sure why you're both anchoring the pattern. He didn't specify it had to start with a letter or number, he said it needs to be in the string. $searchstring =~ /[a-z0-9]/i; Why slow it down with the 'i'? $searchstring=~/[a-zA-Z0-9]/; Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Disable ModPerl
Friday, December 07, 2001, 11:29:15 PM, Agustin Rivera wrote: Is there a quick, simple command I can use to disable Modperl on all variables in script, without having to qw' then all? what do you mean when you say disable modperl? -- Best regards, Daniel Democracy: Two wolves and a sheep voting to decide what's for dinner. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Disable ModPerl
I am under the idea that modperl recycles as many variables as possible to speed up script processing. I don't want it to recycle variables in some scripts (in particular, ones I haven't written and have no desire to debug). Thanks, Agustin Rivera Webmaster, Pollstar.com http://www.pollstar.com - Original Message - From: Daniel Gardner [EMAIL PROTECTED] To: Agustin Rivera [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, December 07, 2001 3:38 PM Subject: Re: Disable ModPerl Friday, December 07, 2001, 11:29:15 PM, Agustin Rivera wrote: Is there a quick, simple command I can use to disable Modperl on all variables in script, without having to qw' then all? what do you mean when you say disable modperl? -- Best regards, Daniel Democracy: Two wolves and a sheep voting to decide what's for dinner. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Disable ModPerl
--- Agustin Rivera [EMAIL PROTECTED] wrote: Is there a quick, simple command I can use to disable Modperl on all variables in script, without having to qw' then all? Agustin Rivera Webmaster, Pollstar.com http://www.pollstar.com Agustin, I think you have a misunderstanding here. mod_perl is not enabled for variables. The scripts run in a mod_perl environment and can't have parts of them undone, so to speak. Perhaps if you were to share with us what you're trying to accomplish, what you're getting instead, and the offending code, we may be able to help you. Also, this is probably better posted to the CGI Beginners mailing list ([EMAIL PROTECTED]). Cheers, Curtis Ovid Poe = Senior Programmer Onsite! Technology (http://www.onsitetech.com/) Ovid on http://www.perlmonks.org/ __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: $searchstring help
On Fri, Dec 07, 2001 at 05:31:30PM -0600, Shawn wrote: Why slow it down with the 'i'? $searchstring=~/[a-zA-Z0-9]/; There is no reason, that's a good point. I was cargo-culting; appending the /i with no thought because the others were. Michael -- Administrator www.shoebox.net Programmer, System Administrator www.gallanttech.com -- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re[2]: Disable ModPerl
Friday, December 07, 2001, 11:40:06 PM, Agustin Rivera wrote: I am under the idea that modperl recycles as many variables as possible to speed up script processing. I don't want it to recycle variables in some scripts (in particular, ones I haven't written and have no desire to debug). take a look at the Apache::PerlRun module. that's for running nasty old scripts. and if you're going to be using mod_perl very much at all get a copy of the eagle book (writing apache modules with perl and c), and digest quite a lot of the stuff in the guide - http://perl.apache.org/guide/ perhaps this would be a nice place to start: http://perl.apache.org/guide/intro.html#What_is_mod_perl -- Best regards, Daniel Never call a man a fool. Instead, borrow things from him. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: $searchstring help
Shawn wrote: On Fri, Dec 07, 2001 at 04:35:11PM -0500, Maurice Reeves wrote: not quite. \w matches _ also, and he didn't have that in his list. how about $searchstring =~ /^[a-z0-9]+/i; I'm not sure why you're both anchoring the pattern. He didn't specify it had to start with a letter or number, he said it needs to be in the string. $searchstring =~ /[a-z0-9]/i; Why slow it down with the 'i'? $searchstring=~/[a-zA-Z0-9]/; Why slow it down with a regular expression? :-) if ( $searchstring =~ tr/a-zA-Z0-9/ ) { John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Disable ModPerl
Mod_Perl loads an entire script into memory, which is why you *don't* want variables shared; this is why mod_perl makes you decalre the scope of your variables so carefully. If you are after disabling mod_perl for a specific script or directory, then you'll be able to do it. As far as variables go you're out of luck. Have a look at http://perl.apache.org/guide/ Well written and will hopefully clarify questions you may have. Matt --- Agustin Rivera [EMAIL PROTECTED] wrote: I am under the idea that modperl recycles as many variables as possible to speed up script processing. I don't want it to recycle variables in some scripts (in particular, ones I haven't written and have no desire to debug). Thanks, Agustin Rivera Webmaster, Pollstar.com http://www.pollstar.com - Original Message - From: Daniel Gardner [EMAIL PROTECTED] To: Agustin Rivera [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, December 07, 2001 3:38 PM Subject: Re: Disable ModPerl Friday, December 07, 2001, 11:29:15 PM, Agustin Rivera wrote: Is there a quick, simple command I can use to disable Modperl on all variables in script, without having to qw' then all? what do you mean when you say disable modperl? -- Best regards, Daniel Democracy: Two wolves and a sheep voting to decide what's for dinner. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Disable ModPerl
I'm sure I had a misunderstanding there somewhere ;) This is the basic idea of what I'm doing.. I have a New Years Eve Concert Performance page I'm working on. Similiar in construction to a typical page here at Pollstar, i.e.: http://www.pollstar.com/tour/searchall.pl?By=ArtistContent=Aerosmith As good practice, we cache pages to reduce the load on our PostgreSQL databases. The problem I'm having is that the script is recycling something in the cache routine that is causing the date-sort to be displayed during a city-sort, or a name-sort during the date-sort (you get the idea). Sometimes, it reports that its showing a cached page when their clearly are no cached files on disk. Unfortunately, there is so much code and a few potential internal security risks (that I'm working on eliminating) in it that I can't simply cut and paste it. I was under the idea that this line of code... use vars qw($template $file $cache $cachefile); would stop mod_perl from recycling those variables. At least, thats what the local Linux guru told me. Thanks to everyone helping me out. It's time to do some reading... Agustin Rivera Webmaster, Pollstar.com http://www.pollstar.com - Original Message - From: Curtis Poe [EMAIL PROTECTED] To: Agustin Rivera [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, December 07, 2001 3:48 PM Subject: Re: Disable ModPerl --- Agustin Rivera [EMAIL PROTECTED] wrote: Is there a quick, simple command I can use to disable Modperl on all variables in script, without having to qw' then all? Agustin Rivera Webmaster, Pollstar.com http://www.pollstar.com Agustin, I think you have a misunderstanding here. mod_perl is not enabled for variables. The scripts run in a mod_perl environment and can't have parts of them undone, so to speak. Perhaps if you were to share with us what you're trying to accomplish, what you're getting instead, and the offending code, we may be able to help you. Also, this is probably better posted to the CGI Beginners mailing list ([EMAIL PROTECTED]). Cheers, Curtis Ovid Poe = Senior Programmer Onsite! Technology (http://www.onsitetech.com/) Ovid on http://www.perlmonks.org/ __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.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: $searchstring help
- Original Message - From: John W. Krahn [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 07, 2001 5:55 PM Subject: Re: $searchstring help Shawn wrote: On Fri, Dec 07, 2001 at 04:35:11PM -0500, Maurice Reeves wrote: not quite. \w matches _ also, and he didn't have that in his list. how about $searchstring =~ /^[a-z0-9]+/i; I'm not sure why you're both anchoring the pattern. He didn't specify it had to start with a letter or number, he said it needs to be in the string. $searchstring =~ /[a-z0-9]/i; Why slow it down with the 'i'? $searchstring=~/[a-zA-Z0-9]/; Why slow it down with a regular expression? :-) if ( $searchstring =~ tr/a-zA-Z0-9/ ) { I don't use tr often since most of my regex's are match, not subs. Does this not actually do the transpose? Shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: $searchstring help
- Original Message - From: Shawn [EMAIL PROTECTED] $searchstring =~ /[a-z0-9]/i; Why slow it down with the 'i'? $searchstring=~/[a-zA-Z0-9]/; The original poster says at least 1 letter or number .. i want something like..if $searchstring has at least 1 letter or number { commands... }; Therefore it should be $searchstring=~/[a-zA-Z0-9]+/; _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to automatically put 'membernames' in the msg posted.
- Original Message - From: [EMAIL PROTECTED] Thanks for your help John ! What I actually want is something like those message boards such as http://www.ikonboard.com/newindex.iB or www.delphiforums.com whereby after successfully logging in, we could view messages and if one decides to post message, our message posted will automatically display our 'membernames' . One of the members, Greg, says Use cookies or pass the member name to the posting script. I shall look into that. Thanks Greg. So, apart from Greg's suggestions, I'd love to hear if there are any other alternatives. Thanks _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re[2]: $searchstring help
Why slow it down with the 'i'? $searchstring=~/[a-zA-Z0-9]/; Why slow it down with a regular expression? :-) if ( $searchstring =~ tr/a-zA-Z0-9/ ) { i was bored, and thought i'd try a little benchmark. note, this is for the specific problem expressed here, not the general case. i benchmarked the following: RegexWithI: $string =~ /[A-Z0-9]/i; RegexNoI: $string =~ /A-Za-z0-9/; tr: $string =~ tr/[A-Za-z0-9//; i tested each with $string eq A and $string eq z i ran it three times on my perl 5.6.1, linux 2.4.7, celeron 400 laptop. the results (formatting slightly adjusted) Benchmark: timing 100 iterations RegexNoI(A): 18 wallclock secs (14.05 usr + 0.38 sys = 14.43 CPU) @ 69300.07/s (n=100) RegexNoI(z): 17 wallclock secs (14.05 usr + 0.40 sys = 14.45 CPU) @ 69204.15/s (n=100) RegexWithI(A): 16 wallclock secs (13.86 usr + 0.40 sys = 14.26 CPU) @ 70126.23/s (n=100) RegexWithI(z): 18 wallclock secs (13.54 usr + 0.25 sys = 13.79 CPU) @ 72516.32/s (n=100) tr(A): 12 wallclock secs (11.30 usr + 0.16 sys = 11.46 CPU) @ 87260.03/s (n=100) tr(z): 16 wallclock secs (11.32 usr + 0.50 sys = 11.82 CPU) @ 84602.37/s (n=100) Benchmark: timing 100 iterations RegexNoI(A): 16 wallclock secs (13.84 usr + 0.29 sys = 14.13 CPU) @ 70771.41/s (n=100) RegexNoI(z): 17 wallclock secs (14.05 usr + 0.33 sys = 14.38 CPU) @ 69541.03/s (n=100) RegexWithI(A): 16 wallclock secs (13.57 usr + 0.27 sys = 13.84 CPU) @ 72254.34/s (n=100) RegexWithI(z): 20 wallclock secs (14.06 usr + 0.53 sys = 14.59 CPU) @ 68540.10/s (n=100) tr(A): 15 wallclock secs (11.19 usr + 0.25 sys = 11.44 CPU) @ 87412.59/s (n=100) tr(z): 13 wallclock secs (11.17 usr + 0.14 sys = 11.31 CPU) @ 88417.33/s (n=100) Benchmark: timing 100 iterations RegexNoI(A): 17 wallclock secs (13.76 usr + 0.16 sys = 13.92 CPU) @ 71839.08/s (n=100) RegexNoI(z): 18 wallclock secs (13.95 usr + 0.41 sys = 14.36 CPU) @ 69637.88/s (n=100) RegexWithI(A): 15 wallclock secs (13.69 usr + 0.27 sys = 13.96 CPU) @ 71633.24/s (n=100) RegexWithI(z): 14 wallclock secs (13.49 usr + 0.06 sys = 13.55 CPU) @ 73800.74/s (n=100) tr(A): 13 wallclock secs (11.17 usr + 0.16 sys = 11.33 CPU) @ 88261.25/s (n=100) tr(z): 13 wallclock secs (10.78 usr + 0.25 sys = 11.03 CPU) @ 90661.83/s (n=100) make if that what you will... i've pasted the code i used below, it isn't very interesting. -- Best regards, Daniel The only thing worse than being talked about - is not being talked about! - Oscar Wilde. #!/usr/bin/perl -w use Benchmark; $string1 = A; $string2 = z; timethese( 100, { 'RegexWithI(A)' = 'with_i($string1)' , 'RegexWithI(z)' = 'with_i($string2)', 'RegexNoI(A)' = 'without_i($string1)', 'RegexNoI(z)' = 'without_i($string2)', 'tr(A)' = 'tr_without($string1)', 'tr(z)' = 'tr_without($string2)' }); sub with_i { my ($string) = @_; $string =~ /[A-Z0-9]/i; } sub without_i { my ($string) = @_; $string =~ /[A-Za-z0-9]/; } sub tr_without { my ($string) = @_; $string =~ tr/[A-Za-z0-9]//; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: $searchstring help
On Sat, Dec 08, 2001 at 08:21:38AM +0800, Leon wrote: The original poster says at least 1 letter or number .. i want something like..if $searchstring has at least 1 letter or number { commands... }; Therefore it should be $searchstring=~/[a-zA-Z0-9]+/; The + doesn't do anything except potentially slow down the regex, and fill $, $+, and $+ with different data. He wants the regex to match if it contains at least 1 letter or number, therefore /[a-zA-Z0-9]/ is correct, as it will match 1 letter or number. Michael -- Administrator www.shoebox.net Programmer, System Administrator www.gallanttech.com -- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: Passing variables
Ron, I think you meant to send this to the list, too :) I don't know ksh, so I am terribly familiar with what's going on there, but it doesn't look terribly difficult. I still don't know if you need anything returned to the user. If you don't and these programs don't take long to run, you could use the multiple argument form of system. no, nothing is returned to the user.. the script (all_blah.pl) will kick off a Diag process which the trster just tail -f the .out file system( $program, $client, $stagger, $start ); that would not be possible, the names of the program change from releas to release to indicate the release number. IE all_VALUTEST_D40_wValidate.scr If you need the return data, you could use backticks. You state that you verify the input, I would just caution you that this is *very* dangerous. by verify I mean to check users input into the front-end piece, to ensure they enter a number for the clients etc.. I'm sure there are other ways to do this, but you're heading into administrative territory and that's not my strong suit. Someone else on the list is probably better prepared to answer this. Cheers, Curtis --- Yacketta, Ronald [EMAIL PROTECTED] wrote: Date: Fri, 07 Dec 2001 18:18:54 -0500 From: Yacketta, Ronald [EMAIL PROTECTED] Subject: RE: Passing variables To: [EMAIL PROTECTED] I am collecting information from the enduser (tester) to run a System Load test. The user will enter the # of clients to run, the client # to start at, the stagger time, sleep time, Engine server and the Diag script sleep time. The info inputted will be verified and one of 4 scripts will be called. all_fastatart all_sleepystart mixed_faststart mixed_sleepystart The all scripts have a single test within it that requires the # clients, client start number, stagger time and sleep time. The mixed script has 7 tests that require the same info as the all, BUT each test will have its own set of client #, client start # , stagger time and sleep time. here is an example of the old .ksh I am converting #!/usr/bin/ksh if [ $# != 2 ] then echo You must supply a run # and Engine hostname on the command line... echo echo i.e. $0 1 wb0300ux137 echo Valid Engine servers are: echo 4500 NodeB (wb0300ux137) echo 3500 NodeB (mc0300ux219) echo exit 255 fi RunNumber=$1 ENGHost=$2 set -x cd /apps/VQXengine/trg/ltt/scripts ClientDiag.pl $1 60 sleep 120 cd ../beta_scripts nohup run_ACF2_VQ $ENGHost all_VALUTEST_wValidate_D40.scr 1500 1 120 1 21 sleep 15 nohup run_ACF2_VQ $ENGHost PActive_0299.scr 25 1501 200 175 21 sleep 15 nohup run_ACF2_VQ $ENGHost PActive_0005.scr 55 1526 200 80 21 sleep 10 nohup run_ACF2_VQ $ENGHost IMP1_1_143.scr 25 1581 175 160 21 sleep 10 nohup run_ACF2_VQ $ENGHost IMP1_5.scr 25 1606 45 150 21 sleep 10 nohup run_ACF2_VQ $ENGHost IMP1_14.scr 40 1631 75 150 21 sleep 6 nohup run_ACF2_VQ $ENGHost Valid01Unit_wTradeIn.scr 35 1671 250 100 21 set +x in line above (run_ACF2_VQ $ENGHost all_VALUTEST_wValidate_D40.scr 1500 1 120 1) $ENGHOST needs to be supplied by the tester, as well as the 4 numeric values after the test (all_VALUTEST_wValidate_D40.scr) these values are not static, they change from test to test... -Ron = Senior Programmer Onsite! Technology (http://www.onsitetech.com/) Ovid on http://www.perlmonks.org/ __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = Senior Programmer Onsite! Technology (http://www.onsitetech.com/) Ovid on http://www.perlmonks.org/ __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
shifting scalars ??
Hello all. I'm trying to find an easy way to 'diff' two files and print what is missing from each file. Let me start by saying that the system I'm working on does not seem to like File::compare or main::compare_text. As I'm new to perl, I'm more or less trying to write a 'nested while read' loop (atleast that is what my attempts come out to look like so far). trying something like open (A, $list1) or die . while(A) chomp; { print $_\n;#just so I know that it's there } open(B, $list2) or die while(B) chomp; if $_ =~ ? # this is where I'm getting lost, want to compare $_ from above (A) to $_ from (B) then I'm just printing my diffs so I can correc the necessary files. Any suggestions would be greatly appreciated. Thanks, Craig -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: $searchstring help
Daniel Gardner wrote: Why slow it down with the 'i'? $searchstring=~/[a-zA-Z0-9]/; Why slow it down with a regular expression? :-) if ( $searchstring =~ tr/a-zA-Z0-9// ) { i was bored, and thought i'd try a little benchmark. note, this is for the specific problem expressed here, not the general case. i benchmarked the following: RegexWithI: $string =~ /[A-Z0-9]/i; RegexNoI: $string =~ /A-Za-z0-9/; tr: $string =~ tr/[A-Za-z0-9//; [snip benchmark results] #!/usr/bin/perl -w [snip code] sub with_i { my ($string) = @_; $string =~ /[A-Z0-9]/i; } sub without_i { my ($string) = @_; $string =~ /[A-Za-z0-9]/; } sub tr_without { my ($string) = @_; $string =~ tr/[A-Za-z0-9]//; } Note that the tr/// is looking for the characters '[', 'A-Z', 'a-z', '0-9', and ']' while the m// is not looking for the '[' and ']' characters so they are not equivalent. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
help with form
Hi all, I am working on a cgi script that can create a temporal file with either an uploaded file, or, in its absence, the pasted content of that file. I have managed to upload the file only if that is the only input field in my form, but if I add the choice to paste the content of the file, there is no way I can successfully create the temporal file with the content of the uploaded file. I am including with this e-mail the html code of the form I am using together with the cgi script I am working on, and I will be very happy if someone could let me know why this thing is not working. Thanks. Pedro HTML html head html head titletest/title /head /head body bgcolor=#CD link=#FF center h1 font size=+4TEST/font/h1/center pbr p hr size=2 NOSHADE brform method=POST action=../../cgi-bin/variab.cgi enctype=multiform/fo rm-data table BORDER=2 trtd pbEnter a name for your file:br/b INPUT SIZE=25 NAME=name /p /td/tr trtdp/p/td/tr trtd p bUpload your file/bbr input type=file name=file SIZE=30 /p/td/tr trtdp/p/td/tr trtd pbPaste the content of your file/b textarea NAME=alignment ROWS=10 COLS=80/textarea /td/tr/p /table /form Phr size=4 /body /html CGI #!/usr/sbin/perl -wT use CGI; use strict; use Fcntl qw( :DEFAULT :flock); #define file paths for file writes and genscan location my $bin=/usr1/par/bin; my $httproot = /usr/freeware/apache/share/htdocs/MIF/icons/; my $dir = /tmp/; #directory for writing files my $gnuplot = /usr/freeware/bin/gnuplot; my $ppmtogif = /usr/freeware/bin/ppmtogif; my $q = new CGI; print $q-header, $q-start_html(-title=Variability Results,-bgcolor=white); print $q-h1(Variability Results); my $in= $q-param(name); my $file = $q-param(file); my $fh= $q-upload( $file ); my $paste = $q-param(alignment); my $i; my $flen; my $var = $^T; $in =~ s/\s\t//g; $in = $in.$var; if (!$file) { open(INFILE, $dir/$in) || die I cannot create $in!\n; flock(INFILE, 2); print INFILE $paste; close (INFILE) || die can't close $dir/$in!; } else { open(UPLOAD,$dir/$in) or die Can't open outfile for writing: $!; $flen = 0; while (read($fh,$i,1024)) { print UPLOAD $i; $flen = $flen + 1024; if ($flen 512) { close(UPLOAD); die Error - file is too large. Save aborted.p; } } close(UPLOAD); } $q-end_html; *** PEDRO A. RECHE , pHD TL: 617 632 3824 Dana-Farber Cancer Institute,FX: 617 632 4569 Harvard Medical School, EM: [EMAIL PROTECTED] 44 Binney Street, D1510A,EM: [EMAIL PROTECTED] Boston, MA 02115 URL: http://www.reche.org ***