Re: loop until empty string

2006-03-23 Thread John W. Krahn
Christopher Spears wrote: > I've been reading the Intermediate Perl book and am > trying to solve one of the exercises. I wrote a > script that takes input from the keyboard and uses the > input as a regular expression to search for files in a > directory. If the script finds a match, the filenam

RE: perl -c someScript >someFile

2006-03-23 Thread balan.ranganathan
Use perl -c someScript | tee file Thanks Best regards Bala -Original Message- From: tom arnall [mailto:[EMAIL PROTECTED] Sent: Friday, March 24, 2006 1:34 AM To: beginners@perl.org Subject: perl -c someScript >someFile i want to capture to a file the output of perl's '-c' comm

Re: Javascript Regex to Perl Regex

2006-03-23 Thread Jay Savage
On 3/23/06, Kevin Old <[EMAIL PROTECTED]> wrote: > Here's what I have. > > # Open js file > open JSFILE, "$ARGV[0]" or die "can't open file: $ARGV[0]"; > my $js = do { local( $/ ); }; > close JSFILE; > > # Clean js > $js =~ s/^\s*function\s+(?:\w+\(\)\s*)?\s*\{\s*\n//gi; > $js =~ s/\s*}\s*$//g

Re: loop until empty string

2006-03-23 Thread Jay Savage
On 3/23/06, Christopher Spears <[EMAIL PROTECTED]> wrote: > I've been reading the Intermediate Perl book and am > trying to solve one of the exercises. I wrote a > script that takes input from the keyboard and uses the > input as a regular expression to search for files in a > directory. If the s

Re: loop until empty string

2006-03-23 Thread Alan_C
On Thursday 23 March 2006 15:51, Christopher Spears wrote: [ exits after one round ] but . . > I want the program to keep asking the user for a > pattern until an empty string is entered. One way to do it: look for: <- added this -- there are 4 of them (4 newly added lines) wrapped the whole thi

Re: loop until empty string

2006-03-23 Thread Jaime Murillo
On Thursday 23 March 2006 15:51, Christopher Spears wrote: > I've been reading the Intermediate Perl book and am > trying to solve one of the exercises. I wrote a > script that takes input from the keyboard and uses the > input as a regular expression to search for files in a > directory. If the

loop until empty string

2006-03-23 Thread Christopher Spears
I've been reading the Intermediate Perl book and am trying to solve one of the exercises. I wrote a script that takes input from the keyboard and uses the input as a regular expression to search for files in a directory. If the script finds a match, the filename is printed out. #!/usr/bin/perl -

Re: perl -c someScript >someFile

2006-03-23 Thread Mr. Shawn H. Corey
Timothy Johnson wrote: It looks like it's using STDERR for output. Try this: perl -c someScript >somefile 2>&1 You can send it there directly: perl -c someScript 2>somefile -- Just my 0.0002 million dollars worth, --- Shawn "For the things we have to learn before we can d

RE: Javascript Regex to Perl Regex

2006-03-23 Thread Timothy Johnson
Using YAPE::Regex::Explain, this is how the first regex is being interpreted: The regular expression: (?-imsx:s/^\s*function\s+(?:\w+\(\)\s*)?\s*\{\s*\n//gi) matches as follows: NODE EXPLANATION -- (?-imsx:

RE: perl -c someScript >someFile

2006-03-23 Thread Timothy Johnson
It looks like it's using STDERR for output. Try this: perl -c someScript >somefile 2>&1 -Original Message- From: tom arnall [mailto:[EMAIL PROTECTED] Sent: Thursday, March 23, 2006 12:04 PM To: beginners@perl.org Subject: perl -c someScript >someFile i want to capture to a fi

perl -c someScript >someFile

2006-03-23 Thread tom arnall
i want to capture to a file the output of perl's '-c' command-line option, as in: perl -c someScript >someFile perl insists on simply dumping the output to the screen. is there a solution to this? thanks, tom arnall north spit, ca -- To unsubscribe, e-mail: [EMAIL PROTECTE

Re: Javascript Regex to Perl Regex

2006-03-23 Thread Kevin Old
Here's what I have. # Open js file open JSFILE, "$ARGV[0]" or die "can't open file: $ARGV[0]"; my $js = do { local( $/ ); }; close JSFILE; # Clean js $js =~ s/^\s*function\s+(?:\w+\(\)\s*)?\s*\{\s*\n//gi; $js =~ s/\s*}\s*$//gi; # Write new js file open JSOUTFILE, ">out_$ARGV[0]" or die "can

RE: Javascript Regex to Perl Regex

2006-03-23 Thread Timothy Johnson
At first glance it looks like this should work: $fcode =~ s/^\s*function\s+(?:\w+\(\)\s*)?\s*\{\s*\n//gi; but I don't have any code to test it on. What do you expect to happen, and what is really happening? -Original Message- From: Kevin Old [mailto:[EMAIL PROTECTED] Sent: Thu

Re: newbie sort question

2006-03-23 Thread tom arnall
This is not exactly an answer to your question, but hopefully it will be helpful. Whenever I have what is for me a non-trivial problem in an application, I write a script that deals only with what seems to be the error in the application script. I then fiddle with the former until I solve the

Javascript Regex to Perl Regex

2006-03-23 Thread Kevin Old
Hello everyone, I have a piece of javascript that formats a chunk of javascript into a "pretty print" version of it. I'd like to have a command line version of this, but can't seem to get the regexes to work in Perl. Just a long shot, but can anyone help with the conversion of them from JS to Pe

RE: perl msi version 5.0.0

2006-03-23 Thread Timothy Johnson
I assume you're referring to ActiveState PerlMSI that comes as a part of the Perl Dev Kit. I would contact ActiveState and see if they have the old version. -Original Message- From: Bowen, Bruce [mailto:[EMAIL PROTECTED] Sent: Thursday, March 23, 2006 6:30 AM To: beginners@perl.org Subj

Re: perl code help

2006-03-23 Thread Jay Savage
On 3/23/06, Irfan J Sayed <[EMAIL PROTECTED]> wrote: > Hi Chas, > > Thanks for mail. > > I am writting this script in clearquest application and i really don't > know what is the meaning of $entity. In clearquest language "An Entity > object representing a user data record" > > and secound thing i

Re: perl code help

2006-03-23 Thread Irfan J Sayed
Hi Chas, Thanks for mail. I am writting this script in clearquest application and i really don't know what is the meaning of $entity. In clearquest language "An Entity object representing a user data record" and secound thing i am running this perl script on windows. so i really don't know w

Re: perl code help

2006-03-23 Thread Chas Owens
On 3/23/06, Irfan J Sayed <[EMAIL PROTECTED]> wrote: > > > Hi Chas, > > This is the only program i am using. > > Plz tell me what i am doing wrong. > snip > > > Following is the script > > > > $sessionobj = $entity->GetSession(); > > $username = $session->GetUserLoginName(); > > $entity->SetFi

Re: perl code help

2006-03-23 Thread Irfan J Sayed
Hi Chas, This is the only program i am using. Plz tell me what i am doing wrong. Regards Irfan Sayed "Chas Owens" <[EMAIL PROTECTED]> 03/23/2006 10:29 PM To Irfan J Sayed/India/[EMAIL PROTECTED] cc beginners@perl.org Subject Re: perl code help On 3/23/06, Irfan J Sayed <[EMAIL PROT

Re: perl code help

2006-03-23 Thread Chas Owens
On 3/23/06, Irfan J Sayed <[EMAIL PROTECTED]> wrote: > Hi All, > > I have written simple script in perl to get the user login name > > Following is the script > > $sessionobj = $entity->GetSession(); > $username = $session->GetUserLoginName(); > $entity->SetFieldValue("submitter_id", $username); >

perl code help

2006-03-23 Thread Irfan J Sayed
Hi All, I have written simple script in perl to get the user login name Following is the script $sessionobj = $entity->GetSession(); $username = $session->GetUserLoginName(); $entity->SetFieldValue("submitter_id", $username); But when i am running my cq application this hook is not executing a

Re: how to define variable in perl

2006-03-23 Thread JupiterHost.Net
Irfan J Sayed wrote: Hi, Hello, Plz let me know how to define variable in perl my $homework = 'cheating'; my @todolist = qw(perldoc RTFM STFW); my %perldoc = ( 'perlintro' => 'Perl introduction for beginners', 'perldata' => 'Perl data structures', ); HTH :) -- To unsubscribe

Re: how to define variable in perl

2006-03-23 Thread Jeff Pang
> >Plz let me know how to define variable in perl > Hello.See this article please,it's very useful for your purpose and is easy for understanding. "Coping with Scoping" http://perl.plover.com/FAQs/Namespaces.html.en -- Jeff Pang NetEase AntiSpam Team http://corp.netease.com -- To unsubscribe

Re: how to define variable in perl

2006-03-23 Thread Chas Owens
On 3/23/06, Irfan J Sayed <[EMAIL PROTECTED]> wrote: > Hi, > > Plz let me know how to define variable in perl > > Regards > Irfan Sayed That depends on what you mean by define. I believe this is what you are looking for my $var; But without more information I cannot be certain. -- To unsubscri

how to define variable in perl

2006-03-23 Thread Irfan J Sayed
Hi, Plz let me know how to define variable in perl Regards Irfan Sayed

perl msi version 5.0.0

2006-03-23 Thread Bowen, Bruce
Does anyone still have access to this version? I have thousands of system with hundreds of scripts already installed and the version on the development side is 5.0.1 and there are differences, however slight. Thanks, Bruce Bowen 401-568-8315

Re: \Q\E fails with '$' ?

2006-03-23 Thread John W. Krahn
tom arnall wrote: > from the debugger: > > p 1 if /[\Q$\E]/ > > gets: > > Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE E\]/ > > the following works: > > p 1 if /[\Q\$\E]/ > > but shouldn't \Q \E be sufficient to make perl treat '$' as a literal? No, inter

Re: newbie sort question

2006-03-23 Thread Jeff Pang
>this is my friend's script > ># collect all score > my @output = (); > my @old_output = (); > foreach my $list (@bugkillers) { >my ($id,$name) = split(/,/, $list); >my $score = >$Bugs->getSCORE($showold,$id,$contest,$pContest,$groups); >push(@output,"$score,

ignore question about debugger and modules

2006-03-23 Thread tom arnall
please ignore question about debugger and modules. i was using 'n' instead of 's' to step through the code. thanks, tom arnall north spit, ca -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

newbie sort question

2006-03-23 Thread Val Genova
am a real newbie to perl I have a friend who wrote this program which outputs the scores of my friends the code works and outputs the correct scores and arrangement of the scores but im having this error on my http/error_log, this is the error: [Thu Mar 23 16:43:28 2006] [error] [client 203

debugger and module code

2006-03-23 Thread tom arnall
is there any way to get the debugger to work on code in module files? thanks, tom arnall north spit, ca -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

\Q\E fails with '$' ?

2006-03-23 Thread tom arnall
from the debugger: p 1 if /[\Q$\E]/ gets: Unmatched [ in regex; marked by <-- HERE in m/[ <-- HERE E\]/ the following works: p 1 if /[\Q\$\E]/ but shouldn't \Q \E be sufficient to make perl treat '$' as a literal? thanks, tom arnall north spit, ca -- To u