Re: Converting to capital only one word in a line

2007-01-15 Thread Leonid Grinberg
The backslash escapes the character following it. Oh, that's right. Sorry. Using scalar() there is redundant as the expression is already in scalar context. Also using "scalar(@split_home) - 1" will not work correctly if the value of $[ has been changed. What exactly *is* $[? It has been co

Re: Converting to capital only one word in a line

2007-01-14 Thread Leonid Grinberg
You don't have to escape the colon in a regular expression. Oh, cool. Didn't know that. > my $home = $split_line[5]; > my @split_home = split(/\/, $home); ^^^ Syntax error. The terminating delimiter is missing. I am confused. What do you mean, the terminating delimt

Re: Converting to capital only one word in a line

2007-01-14 Thread Leonid Grinberg
my @split_line = split(/\:/, $line); my $home = $split_line[5]; my @split_home = split(/\/, $home); return uc($split_home[scalar(@split_home) - 1]); On 1/11/07, Emilio Casbas <[EMAIL PROTECTED]> wrote: I know that this is not a exact perl question, but maybe someone has a perl solution. You hav

Re: Strings vs Arrays

2006-12-30 Thread Leonid Grinberg
To push something to an array: push(@array, $data); To push something onto a scalar: $scalar = $scalar . $data; -or- $scalar .= $data; The better method depends entirely on what you intend to do with the data and how you have it. It is also very easy to both split a string into an array, @arr

Re: Negate a regular expression

2006-12-30 Thread Leonid Grinberg
!~ will return true if the thing on the right does not match. In your case, however, using unless seems more logical. Something like exit unless (lc($answer) =~ /^[y|yes]$/) should work. The ^ and $ are there to make sure that the string contains nothing but ``y'' or ``yes''. Make sure that you

Modifying a PNG File

2006-12-02 Thread Leonid Grinberg
Hello, Is there a (relatively simple) way to modify an image in Perl? Ideally, this would be a PNG or GIF image. I just need to be able to modify the colors of specific pixels. Thanks in advance! -- Leonid Grinberg [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Passing a hash to a function

2006-07-18 Thread Leonid Grinberg
microsoft"} = "Windows"; $operating_systems{"apple"} = "Macintosh"; ... return %operating_systems; } What should the ? be? If it was an array, it would be @_; if it was a scalar, it would be my ($scalar) = @_, $_[0], or shift; How about with a hash? Than

Re: Perl OS system equivalence or Perl scripts for UNIX-and-Windows

2006-05-26 Thread Leonid Grinberg
e the UNIX commands yourself (or use those that others created already). Many of them are fairly easy to recreate, but some are more difficult. Obviously, rewriting Vi in Perl is stupid, but you can quite easily do things like ls, rm, etc. -- Leonid Grinberg [EMAIL PROTECTED] http://www.lgrinber

Re: Is there any funny game that was written in Perl? Thanks.

2006-05-24 Thread Leonid Grinberg
What about frozen bubble? That was written in Perl? Really? -- Leonid Grinberg [EMAIL PROTECTED] http://www.lgrinberg.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: What are the most successful applications of Perl? Thanks.

2006-05-23 Thread Leonid Grinberg
SLASHDOT!!! Amazing that this has not yet been mentioned! -- Leonid Grinberg [EMAIL PROTECTED] http://www.lgrinberg.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Hi

2006-05-15 Thread Leonid Grinberg
re free to experiment. Good Luck! -- Leonid Grinberg [EMAIL PROTECTED] http://www.lgrinberg.org -- 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 Perl/Web questions

2006-04-28 Thread Leonid Grinberg
rk, I just prefer do(); Cheers! -- Leonid Grinberg [EMAIL PROTECTED] http://www.lgrinberg.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>