Re: Can't locate CPAN.pm in @INC

2008-02-01 Thread Adriano Ferreira
On Feb 1, 2008 10:47 AM, Pradeep Mishra [EMAIL PROTECTED] wrote: hi all I have been trying to install spamassin using ...perl -MCPAN -e shell which throws an error Can't locate CPAN.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi

Re: 0; and 1;

2005-07-14 Thread Adriano Ferreira
On 7/14/05, Beast [EMAIL PROTECTED] wrote: I coudn't find any reference (yet) the meaning of 0; or 1; in the end of perl program. In the examples in perldoc perlmod you will find 1; # don't forget to return a true value from the file This is needed when you do a 'require' over a Perl

Re: Error on: my $sth-execute;

2005-07-18 Thread Adriano Ferreira
On 7/18/05, Ron Smith [EMAIL PROTECTED] wrote: my $sql = INSERT INTO products VALUES ('$sku', '$partNum', '$name', '$descr', '$stockNum', '$qty', '$img', 'vendNum', '$price'); Beware of the difference of double and single quotes in Perl. Double quotes interpolate: $a = 3; print a: $a\n #

Re: Error on: my $sth-execute;

2005-07-18 Thread Adriano Ferreira
On 7/18/05, Adriano Ferreira [EMAIL PROTECTED] wrote: Beware of the difference of double and single quotes in Perl. Double quotes interpolate: Oops. That's my mistake. Your single quotes are within double quotes. Let's try again. I would say that something is wrong here: my $sth = $dbh

nice low cost ISP with support for mod_perl, any suggestions

2005-09-05 Thread Adriano Ferreira
I am on the verge of trying to deploy a small web application for small business. I would like to see it working preferably under mod_perl. Does anyone has suggestions about possible providers with a good compromise between service quality and cost? As it is directed to small business, it won't

Re: how do i test for reference equality?

2005-09-13 Thread Adriano Ferreira
Are there any ways to test whether the two references point to the same thing? From perldoc perlref: Using a reference as a number produces an integer representing its storage location in memory. The only useful thing to be done with this is to compare two references numerically to

Re: how to check the particular perl module is installed or not on unix machine...............

2005-10-01 Thread Adriano Ferreira
On 10/1/05, Octavian Rasnita [EMAIL PROTECTED] wrote: perl -MModuleName -e1 You can even find out the version you have installed with perl -M'ModuleName 999' -e1 where 999 is a too large version number. For example $ perl -M'lib 999' -e1 lib version 999 required--this is only version

Re: Finding directories within a tree

2005-10-07 Thread Adriano Ferreira
On 10/7/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Basically, I have a file structure similar to: Dir1\Dir2\Support\119404\dirx\diry Dir1\Dir3\Support\119893\dirx Dir1\Dir4\Support\14\dirx\diry\dirz . Dir1\Dir1000\Support\100858 I am simply interested in finding the

Re: HOA idiocy.

2005-10-10 Thread Adriano Ferreira
Everywhere you wrote aliphatic = qw[I L V], it should be something like aliphatic = [ qw(I L V) ], storing array refs at the hash, not arrays per se. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: automatically submitting web forms.

2005-10-11 Thread Adriano Ferreira
On 10/11/05, Dan Klose [EMAIL PROTECTED] wrote: I would like to be able to automagically submit a form to a server. Take a look at WWW::Mechanize http://search.cpan.org/dist/WWW-Mechanize/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Digest::MD5 hexdigest() and md5_hex() differ

2005-10-18 Thread Adriano Ferreira
On 10/18/05, Gert [EMAIL PROTECTED] wrote: in the example below I am using Digest::MD5 for computing the md5-checksum for a string. The first solution uses the function md5_hex, the second way uses the OO method hexdigest. The results are not equal. Shouldn't they be equal? I think they

Re: unique hash keys

2006-10-23 Thread Adriano Ferreira
On 10/23/06, Romeo Theriault [EMAIL PROTECTED] wrote: This all works fine, but in the last step of the program I am trying to get the program to tell me key's that are unique to only the first hash. No matter what I do it always prints out all of the values in the first hash, not the keys that

Re: unique hash keys

2006-10-23 Thread Adriano Ferreira
On 10/23/06, Romeo Theriault [EMAIL PROTECTED] wrote: Thank you Adriano, that works nicely after I added: use Memoize::AnyDBM_File; before that I was getting this error: AnyDBM_File doesn't define an EXISTS method at I had not payed much attention to the fact that your code were using

Re: Commenting Perl code

2006-11-28 Thread Adriano Ferreira
of code which are not ready yet or which have been replaced by something else. Depending on the editor you use and your skills with it, POD may be handier to comment such blocks. Regards, Adriano Ferreira. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

Re: Who can help me to explain the reason? about regex `m' modifier.

2006-11-28 Thread Adriano Ferreira
On 11/28/06, flw [EMAIL PROTECTED] wrote: Who cabeginnersn help me to explain the reason? $ perl -e '$_=a11\nb22\nc33\n; print $_, -x15, \n;s/^a.*^b.*/x/m; print' The problem here is that \m allows ^ to match after any newline within the string, but does not change . which matches any

Re: no number return

2006-11-30 Thread Adriano Ferreira
On 11/30/06, Chris Parker [EMAIL PROTECTED] wrote: while(@numbers = ) { # Extract widths @width = split( , $numbers); Here at this piece of code, @numbers and $numbers are different variables. And you never assign anything to $numbers. Probably you want this: while () { #

Re: no number return

2006-11-30 Thread Adriano Ferreira
On 11/30/06, Chris Parker [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Adriano Ferreira wrote: On 11/30/06, Chris Parker [EMAIL PROTECTED] wrote: while(@numbers = ) { # Extract widths @width = split( , $numbers); Here at this piece of code, @numbers and $numbers

Latest Perl in Cygwin is 5.8.7?

2006-12-07 Thread Adriano Ferreira
? Anyone has clues about it? Adriano Ferreira -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: CYGWIN Uninstall

2006-12-08 Thread Adriano Ferreira
On 12/8/06, Charith Hettige [EMAIL PROTECTED] wrote: Hi All, I am having trouble uninstalling the current Cygwin installation. Since there doesn't seem to be an entry in Add/Remove of windows. Please be kind enough to help me with this. This list is not about Cygwin. We may be interested in

Re: declaring a zero size hash

2006-12-12 Thread Adriano Ferreira
On 12/12/06, Dukelow, Don [EMAIL PROTECTED] wrote: I'm trying to declare a zero size hash so a sub function can populate it and be see by all other sub's. my %loginHash(); my %loginHash; should be enough. But the use strict doesn't like it. It is not use strict that does not like it. It

Re: declaring a zero size hash

2006-12-12 Thread Adriano Ferreira
On 12/12/06, Helliwell, Kim [EMAIL PROTECTED] wrote: I think you need to do: my %loginhash = {}; That's not right. {} is a hash ref, not a hash. It stands for a scalar value. When you do that my %h = {} or, for the same result, my %h = 1; my %h = abacate; you end with a hash

Re: my, my...

2006-12-15 Thread Adriano Ferreira
On 12/15/06, John W. Krahn [EMAIL PROTECTED] wrote: Jorge Almeida wrote: I thought I already knew a few things about Perl, but I just found out I don't: #!/usr/bin/perl -w use strict; use diagnostics; my $a=27; doit(); sub doit{ print $a\n; } The

Re: my, my...

2006-12-15 Thread Adriano Ferreira
On 12/15/06, Jorge Almeida [EMAIL PROTECTED] wrote: On Fri, 15 Dec 2006, Adriano Ferreira wrote: More differences will show up if you use packages. The my() variables will have the scoping from the point they are declared to the end of But they can be redefined with my inside a routine

Re: perl modules

2006-12-18 Thread Adriano Ferreira
On 12/18/06, positive mind [EMAIL PROTECTED] wrote: In Linux, how do I check if a particular Perl module is installed or not on my system? $ perl -MSome::Module\ 99 -e '' will usually tell you something like $ perl -MYAML\ 99 -e '' YAML version 99 required--this is only version 0.62. BEGIN

Re: Use of uninitialized value in string eq

2007-01-26 Thread Adriano Ferreira
On 1/26/07, Jen Spinney [EMAIL PROTECTED] wrote: Hello list! I apologize in advance for not posting a complete sample script that shows my problem, but I can't isolate it outside of my (rather large) perl application. My problem is that I'm hit with a barrage of warnings that tell me I'm using

Re: Extract user from email address

2007-02-02 Thread Adriano Ferreira
= $addr-user; # this is casey Regards, Adriano Ferreira. Thanks, Mathew -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

Re: Does Minimal Perl works for beginners?

2007-02-02 Thread Adriano Ferreira
interpreter itself that implements a useful subset of the language, strong enough to equip the build process with advanced capabilities. This is a tool for the developers of the Perl core and not useful outside this context IIRC. Kind regards, Adriano Ferreira. -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: how to embed data in perl programs

2007-02-07 Thread Adriano Ferreira
On 2/7/07, Sharan Basappa [EMAIL PROTECTED] wrote: Hi Tom, What if I wanted to have multiple embedded (and separate) texts embedded in my program. Are you saying that I can have only one text section and that should have keyword DATA. Actually when I wrote example, I assumed that double

Re: while(1) or redo [was: Re: IPC problem]

2007-02-07 Thread Adriano Ferreira
On 2/7/07, Rob Dixon [EMAIL PROTECTED] wrote: Igor Sutton wrote: Hi fellows, Dave, you wanted to use while (1) { ... the code to be repeated .. } The above code could be written like this: { ... # the code to be repeated ... redo; } Do you think this is

Re: Extract user from email address

2007-02-08 Thread Adriano Ferreira
and tripwire work as they are or do I need to put the '@domain.com' portion in too? The domain will never change and I only need to worry about those two addresses outside of the users. Adriano Ferreira wrote: On 2/2/07, Mathew Snyder [EMAIL PROTECTED] wrote: I have a script which extracts email

Re: concatenation

2007-02-12 Thread Adriano Ferreira
On 2/12/07, Sayed, Irfan (Irfan) [EMAIL PROTECTED] wrote: Hi All, I need to concatenate specific string for each element in the array. I tried in the following way with the help of join operator. foreach (@mail) { my $str1=$_; $str1=$str1 . @abc.com; @abc.com is an interpolating string,

Re: BInding operator fails

2007-02-26 Thread Adriano Ferreira
On 2/26/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: All, Hi. I have a problem with the below code. I have two strings, $rdns and $result1. I want to make sure $result 1 is NOT part of $rdns. But the below fails...thus instead of printing the else part of the if-else-loop. It print

Re: BInding operator fails

2007-02-26 Thread Adriano Ferreira
On 2/26/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thank you both. I am trying to find out why !~ operator fails. It is due to the whitespaces. but I am using six to ignore spaces. It has nothing to do with whitespaces. As Tom said: On 2/26/07, Tom Phoenix [EMAIL PROTECTED] wrote:

Re: converting to mixed case

2007-02-26 Thread Adriano Ferreira
On 2/26/07, jm [EMAIL PROTECTED] wrote: is there a function, module, script, etc. that converts all uppercase to proper mixed case. this particular need is for an address list that is all uppercase Doing it blindly, can be easily achieved with regexes: $address =~ s/(\w)(\w*)/\u$1\L$2/g;

Re: slurp hash from file

2007-02-27 Thread Adriano Ferreira
On 2/27/07, Jorge Almeida [EMAIL PROTECTED] wrote: I want to define a hash reference like this: my $h={ a = 'a', b = 'aa \ bbb', }; (Note the string containing escaped newlines.) Now, the point is that I have the block a = 'a',

Re: what does a lone percent sign mean?

2007-03-06 Thread Adriano Ferreira
On 3/6/07, Tony Heal [EMAIL PROTECTED] wrote: I am trying to determine how this does what it does. sub IsLeapYear { my $year = shift; return 0 if $year % 4; return 1 if $year % 100; return 0 if $year % 400; return 1; } The binary operator % is the modulo or remainder

Re: Perl versus other scripting language

2007-03-30 Thread Adriano Ferreira
: http://www.lua.org/lua-l.html (Homepage) http://bazar2.conectiva.com.br/mailman/listinfo/lua (to join - via Mailman interface) Adriano Ferreira Cheers, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org

Re: Redirecting STDOUT STDERR

2007-05-07 Thread Adriano Ferreira
think you may close the handles explicitly after the restoration of STDOUT and STDERR. close OLDOUT; close OLDERR; In this case, Perl would see a second use of these handles and will not complain. Regards, Adriano Ferreira. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

Re: Convert german umlaut to ascii

2007-05-22 Thread Adriano Ferreira
-ASCII/ I learned it existed in the PerlMonks thread RFC: How to unaccent text? http://www.perlmonks.org/?node_id=609319 when [salva] made this comment http://www.perlmonks.org/?node_id=609332 Regards, Adriano Ferreira Thanks Andreas -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: Exporter query

2007-06-06 Thread Adriano Ferreira
these exporting abilities. But this import was never called. require Calculator; calc-import; would work. But what you probably want is to use package Calculator; # in your Calculator.pm file Cheers, Adriano Ferreira P.S. As a stylistical note, usually you provide exporting capabilities

Re: new vs -new

2007-06-08 Thread Adriano Ferreira
On 6/8/07, Robert Hicks [EMAIL PROTECTED] wrote: I see some modules that call new like: my $test = new Some::Module; and some like: my $test = Some::Module-new; Is there a difference and what is the recommended way? Definitely go with my $test = Some::Module-new; The indirect object

Re: Run a block of sql commands using 'here document'

2007-06-08 Thread Adriano Ferreira
On 6/8/07, Martin Barth [EMAIL PROTECTED] wrote: Hi, I know that using 'Here Documents', we can output multiple lines. But is it possible to run a couple of commands? $s = qx [sqlplus user/[EMAIL PROTECTED] ENDOFSQL select 2 from DUAL; exit ENDOFSQL]; what do you think about that:

Re: new vs -new

2007-06-11 Thread Adriano Ferreira
On 6/11/07, Robert Hicks [EMAIL PROTECTED] wrote: Dr.Ruud wrote: Adriano Ferreira schreef: Definitely go with my $test = Some::Module-new; or even with: my $test = Some::Module::-new(); While I am sure that will work...I have never seen it with parens after the new. As the docs say

Re: Leading zeros kept or not kept while increment or decrement

2007-06-12 Thread Adriano Ferreira
to use printf (or sprintf). Cheers, Adriano Ferreira. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: interpolation of function reference in a here doc

2007-07-02 Thread Adriano Ferreira
On 7/2/07, Gabriel Striewe [EMAIL PROTECTED] wrote: Dear List, I wanted to interpolate a function reference in a here doc. The following works fine: my $hello = sub { return hello world!; }; printf hello $s\n, $hello(); But when I use a heredoc instead, it

Re: how to launch perl

2007-07-20 Thread Adriano Ferreira
On 7/20/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hey Guys, I am working on linux (redhat) 1999 version without the xwindows. I have configured my dns server on this linux box and it works fine for my test lab network at home. Apache and sendmail are also working fine without any problem.

Re: how to launch perl

2007-07-20 Thread Adriano Ferreira
On 7/20/07, Chas Owens [EMAIL PROTECTED] wrote: On 7/20/07, Adriano Ferreira [EMAIL PROTECTED] wrote: snip Just adding to what John already said, it hangs because, when used without arguments like script file names or -e 'print qq{Hello, world\n}' , it expects the script is coming

Re: how do I Append to Perl's @INC array using a variable

2007-07-23 Thread Adriano Ferreira
On 7/23/07, Mr. Shawn H. Corey [EMAIL PROTECTED] wrote: Chris Pax wrote: I know that if i use: use lib /path/to/dir works. but when I try to use a variable it does not work. here is my code: @dirs = split /\// , $0; delete $dirs[-1]; my $runningDir = join /,@dirs; $runningDir.=/; use lib

Re: **Installing CGI.pm

2007-07-31 Thread Adriano Ferreira
On 7/31/07, Johnson, Reginald (GTI) [EMAIL PROTECTED] wrote: On Jul 31, 1:31 pm, [EMAIL PROTECTED] (Jackson Samson) wrote: I have downloaded the CGI.pm to my Windows machine. Do I need a C compiler to build this or can I use ppm install CGI.pm? Neither. CGI is a core Perl module. Nothing

Re: Getting sub routine name as string

2007-08-02 Thread Adriano Ferreira
On 8/2/07, Brown, Rodrick [EMAIL PROTECTED] wrote: How can I get the subroutine calling name as a string? Ie. Sub foo { } I would like to get foo back as a string. Sub::Identify may be useful. http://search.cpan.org/dist/Sub-Identify -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Getting sub routine name as string

2007-08-02 Thread Adriano Ferreira
On 8/2/07, Mr. Shawn H. Corey [EMAIL PROTECTED] wrote: Brown, Rodrick wrote: How can I get the subroutine calling name as a string? Ie. Sub foo { } I would like to get foo back as a string. See `perldoc -f caller` Shawn is absolutely right. The builtin caller is what you need to get the

Re: [OT] How do you use Perl?

2007-08-09 Thread Adriano Ferreira
On 8/9/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello list, Just be curious to see how do you guys use Perl for work.Would you be pleased to give a vote below? [a] CGI/Web Development [b] System Administration [c] mod_perl -- write Apache handler [d] write commercial products [e]

Re: Logging STDERR and other output

2007-08-30 Thread Adriano Ferreira
On 8/30/07, Peter Scott [EMAIL PROTECTED] wrote: On Thu, 30 Aug 2007 10:32:01 +0100, Beginner wrote: I want all the output plus any error messages to got to a log file. I used the BEGIN block to direct STDERR into the file: BEGIN { open(STDERR, /usr/local/myreports/report.log) ||

Re: Logging STDERR and other output

2007-08-30 Thread Adriano Ferreira
On 8/30/07, Beginner [EMAIL PROTECTED] wrote: On 30 Aug 2007 at 6:32, Peter Scott wrote: On Thu, 30 Aug 2007 10:32:01 +0100, Beginner wrote: I want all the output plus any error messages to got to a log file. I used the BEGIN block to direct STDERR into the file: BEGIN {

Re: Shell qw(mysqldump) and localtime.

2007-09-03 Thread Adriano Ferreira
core module). How could I use this command with the Shell function ? [1] : http://perldoc.perl.org/functions/localtime.html [2] : http://perldoc.perl.org/Shell.html I'm a beginner with perl... :-) Thanks ! Welcome to Perl. Best regards, Adriano Ferreira -- Shams Fantar (http

Re: finding the first non digit character in a string

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

Re: max value of an integer scalar

2005-11-03 Thread Adriano Ferreira
On 11/3/05, JeeBee [EMAIL PROTECTED] wrote: Thank you, John! I see the limit is 32 bits now. I just added 'use bigint', how easy! Further, I was wondering about why you said I wasn't just multiplying by 2 using $p=1. Isn't it exactly equal to $p*=2 ??? It is equal just up to the moment the

Perl executable pathname needs to be hardwired?

2005-12-02 Thread Adriano Ferreira
What's the rationale for hardwiring the Perl executable pathname into the Perl interpreter? It is some oddity to guarantee Perl can find its library via a relative path? Is it a safety thing? Adriano. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Perl executable pathname needs to be hardwired?

2005-12-02 Thread Adriano Ferreira
On 12/2/05, Chris Devers [EMAIL PROTECTED] wrote: Historically, Unix users could depend on a copy of Perl in /usr/bin from their vendor, and maybe a custom-installed one somewhere like /opt/bin or /usr/local/bin. With that in mind, using one of those paths usually would do something useful.

Re: Perl executable pathname needs to be hardwired?

2005-12-02 Thread Adriano Ferreira
On 12/2/05, Chris Devers [EMAIL PROTECTED] wrote: But anyway, yeah. In general, you can't depend on things working consistently if you just start randomly moving around compiled programs and libraries. Sometimes it won't matter, but other times, the results just won't be predictable. Ok. I

Re: Archive

2005-12-02 Thread Adriano Ferreira
On 12/2/05, Brent Clark [EMAIL PROTECTED] wrote: Anyone know if theres an archive link for this mailing list. You can find The Perl Mailing List Database at http://lists.perl.org and from there http://lists.cpan.org/showlist.cgi?name=beginners where you will find the

Re: Perl executable pathname needs to be hardwired?

2005-12-02 Thread Adriano Ferreira
On 12/2/05, Chris Devers [EMAIL PROTECTED] wrote: My understanding is that the Python idiom is to avoid putting the full path, in favor of something like #!/usr/bin/env python #!env python on grounds that Python may not be quite as common, but you could depend on the `env` command

Re: A Strange Syntax

2005-12-05 Thread Adriano Ferreira
On 12/5/05, Jennifer Garner [EMAIL PROTECTED] wrote: print ${*{$::{sym}}{HASH}}{name}; How to analyse the last sentence of that code?Thanks. From perldoc perlref 7. A reference can be created by using a special syntax, lovingly known as the *foo{THING} syntax. *foo{THING}

Re: A Strange Syntax

2005-12-06 Thread Adriano Ferreira
On 12/5/05, Jennifer Garner [EMAIL PROTECTED] wrote: As we know, $::{sym} == *main::sym, it's a typeglob. but what is **main::sym? and the same,what is *{$glob}?thanks. **main::sym is a syntax error, but *{*main::sym}==*main::sym. But don't be fooled by the equality $::{sym} == *main::sym. It

Re: use vars

2005-12-15 Thread Adriano Ferreira
On 12/15/05, Beast [EMAIL PROTECTED] wrote: In perlmodlib : varsPredeclare global variable names (obsolete) If this is obselete then what is the newer version of predeclare global variables? Replace things like use vars qw($FOO) with our $FOO; (unless you need to assure

Re: encode base64 password

2005-12-22 Thread Adriano Ferreira
On 12/22/05, Ken Perl [EMAIL PROTECTED] wrote: Is the MIME::Base64 support unicode? MIME::Base64 supports conversion of binary data into a limited character set, convenient for transmission by e-mail and other means that prefer pure ASCII data. I am trying to use the module to encode the a

Re: for send an email

2005-12-23 Thread Adriano Ferreira
On 12/23/05, Rafael Morales [EMAIL PROTECTED] wrote: I need to send an email to some clients, so I need to know if their mail client can accept html format or just text format. How can know that ???, I think that there is, some cpan module to do that however I haven't found it. When you send

Re: How to check for a file already opened

2005-12-23 Thread Adriano Ferreira
On 12/22/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How can I check inside a script to see if a file has already been opened early and is still open? Does the perl interpreter keep track of that kind of stuff. Maybe what you want is the function Copenhandle from CScalar::Util module. See

Re: why is 0 first?

2005-12-27 Thread Adriano Ferreira
I am curious what the reasoning behind the first element of something being zero is ($array[0]). I know I've read it before, but I can't remember. Thanks! Using indices 0 .. n make it possible to work with them like offsets from the beginning of the array. More important from a C point of

Re: [PATCH] Test that constant overloading is propagated into eval

2005-12-27 Thread Adriano Ferreira
On 12/26/05, Robin Houston [EMAIL PROTECTED] wrote: +# Check that constant overloading propagates into evals As a further confirmation of the fact, the following one-liner (using bigint and eval with strings) that used to output $ perl -Mbigint -e my $x = eval '1+2'; use Data::Dumper; print

Re: problem passing argument to function

2005-12-28 Thread Adriano Ferreira
On 12/28/05, Khairul Azmi [EMAIL PROTECTED] wrote: That one works using a solution I found on the web but the problem is when I tried to pass the argument to a function declared in the same file, the argument somehow became null. sub sample_function { print go in $_\n; -

Re: Each char / letter -- array from string value

2005-12-28 Thread Adriano Ferreira
On 12/28/05, Umesh T G [EMAIL PROTECTED] wrote: I need to put each letter from a string to an array. The usual way to tear apart a string into an array with characters is @chars = split '', $string; It is documented at Cperldoc -f split. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: checking gzip files

2005-12-30 Thread Adriano Ferreira
On 12/30/05, S Khadar [EMAIL PROTECTED] wrote: #!/usr/bin/perl use Shell; ... $dmchk=zless( $dir/$_/foo.gz); As an aside note, Cperldoc Shell advises against this style [ use Shell nothing ; ]. Prefer this: use Shell qw(zless); so that you know that you are not calling some

Re: A sub question...

2005-12-30 Thread Adriano Ferreira
On 12/30/05, Robert Hicks [EMAIL PROTECTED] wrote: Note the leading underscore in the sub name. What does that mean? Is that like making it private? Yes. But as a convention: that means: you sensible reader, don't you try to rely on this function outside of this immediate realm of code. But you

Re: checking gzip files

2005-12-30 Thread Adriano Ferreira
On 12/30/05, Xavier Noria [EMAIL PROTECTED] wrote: Even if gzipped files have always more than 0 bytes, wouldn't it be true than all empty gzipped files have the same size, and that non- empty gzipped files are greater than that minimum? In this Mac that size seems to be 24 bytes. Nope.

Re: Use of uninitialized value Error

2005-12-30 Thread Adriano Ferreira
On 12/30/05, David Gilden [EMAIL PROTECTED] wrote: In the Script below the line: last if ($num = 35) is giving me this error: Use of uninitialized value in int That's not an error, but a warning. You will find that execution goes after this. How do I avoid this error? @files probably contain

Re: How to improve speed of returning value from calling method on an array of objects?

2006-01-06 Thread Adriano Ferreira
On 1/6/06, Sai Tong [EMAIL PROTECTED] wrote: I have an array of many objects and I want to call a method on each of these objects and the save the returned values into an array: my @return_values; foreach my $retrievedObject (@array_of_objects) { push (@return_values ,

Re: The @ symbol

2006-01-13 Thread Adriano Ferreira
; It is in core documentation somewhere, even though I could not locate it right now. Cheers, Adriano Ferreira On 1/13/06, Gerald Wheeler [EMAIL PROTECTED] wrote: trying to include the following code with the abc.pl script... the snippet works in an html/css environment print EOF; style type=text

Re: The @ symbol

2006-01-13 Thread Adriano Ferreira
On 1/13/06, Adriano Ferreira [EMAIL PROTECTED] wrote: It is in core documentation somewhere, even though I could not locate it right now. Here it is: try Cperldoc perlop in the section Regexp Quote-Like Operators, search for the item EOF and everything is explained there. -- To unsubscribe, e

Re: the 'tail' problem

2006-01-14 Thread Adriano Ferreira
is use open (TAIL,tail -F $log|) or die can't open pipe:$!; Regards, Adriano Ferreira. On 1/14/06, Jeff Pang [EMAIL PROTECTED] wrote: I have a log file which is a symbol link to the real logfile,shown as following: I have to access this file in perl script with unix 'tail -f

Re: the 'tail' problem

2006-01-14 Thread Adriano Ferreira
On 1/14/06, Jeff Pang [EMAIL PROTECTED] wrote: Thanks for Adriano.I have tried the way that mentioned by you,and found it's no use for me. should the '-F' option have no effect for symlinks maybe? Well, that way would be easier if it worked. But I think with some extra logic you can do it

Re: regarding panic error message.

2006-01-31 Thread Adriano Ferreira
got the tuits to do it. Regards, Adriano Ferreira. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: problem with whitespace not splitting on split.

2006-04-26 Thread Adriano Ferreira
On 4/26/06, Rance Hall [EMAIL PROTECTED] wrote: @domain = split(' ',$domainlist); This usage of split only splits at spaces. For example, if $domaintlist contains 'a b c', you will get ('a', 'b', 'c'). It has nothing to do with other kinds of spaces. If you meant @domain = split /\s+/,

Re: Accessing page using Mechanize, have to go thr' proxy

2006-06-02 Thread Adriano Ferreira
Adding to what Tom said, if you are behind an annoying authenticating proxy like Squid, you will find that something like this works: $mech-proxy(['http', 'ftp'], 'http://proxy_user:[EMAIL PROTECTED]:/'); Have fun. Adriano. On 6/2/06, Shalaka [EMAIL PROTECTED] wrote: I've used the

Re: reading Perl syntax

2006-06-06 Thread Adriano Ferreira
The line below was folded, and $self-{'fookey'} = 'some value here'; #hashref accessible only within Package Foo; the Perl interpreter is seeing within Package Foo; Outputs: Can't locate object method within via package Package (perhaps you forgot to load Package?) at ./myOOP.pl

Re: ksh in a perl program

2006-06-06 Thread Adriano Ferreira
On 6/6/06, Lakshmi Sailaja [EMAIL PROTECTED] wrote: Can I include a korn shell script in a perl program? Not include, but you certainly can execute a shell script from within a Perl program. I have done the following but I get a compilation failed error. abc is the ksh script.

Re: ksh in a perl program

2006-06-06 Thread Adriano Ferreira
On 6/6/06, Lakshmi Sailaja [EMAIL PROTECTED] wrote: I wanted to include the shell script, abc, as I want to access a variable. The shell script, abc, actually takes a value (val) from the user. I want to use that value (val) in my perl porgram. Is that possible? Perl may take a value from the

Re: Search for a Word in a file

2006-06-07 Thread Adriano Ferreira
This one-liner works a bit like a (Unix) grep: perl -n -e 'print if /Test Case/' temp.txt and is probably efficient enough for most cases. On 6/7/06, anu p [EMAIL PROTECTED] wrote: Hi All, I have a requirement where I need to check if a word exists in a text file and if so, get the whole

Re: Search for a Word in a file

2006-06-07 Thread Adriano Ferreira
It seems like I did not read enough of your message to give you a sensible answer to your problem. # write a function to do what the one-liner did, but stopping at the first row sub find_first { my $regex = shift; local @ARGV = @_; while () {

Re: Can't locate object method - weirdness

2006-06-07 Thread Adriano Ferreira
On 6/7/06, Graeme McLaren [EMAIL PROTECTED] wrote: Hi all, I have a weird error: Can't locate object method dbh via package em_log at /path/log.cgi line 15. line 15 is the second of these two lines: my $log = em_log-new; $log-dbh($dbh); Does your code define a suitable new() ? The bare

Re: Can't locate object method - weirdness

2006-06-07 Thread Adriano Ferreira
On 6/7/06, Graeme McLaren [EMAIL PROTECTED] wrote: Hi there, thanks for your reply, here is my constructor: sub new{ my ($class) = @_; my $self = { _table = undef, _id = undef, # this refers to the column named pkey_updated_record in the log table _dbh = undef,

Re: Can't locate object method - weirdness

2006-06-07 Thread Adriano Ferreira
Graeme, (Send your messages to the list beginners@perl.org so that more people can help you out.) I still don't know where your problem is. The files you sent look ok, with some remarks: em_log.pm should contain the statement package SI::eventmaster::em_log; rather than package em_log;

Fwd: hello Sir, I have an issue with the case insensitive characters, would you plz help me

2006-08-23 Thread Adriano Ferreira
this for (glob $first.trc.*) { print FOUND: $_ if /$first.trc.$MACHINE_TYPE/i; } Adriano Ferreira -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: Intersection for each pair of arrays

2006-08-23 Thread Adriano Ferreira
($a, $b) = @pair; my ($u, $i) = unisect(@pair); print (@$a) U (@$b) = (@$u)\n(@$a) A (@$b) = (@$i)\n\n; } Kind regards, Adriano Ferreira. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first

Re: is there a path enviroment parameter that can tell perl where to find files?

2006-08-23 Thread Adriano Ferreira
or http://perldoc.perl.org/perlrun.html You will probably like the -S switch (for finding your script files via path) and PERL5LIB. Regards, Adriano Ferreira -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http

Re: [OT] perldoc typo

2006-08-25 Thread Adriano Ferreira
is probably at perlfaq5 - but I could not found a version of Perl with the problem you pointed (the dash of the arrow missing). Regards, Adriano Ferreira. On 8/24/06, Klaus Jantzen [EMAIL PROTECTED] wrote: I would like to inform whoever feels responsible for perldoc that the output of perldoc

Re: number rounding problem

2006-08-28 Thread Adriano Ferreira
*shift' 64.63 64630.00 But I am not sure you would like %12.12f $ perl -e 'printf %12.12f, 1000*shift' 64.63 64629.9993 Maybe %12.2f $ perl -e 'printf %12.2f, 1000*shift' 64.63 64630.00 Regards, Adriano Ferreira On 8/28/06, Howard, Chris [EMAIL PROTECTED] wrote: I don't know

Re: Time::Local let me faint

2006-08-29 Thread Adriano Ferreira
/2006 which is alright. Regards, Adriano Ferreira. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: general subroutine question

2006-08-30 Thread Adriano Ferreira
On 8/30/06, Derek B. Smith [EMAIL PROTECTED] wrote: Why is it so many people on the list are sarcastic??? Many enjoy being that way. Some enjoy helping people at this list and others, but get tired sometimes and forget they can only ignore what they thought to be a not-so-clear question and

Re: Regex not working as expected

2006-09-04 Thread Adriano Ferreira
Chris, I found your solution to work alright, with the exception that you probably don't want to escape | as in (?:http\|ftp\|file) but only (?:http|ftp|file) So that the test script below succeeds: use Test::More tests = 3; { my $url = ahttp://foo.org//a; $url

  1   2   >