Re: What is 'new' doing?

2006-11-22 Thread Adriano Rodrigues
On 11/22/06, Mathew Snyder <[EMAIL PROTECTED]> wrote: In this line of code what is 'new' doing? my $users = new RT::Users(RT::SystemUser); Mathew, This is called the indirect object notation. It is invoking the method 'new' of the package 'RT::Users', with arguments ( RT::SystemUser ). It is

Re: How to make a perl program to an exe file

2006-11-22 Thread Adriano Rodrigues
On 11/22/06, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: Hi Rajeev, I tried using Perlcc, but the following error occurs. perlcc is a no go. It is not maintained anymore. In bleedperl (the development version of Perl) it was retired. I think PAR may be the answer you're looking for. The pp (

Re: How to define modules?

2006-11-14 Thread Adriano Rodrigues
On 11/14/06, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: I have perl programs with me and i wish to convert it into perl modules. Can i know how to do the same? Dharshana, The basic reading on this subject may be found at the installed perldoc pages at your machine perlmod

Re: two questions

2006-11-13 Thread Adriano Rodrigues
On 11/13/06, Tim Wolak <[EMAIL PROTECTED]> wrote: That worked, so basicly what the \Q \E is doing is searching for non-word characters from the beginning of the line and then stops after the "E$" in my variable? Not quite right. \Q \E tell that everything in between should be interpreted as lit

Re: two questions

2006-11-13 Thread Adriano Rodrigues
On 11/13/06, Tim Wolak <[EMAIL PROTECTED]> wrote: I have changed it to: if ($grp =~ /E\$/) { $grp = "E\$"; } This however still does not grab the "E$" from the file, I have done it several ways to try and get it to work. You have problems because of the interpolation

Re: two questions

2006-11-13 Thread Adriano Rodrigues
On 11/13/06, Tim Wolak <[EMAIL PROTECTED]> wrote: My second question is when I use getopt it never detects incorrect usage if you leave out an options and complains about the variable not being there instead of informing the user they missed an option. People will tell you that's how options

Re: two questions

2006-11-13 Thread Adriano Rodrigues
On 11/13/06, Tim Wolak <[EMAIL PROTECTED]> wrote: Can anyone tell me why when matching E$ option it finds ZE instead? $ is special in regexps. Used like that /(E$)/, it means a string which where you find 'E' at the end of line. To match literal 'E$' you need to say /(E\$)/ to make the dollar l

Re: Trouble installing module

2006-11-07 Thread Adriano Rodrigues
On 11/7/06, C. R. <[EMAIL PROTECTED]> wrote: Thanks for your advice, but why do I need a compiler if I'm just using Perl to process an XML text file? That adds a level of complexity we just don't want to get into. Because XML::Parser has parts written in Perl and C. It is a hybrid module and re

Re: Analize Java source file with perl?

2006-10-26 Thread Adriano Rodrigues
On 10/26/06, bou, hou (GE Money, consultant) <[EMAIL PROTECTED]> wrote: hello, all I want to get the Class name of .java file with perl , I want to get like this >perl ClassChecker.pl AAA.java >ClassA >ClassB Quick and dirty: $ perl -n -e 'print "$1\n" if /class\s+(\w+)/' AAA.java ClassA Cl

Re: Is that I can do something like that ?

2006-10-25 Thread Adriano Rodrigues
On 10/25/06, Adriano Rodrigues <[EMAIL PROTECTED]> wrote: On 10/25/06, Mug <[EMAIL PROTECTED]> wrote: > I actually want to write a piece of code like that : > > my %u_info = user_detail ( $ENV{QUERY_STRING} ); > # I have $u_info{id} = 'foo' , $u_info{pass} = 1

Re: Spam from this list

2006-10-25 Thread Adriano Rodrigues
On 10/25/06, Ron Goral <[EMAIL PROTECTED]> wrote: Is anyone else receiving spam from this list? I use this email address only for this list, so it must be originating from someone on it. Any ideas? Don't you think spammers are everywhere, harvesting e-mail addresses? -- To unsubscribe, e-mail:

Re: Is that I can do something like that ?

2006-10-25 Thread Adriano Rodrigues
On 10/25/06, Mug <[EMAIL PROTECTED]> wrote: I actually want to write a piece of code like that : my %u_info = user_detail ( $ENV{QUERY_STRING} ); # I have $u_info{id} = 'foo' , $u_info{pass} = 12345 my @attribs = user_detail ( $ENV{QUERY_STRING} ); # I have @attribs = ( 'foo', 12345 ); while I

Re: file test

2006-01-24 Thread Adriano Rodrigues Ferreira
The operator -e (like the other -X operators) takes a filename or file handle, and not a glob or file name pattern with wildcards. As others pointed, you use the builtin glob to do the expansion (either explicitly or via <>). Then you might say: for (glob 'file*') { print "true\n" if -e $_;

Re: file test

2006-01-24 Thread Adriano Rodrigues Ferreira
The operator -e (like the other -X operators) takes a filename or file handle, and not a glob or file name pattern with wildcards. As others pointed, you use the builtin glob to do the expansion (either explicitly or via <>). Then you might say: for (glob 'file*') { print "true\n" if -e $_;

Re: regex help

2002-12-13 Thread Adriano Rodrigues Ferreira
> >DB4515C,625.25,378,327,382,352,805,163,513.5,699,257.88,,,"4,503","1,801",805 > >Trying to create a regex to substitute comas with pipes, except for the >commas between the double quotes. I think there is no regex which makes such a miracle. Maybe this has to do with the fact that regex are re

Re: Execute perl program without seeing the code?

2002-12-13 Thread Adriano Rodrigues Ferreira
I know little about Unix, but this will hopefully works. Maybe if you are interested about some subtle ways to hide your code even in a system which just can't close the doors for unwanted visitors (like Windows Me), you can find useful to take a look at: perldoc -m perlfilter Good lu

Cwd behavior when $PATH is not there - bug or feature?

2002-02-21 Thread Adriano Rodrigues Ferreira
I have encountered a behavior that I think it is a little odd and I have discovered it has to do with the standard module Cwd. I had a Perl script which was called by a Java application via Runtime.getRuntime().exec() I have discovered that it was a good idea to use the form that includes not on

How to export environment variables in Win32

2002-01-31 Thread Adriano Rodrigues Ferreira
I thought it would be a good idea to replace a batch script (.bat) running on a Windows 2000 with a Perl script which is far more clever. The original batch file setted two environment variables which were available after running the script. That is, if I did c:> cvs-init.bat it has commands l

Standard FileHandles for STDIN, STDOUT, STDERR

2002-01-30 Thread Adriano Rodrigues Ferreira
When using FileHandles as the object-oriented wrapper for file handles, are there predefined handles which can be used to get the standard input, standard or standard error files? If they are not predefined, how I can create them? Best regards, Adriano. -- To unsubscribe, e-mail: [EMAIL PR

Re: How do I automate an HTML form submission?

2002-01-04 Thread Adriano Rodrigues Ferreira
I am feeling pretty stupid but despite perldoc FAQ, lwpcook (thanks Randal) and some HTML tips (thanks Connie) I still can not make it work. >Let us know if "perldoc lwpcook" has enough of all that. If not, any >specific questions you bring up here will likely be answered. What I am trying to

How do I automate an HTML form submission?

2002-01-03 Thread Adriano Rodrigues Ferreira
Well, I have found the answer to this with perldoc -q html but I still don't know how to (1) fill the fields of a form in a existing web page, (2) and then submit it. I need more code, examples and explanations. Can someone give me a clue. Thanks, Adriano. -- To unsubscribe, e-ma

Re: compare between two arrays

2002-01-02 Thread Adriano Rodrigues Ferreira
>I want to compare between two arrays. This is what you want? $fail = 0; if (@a!=@b) { $fail = 1; } else { for ( $i=0; $i<@a; $i++ ) { if ($a[$i]==$b[$i]) { next; } else { $fail = 1; last; } } } if ($fail) { print "not equal\n"; } else { print "equal\n"; }

Re: Parsing large text files

2002-01-02 Thread Adriano Rodrigues Ferreira
If the file is too large, don't create a list of lines in memory. You may have problems if you do it. Instead, do open(NEWQUOTES,"newquotes.txt"); open(OTHERFILE,">otherfile.txt"); while ($line=) { chomp $line; my @fields = map { $_ .= " " x (255-length($_)) } split(/,/,$line);

trimming multiline strings

2001-12-28 Thread Adriano Rodrigues Ferreira
My problem is: Given a (multiline) string, I want a function which remove all leading and trailing white-space (as given by \s). Examples: " abbds \n sass " => "abbds \n sass" "a " => "a" " \n first phrase \n second ph