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
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
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
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
!~ 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
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
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
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
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>
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 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>
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>
12 matches
Mail list logo