[EMAIL PROTECTED] wrote:
> It was chop and not chomp that I need, I'm removing the last "/" on a
> directory path, not newlines
>
Then it might be safer to do a substitute, chop is very aggressive.
( my $x = $_[0] ) =~ s(/$)();
--
__END__
Just my 0.0002 million dollars worth,
--- S
[EMAIL PROTECTED] schreef:
> Anyways, this how my subroutine now looks:
>
> sub xyz {
> $x = $_[0];
Make that
my $x = $_[0] ;
Alternatives:
my $x = shift ;
my ($x) = @_ ;
(that last one if you only expect 1 parameter)
Put
use strict ;
use warnings ;
on top of ev
Thanks everyone for your help, I found the problem was with (1) my
understanding of how Perl functions act on variables in general and (2) with
how chop in
particular behaved.
My subroutine originally contained this:
sub xyz {
$x = chop $_[0];
... do stuff with $x
}
which demonstrates