[EMAIL PROTECTED] am Dienstag, 4. Juli 2006 19:17:
> I have a subroutine that, amongst other things, chops a scalar variable,
> $dir, passed to it as an argument. The problem is that I need $dir intact
> (ie unchopped) after calling said subroutine, but it has been altered by
> the chop. I can't
Aaron Priven wrote:
> You should show us some code.
>
> Normally you would do this in the subroutine:
>
> sub routine {
>
>my $mydir = shift;
># which puts the value of $_[0] into $mydir
># and then removes that from the argument list
>chop $mydir;
># do stuff with $mydir
>
On Jul 4, 2006, at 10:46 AM, Aaron Priven wrote:
you could pass it an expression that returns the value of $a.
Sorry, I should have said "your variable" instead of "$a" here.
--
Aaron Priven, [EMAIL PROTECTED], http://www.priven.com/aaron
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For a
You should show us some code.
Normally you would do this in the subroutine:
sub routine {
my $mydir = shift;
# which puts the value of $_[0] into $mydir
# and then removes that from the argument list
chop $mydir;
# do stuff with $mydir
}
That makes a copy of the value. It sound
[EMAIL PROTECTED] wrote:
> I have a subroutine that, amongst other things, chops a scalar variable,
> $dir, passed to it as an argument. The problem is that I need $dir intact
> (ie
> unchopped) after calling said subroutine, but it has been altered by the
> chop. I
> can't figure out how to
I have a subroutine that, amongst other things, chops a scalar variable,
$dir, passed to it as an argument. The problem is that I need $dir intact (ie
unchopped) after calling said subroutine, but it has been altered by the chop.
I
can't figure out how to pass the value (or more precisely, a